From 30ae267472c855127f534f4bdae576847cd13ab8 Mon Sep 17 00:00:00 2001 From: Nikolay Borodin Date: Wed, 5 Jun 2024 22:38:11 +0200 Subject: [PATCH] Improved functionality of favorite constructions --- src/hci/build.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/hci/build.cpp b/src/hci/build.cpp index 3d7c1a92acc..33b1aa8128a 100644 --- a/src/hci/build.cpp +++ b/src/hci/build.cpp @@ -120,7 +120,15 @@ void BuildController::startBuildPosition(STRUCTURE_STATS *buildOption) void BuildController::toggleFavorites(STRUCTURE_STATS *buildOption) { - asStructureStats[buildOption->index].isFavorite = !shouldShowFavorites(); + bool &isFavorite = asStructureStats[buildOption->index].isFavorite; + if (shouldShowFavorites()) + { + isFavorite = false; + } + else + { + isFavorite = !isFavorite; + } updateBuildOptionsList(); } @@ -449,6 +457,10 @@ class BuildOptionButton: public StatsFormButton displayIMD(AtlasImage(), ImdObject::StructureStat(stat), xOffset, yOffset); displayIfHighlight(xOffset, yOffset); + if (asStructureStats[stat->index].isFavorite && !controller->shouldShowFavorites()) + { + iV_DrawImage(IntImages, IMAGE_ALLY_RESEARCH_TC, xOffset + x() + 44, yOffset + y() + 3); + } } private: