diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 61fda3b47..5fe680c75 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -505,6 +505,7 @@ void CPlayerInterface::heroMovePointsChanged(const CGHeroInstance * hero) EVENT_HANDLER_CALLED_BY_CLIENT; if (makingTurn && hero->tempOwner == playerID) adventureInt->onHeroChanged(hero); + invalidatePaths(); } void CPlayerInterface::receivedResource() { 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; diff --git a/lib/bonuses/Bonus.cpp b/lib/bonuses/Bonus.cpp index 95d665d76..f956e4ba3 100644 --- a/lib/bonuses/Bonus.cpp +++ b/lib/bonuses/Bonus.cpp @@ -149,10 +149,7 @@ std::string Bonus::Description(const IGameInfoCallback * cb, std::optional // there is one known string that uses '%s' placeholder for bonus value: // "core.arraytxt.69" : "\nFountain of Fortune Visited %s", // So also add string replacement to handle this case - if (valueToShow > 0) - descriptionHelper.replaceRawString(std::to_string(valueToShow)); - else - descriptionHelper.replaceRawString("-" + std::to_string(valueToShow)); + descriptionHelper.replaceRawString(std::to_string(valueToShow)); if(type == BonusType::CREATURE_GROWTH_PERCENT) descriptionHelper.appendRawString(" +" + std::to_string(valueToShow));