Implement the move_unit_fake.image_mods attribute

This attribute accepts a list of image path functions to be applied on
the fake moving unit, similar to how object.effect.apply_to=image_mod
works.
This commit is contained in:
Ignacio R. Morelle 2011-01-03 21:38:50 +00:00
parent 52907b18ae
commit 5da7fb624f
2 changed files with 12 additions and 0 deletions

View file

@ -41,6 +41,8 @@ Version 1.9.3+svn:
addition to profile= to precisely describe portrait locations.
* New ~BG(color) modifier for setting the background color of an image.
* Made [inspect] tag work even without debug mode.
* [move_unit_fake] now accepts an image_mods= attribute, specifying
a list of path functions to be applied to the moving fake unit.
* Miscellaneous and bugfixes:
* Fix --data-dir command line option
* Better detect mouse button state when window is activated.

View file

@ -924,6 +924,7 @@ unit *create_fake_unit(const vconfig& cfg)
{
std::string type = cfg["type"];
std::string variation = cfg["variation"];
std::string img_mods = cfg["image_mods"];
size_t side_num = cfg["side"].to_int(1) - 1;
if (side_num >= resources::teams->size()) side_num = 0;
@ -940,6 +941,15 @@ unit *create_fake_unit(const vconfig& cfg)
effect["name"] = variation;
fake_unit->add_modification("variation",mod);
}
if(!img_mods.empty()) {
config mod;
config &effect = mod.add_child("effect");
effect["apply_to"] = "image_mod";
effect["add"] = img_mods;
fake_unit->add_modification("image_mod",mod);
}
return fake_unit;
}