Skip to content

Commit

Permalink
Improved functionality of favorite constructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich authored and past-due committed Jun 14, 2024
1 parent 221be39 commit 30ae267
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/hci/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 30ae267

Please sign in to comment.