Add female_text= to [unstore_unit] and [animate_unit]
This commit is contained in:
parent
ce09922b1f
commit
3564b88460
2 changed files with 10 additions and 2 deletions
|
@ -1684,7 +1684,10 @@ WML_HANDLER_FUNCTION(unstore_unit, /*event_info*/, cfg)
|
|||
resources::units->erase(loc);
|
||||
resources::units->add(loc, *u);
|
||||
|
||||
std::string text = cfg["text"];
|
||||
config::attribute_value text = cfg["gender"].str() == "female" ? cfg["female_text"] : cfg["text"];
|
||||
if(text.blank()) {
|
||||
text = cfg["text"];
|
||||
}
|
||||
play_controller *controller = resources::controller;
|
||||
if(!text.empty() && !controller->is_skipping_replay())
|
||||
{
|
||||
|
|
|
@ -868,9 +868,14 @@ 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"];
|
||||
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(),
|
||||
cfg["text"], text_color, hits, primary, secondary,
|
||||
text.str(), text_color, hits, primary, secondary,
|
||||
cfg["value_second"]);
|
||||
}
|
||||
const vconfig::child_list sub_anims = cfg.get_children("animate");
|
||||
|
|
Loading…
Add table
Reference in a new issue