Skip to content

Commit

Permalink
gui2/unit_create: Use variation_name before the variation's ut name
Browse files Browse the repository at this point in the history
Forgot that variation_name has an actual meaning when paired with
variation_id as opposed to it just being a deprecated form of
variation_id. This makes it so it's favoured by the UI over a
potentially overridden type name when present.

This makes it so the mainline Walking Corpse and Soulless units have
their translatable variation names properly displayed.
  • Loading branch information
irydacea committed Jul 9, 2020
1 parent fe5f748 commit bd676ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/dialogs/unit_create.cpp
Expand Up @@ -240,7 +240,9 @@ void unit_create::list_item_clicked(window& window)
const unit_type& uv = pair.second;

std::string uv_label;
if(!uv.type_name().empty() && uv.type_name() != ut.type_name()) {
if(!uv.variation_name().empty()) {
uv_label = uv.variation_name() + " (" + uv_id + ")";
} else if(!uv.type_name().empty() && uv.type_name() != ut.type_name()) {
uv_label = uv.type_name() + " (" + uv_id + ")";
} else {
uv_label = uv_id;
Expand Down

0 comments on commit bd676ed

Please sign in to comment.