display dehydration status in the status table

This commit is contained in:
Simon Forsyth 2012-06-19 00:43:42 +00:00
parent 5f5067fe46
commit bc7112fd35

View File

@ -182,6 +182,29 @@ Hd, Dd*, Rd #enddef
# Events
#
[event]
name=preload
first_time_only=no
[lua]
code=<<
local _ = wesnoth.textdomain "wesnoth-utbs"
local old_unit_status = wesnoth.theme_items.unit_status
function wesnoth.theme_items.unit_status()
local u = wesnoth.get_displayed_unit()
if not u then return {} end
local s = old_unit_status()
if u.status.dehydrated then
table.insert(s, { "element", {
image = "misc/dehydration-status.png",
tooltip = _"dehydrated: This unit is dehydrated. It will lose 4 HP and have its damage reduced by 1 each turn during the day unless prevented by healers or cured by water at an oasis.\n\nUnits cannot be killed or deal no damage as a result of dehydration."
} })
end
return s
end
>>
[/lua]
[/event]
[event]
name=prestart