1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Implemented Scrollable class, to server as common base for such classes

This commit is contained in:
Ivan Savenko
2023-05-30 18:10:22 +03:00
parent 6fe00ad55c
commit 052d0d314a
14 changed files with 197 additions and 151 deletions

View File

@@ -89,11 +89,11 @@ void QuickRecruitmentWindow::maxAllCards(std::vector<std::shared_ptr<CreaturePur
i->slider->setAmount(maxAmount);
if(i->slider->getValue() != maxAmount)
i->slider->moveTo(maxAmount);
i->slider->scrollTo(maxAmount);
else
i->sliderMoved(maxAmount);
i->slider->moveToMax();
i->slider->scrollToMax();
allAvailableResources -= (i->creatureOnTheCard->getFullRecruitCost() * maxAmount);
}
maxButton->block(allAvailableResources == LOCPLINT->cb->getResourceAmount());
@@ -141,7 +141,7 @@ void QuickRecruitmentWindow::updateAllSliders()
i->slider->setAmount(i->slider->getValue() + maxAmount);
else
i->slider->setAmount(i->maxAmount);
i->slider->moveTo(i->slider->getValue());
i->slider->scrollTo(i->slider->getValue());
}
totalCost->createItems(LOCPLINT->cb->getResourceAmount() - allAvailableResources);
totalCost->set(LOCPLINT->cb->getResourceAmount() - allAvailableResources);