Skip to content

Commit

Permalink
unit_recall: Move the image path back to the cfg file
Browse files Browse the repository at this point in the history
  • Loading branch information
jostephd committed Sep 26, 2019
1 parent 7c8492d commit 26a710d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion data/gui/window/unit_recall.cfg
Expand Up @@ -148,7 +148,7 @@
[image]
id = "gold_icon"
definition = "default"
# label set from C++
label = "themes/gold.png"
[/image]
[/column]

Expand Down
13 changes: 7 additions & 6 deletions src/gui/dialogs/unit_recall.cpp
Expand Up @@ -219,11 +219,7 @@ void unit_recall::pre_show(window& window)
column["label"] = maybe_inactive(unit->type_name(), recallable);
row_data.emplace("unit_type", column);

column["label"] =
recallable
? "themes/gold.png"
: "themes/gold.png~GS()";
row_data.emplace("gold_icon", column);
// gold_icon is handled below

column["label"] =
recallable
Expand Down Expand Up @@ -271,8 +267,13 @@ void unit_recall::pre_show(window& window)
recallable);
row_data.emplace("unit_traits", column);

list.add_row(row_data);
filter_options_.push_back(filter_text);
grid& grid = list.add_row(row_data);
if(!recallable) {
image *gold_icon = dynamic_cast<image*>(grid.find("gold_icon", false));
assert(gold_icon);
gold_icon->set_image(gold_icon->get_image() + "~GS()");
}
}

list.register_translatable_sorting_option(0, [this](const int i) { return recall_list_[i]->type_name().str(); });
Expand Down

0 comments on commit 26a710d

Please sign in to comment.