From b276603b34fafa7e11584f92c9ec5be031652d93 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Fri, 14 Feb 2025 22:45:52 +0100 Subject: [PATCH] fixes #5324 --- client/lobby/CBonusSelection.cpp | 8 ++++++++ client/lobby/CBonusSelection.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/client/lobby/CBonusSelection.cpp b/client/lobby/CBonusSelection.cpp index d6bdd7ba4..586b8df91 100644 --- a/client/lobby/CBonusSelection.cpp +++ b/client/lobby/CBonusSelection.cpp @@ -114,6 +114,7 @@ CBonusSelection::CBonusSelection() for(size_t b = 0; b < difficultyIcons.size(); ++b) { difficultyIcons[b] = std::make_shared(AnimationPath::builtinTODO("GSPBUT" + std::to_string(b + 3) + ".DEF"), 0, 0, 709, settings["general"]["enableUiEnhancements"].Bool() ? 480 : 455); + difficultyIconAreas[b] = std::make_shared(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(); diff --git a/client/lobby/CBonusSelection.h b/client/lobby/CBonusSelection.h index 8d5b77c15..d9cf6b619 100644 --- a/client/lobby/CBonusSelection.h +++ b/client/lobby/CBonusSelection.h @@ -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 groupBonuses; std::shared_ptr labelDifficulty; std::array, 5> difficultyIcons; + std::array, 5> difficultyIconAreas; std::shared_ptr buttonDifficultyLeft; std::shared_ptr buttonDifficultyRight; std::shared_ptr iconsMapSizes;