Fix bug #21316: make subframes within standing animations cycle by default

This commit is contained in:
David Mikos 2014-04-21 13:12:34 +09:30
parent 7267cd945f
commit 376accf81e
2 changed files with 19 additions and 1 deletions

View file

@ -68,6 +68,7 @@ Version 1.11.12+dev:
* Fix GUI2 borders around selected elements
* Fix bug #21931: controllers bugged in (basic campaign) when networked
* Fix bug #21883: make sure movement animations don't cycle with fog on
* Fix bug #21316: make subframes within standing animations cycle by default
* WML engine:
* [get_global_variable] now works properly when side != current_side.
* Fix bug #20871: Attack related events are now mpsave.

View file

@ -633,6 +633,15 @@ void unit_animation::add_anims( std::vector<unit_animation> & animations, const
config anim = ab.merge();
anim["apply_to"] = "standing";
anim["cycles"] = "true";
// add cycles to all frames within a standing animation block
BOOST_FOREACH(config::all_children_iterator ci, ab.children)
{
std::string sub_frame_name = ci->key;
size_t pos = sub_frame_name.find("_frame");
if (pos != std::string::npos) {
anim[sub_frame_name.substr(0,pos)+"_cycles"] = "true";
}
}
if (anim["layer"].empty()) anim["layer"] = default_layer;
if (anim["offscreen"].empty()) anim["offscreen"] = false;
animations.push_back(unit_animation(anim));
@ -642,7 +651,15 @@ void unit_animation::add_anims( std::vector<unit_animation> & animations, const
{
config anim = ab.merge();
anim["apply_to"] = "default";
anim["cycles"] = "false";
anim["cycles"] = "true";
BOOST_FOREACH(config::all_children_iterator ci, ab.children)
{
std::string sub_frame_name = ci->key;
size_t pos = sub_frame_name.find("_frame");
if (pos != std::string::npos) {
anim[sub_frame_name.substr(0,pos)+"_cycles"] = "true";
}
}
if (anim["layer"].empty()) anim["layer"] = default_layer;
if (anim["offscreen"].empty()) anim["offscreen"] = false;
animations.push_back(unit_animation(anim));