more backward compatibility stuff moved around
This commit is contained in:
parent
3623ba4ced
commit
07d6ded7d7
2 changed files with 13 additions and 8 deletions
|
@ -1512,12 +1512,6 @@ void unit::set_defending(const game_display &disp,const gamemap::location& loc,
|
|||
hit_type = unit_animation::MISS;
|
||||
}
|
||||
start_animation(disp,loc,choose_animation(disp,loc,"defend",damage,hit_type,attack,secondary_attack,swing_num),true);
|
||||
|
||||
// Add a blink on damage effect
|
||||
const image::locator image_loc = anim_->get_last_frame().image();
|
||||
if(damage) {
|
||||
anim_->add_frame(100,unit_frame(image_loc,100,"1.0","",game_display::rgb(255,0,0),"0.5:50,0.0:50"));
|
||||
}
|
||||
}
|
||||
|
||||
void unit::set_extra_anim(const game_display &disp,const gamemap::location& loc, std::string flag)
|
||||
|
|
|
@ -374,8 +374,19 @@ void unit_animation::back_compat_initialize_anims( std::vector<unit_animation> &
|
|||
const config::child_list& defends = expanded_cfg.get_children("defend");
|
||||
for(anim_itor = defends.begin(); anim_itor != defends.end(); ++anim_itor) {
|
||||
(**anim_itor)["apply_to"] ="defend";
|
||||
(**anim_itor)["value"]=(**anim_itor)["damage"];
|
||||
animations.push_back(unit_animation(**anim_itor));
|
||||
if(!(**anim_itor)["damage"].empty()) {
|
||||
(**anim_itor)["value"]=(**anim_itor)["damage"];
|
||||
animations.push_back(unit_animation(**anim_itor));
|
||||
if(atoi((**anim_itor)["value"].c_str()) != 0) {
|
||||
animations.back().add_frame(100,unit_frame(animations.back().get_last_frame().image(),100,"1.0","",game_display::rgb(255,0,0),"0.5:50,0.0:50"));
|
||||
}
|
||||
} else {
|
||||
(**anim_itor)["value"]="0";
|
||||
animations.push_back(unit_animation(**anim_itor)),
|
||||
(**anim_itor)["value"]="";
|
||||
animations.push_back(unit_animation(**anim_itor)),
|
||||
animations.back().add_frame(100,unit_frame(animations.back().get_last_frame().image(),100,"1.0","",game_display::rgb(255,0,0),"0.5:50,0.0:50"));
|
||||
}
|
||||
//lg::wml_error<<"defend animations are deprecate, support will be removed in 1.3.8 (in unit "<<cfg["name"]<<")\n";
|
||||
//lg::wml_error<<"please put it with an [animation] tag and apply_to=defend flag\n";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue