mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-10 22:31:40 +02:00
fixes #5324
This commit is contained in:
@@ -114,6 +114,7 @@ CBonusSelection::CBonusSelection()
|
||||
for(size_t b = 0; b < difficultyIcons.size(); ++b)
|
||||
{
|
||||
difficultyIcons[b] = std::make_shared<CAnimImage>(AnimationPath::builtinTODO("GSPBUT" + std::to_string(b + 3) + ".DEF"), 0, 0, 709, settings["general"]["enableUiEnhancements"].Bool() ? 480 : 455);
|
||||
difficultyIconAreas[b] = std::make_shared<LRClickableArea>(difficultyIcons[b]->pos - pos.topLeft(), nullptr, [b]() { CRClickPopup::createAndPush(CGI->generaltexth->zelp[24 + b].second); });
|
||||
}
|
||||
|
||||
if(getCampaign()->playerSelectedDifficulty())
|
||||
@@ -377,9 +378,16 @@ void CBonusSelection::updateAfterStateChange()
|
||||
for(size_t i = 0; i < difficultyIcons.size(); i++)
|
||||
{
|
||||
if(i == CSH->si->difficulty)
|
||||
{
|
||||
difficultyIcons[i]->enable();
|
||||
difficultyIconAreas[i]->enable();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
difficultyIcons[i]->disable();
|
||||
difficultyIconAreas[i]->disable();
|
||||
}
|
||||
}
|
||||
flagbox->recreate();
|
||||
createBonusesIcons();
|
||||
|
@@ -31,6 +31,7 @@ class ISelectionScreenInfo;
|
||||
class ExtraOptionsTab;
|
||||
class VideoWidgetOnce;
|
||||
class CBonusSelection;
|
||||
class LRClickableArea;
|
||||
|
||||
|
||||
/// Campaign screen where you can choose one out of three starting bonuses
|
||||
@@ -93,6 +94,7 @@ public:
|
||||
std::shared_ptr<CToggleGroup> groupBonuses;
|
||||
std::shared_ptr<CLabel> labelDifficulty;
|
||||
std::array<std::shared_ptr<CAnimImage>, 5> difficultyIcons;
|
||||
std::array<std::shared_ptr<LRClickableArea>, 5> difficultyIconAreas;
|
||||
std::shared_ptr<CButton> buttonDifficultyLeft;
|
||||
std::shared_ptr<CButton> buttonDifficultyRight;
|
||||
std::shared_ptr<CAnimImage> iconsMapSizes;
|
||||
|
Reference in New Issue
Block a user