Fix up female_text= especially in [unstore_unit], update changelog

This commit is contained in:
Celtic Minstrel 2015-08-18 14:12:48 -04:00
parent 3564b88460
commit 766f3a7701
3 changed files with 3 additions and 3 deletions

View file

@ -36,6 +36,7 @@ Version 1.13.1+dev:
* Added support for has_flag= in terrain graphics [variant].
* Added category= to [label] - allows grouping labels so that players can
show/hide them
* Add female_text= to [animate_unit] and [unstore_unit] for easier translating
* Editor:
* Added Category field and color sliders to the Edit Label panel.
* Miscellaneous and bug fixes:

View file

@ -1684,7 +1684,7 @@ WML_HANDLER_FUNCTION(unstore_unit, /*event_info*/, cfg)
resources::units->erase(loc);
resources::units->add(loc, *u);
config::attribute_value text = cfg["gender"].str() == "female" ? cfg["female_text"] : cfg["text"];
config::attribute_value text = var["gender"].str() == "female" ? cfg["female_text"] : cfg["male_text"];
if(text.blank()) {
text = cfg["text"];
}

View file

@ -868,11 +868,10 @@ void wml_animation_internal(unit_animator &animator, const vconfig &cfg, const m
secondary_loc = u->get_location().get_direction(dir);
}
}
config::attribute_value text = u->gender() == unit_race::FEMALE ? cfg["female_text"] : cfg["text"];
config::attribute_value text = u->gender() == unit_race::FEMALE ? cfg["female_text"] : cfg["male_text"];
if(text.blank()) {
text = cfg["text"];
}
const std::string text_key = u->gender() == unit_race::FEMALE ? "female_text" : "text";
animator.add_animation(&*u, cfg["flag"], u->get_location(),
secondary_loc, cfg["value"], cfg["with_bars"].to_bool(),
text.str(), text_color, hits, primary, secondary,