Skip to content

Commit

Permalink
unit_recruit: Add tooltip explaining the gray
Browse files Browse the repository at this point in the history
(cherry picked from commit c9ba3ee)
  • Loading branch information
jostephd authored and Wedge009 committed Nov 13, 2019
1 parent 9d44fe9 commit 0207412
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/dialogs/unit_recruit.cpp
Expand Up @@ -141,6 +141,13 @@ void unit_recruit::pre_show(window& window)
const std::string cost_string = std::to_string(recruit->cost());

column["use_markup"] = "true";
if(!can_afford) {
// Just set the tooltip on every single element in this row.
if(wb_gold > 0)
column["tooltip"] = _("This unit cannot be recruited because you will not have enough gold at this point in your plan.");
else
column["tooltip"] = _("This unit cannot be recruited because you do not have enough gold.");
}

column["label"] = image_string + (can_afford ? "" : "~GS()");
row_data.emplace("unit_image", column);
Expand Down

0 comments on commit 0207412

Please sign in to comment.