Add a few more attributes to the [modify_unit] optimized path
This commit is contained in:
parent
2cc7fe6450
commit
1f36590e80
3 changed files with 12 additions and 0 deletions
|
@ -49,6 +49,7 @@
|
||||||
* New wesnoth.units.find gets units on either the map or any side's recall list.
|
* New wesnoth.units.find gets units on either the map or any side's recall list.
|
||||||
* Moved to interface module: wesnoth.scroll, wesnoth.zoom, wesnoth.get_mouseover_tile
|
* Moved to interface module: wesnoth.scroll, wesnoth.zoom, wesnoth.get_mouseover_tile
|
||||||
* wesnoth.interface.get_displayed_unit aliased to wesnoth.unit.get_hovered
|
* wesnoth.interface.get_displayed_unit aliased to wesnoth.unit.get_hovered
|
||||||
|
* unit portrait is now writable
|
||||||
### WML engine
|
### WML engine
|
||||||
* Support upkeep in StandardUnitFilter
|
* Support upkeep in StandardUnitFilter
|
||||||
* [effect]apply_to=variation now supports heal_full
|
* [effect]apply_to=variation now supports heal_full
|
||||||
|
|
|
@ -53,6 +53,10 @@ local known_attributes = make_set {
|
||||||
"description",
|
"description",
|
||||||
"hidden",
|
"hidden",
|
||||||
"unrenamable",
|
"unrenamable",
|
||||||
|
"profile",
|
||||||
|
"zoc",
|
||||||
|
"usage",
|
||||||
|
"upkeep",
|
||||||
}
|
}
|
||||||
|
|
||||||
local known_tags = make_set {
|
local known_tags = make_set {
|
||||||
|
@ -105,6 +109,9 @@ local function simple_modify_unit(cfg)
|
||||||
"max_experience",
|
"max_experience",
|
||||||
"resting",
|
"resting",
|
||||||
"canrecruit",
|
"canrecruit",
|
||||||
|
"zoc",
|
||||||
|
"usage",
|
||||||
|
"upkeep",
|
||||||
}
|
}
|
||||||
|
|
||||||
local function handle_unit(u)
|
local function handle_unit(u)
|
||||||
|
@ -121,6 +128,9 @@ local function simple_modify_unit(cfg)
|
||||||
if cfg.ai_special == "guardian" then
|
if cfg.ai_special == "guardian" then
|
||||||
u.status.guardian = true
|
u.status.guardian = true
|
||||||
end
|
end
|
||||||
|
if cfg.profile ~= nil then
|
||||||
|
u.portrait = profile
|
||||||
|
end
|
||||||
if cfg.unrenamable ~= nil then
|
if cfg.unrenamable ~= nil then
|
||||||
u.renamable = not cfg.unrenamable
|
u.renamable = not cfg.unrenamable
|
||||||
end
|
end
|
||||||
|
|
|
@ -440,6 +440,7 @@ static int impl_unit_set(lua_State *L)
|
||||||
modify_bool_attrib("resting", u.set_resting(value));
|
modify_bool_attrib("resting", u.set_resting(value));
|
||||||
modify_tstring_attrib("name", u.set_name(value));
|
modify_tstring_attrib("name", u.set_name(value));
|
||||||
modify_tstring_attrib("description", u.set_unit_description(value));
|
modify_tstring_attrib("description", u.set_unit_description(value));
|
||||||
|
modify_string_attrib("portrait", u.set_big_profile(value));
|
||||||
modify_string_attrib("role", u.set_role(value));
|
modify_string_attrib("role", u.set_role(value));
|
||||||
modify_string_attrib("facing", u.set_facing(map_location::parse_direction(value)));
|
modify_string_attrib("facing", u.set_facing(map_location::parse_direction(value)));
|
||||||
modify_string_attrib("usage", u.set_usage(value));
|
modify_string_attrib("usage", u.set_usage(value));
|
||||||
|
|
Loading…
Add table
Reference in a new issue