HTTT23: Address translatability issue with countdown (#1135)

This commit is contained in:
Celtic Minstrel 2017-05-18 23:06:39 -04:00
parent 02c40010a1
commit 872b1215b7

View file

@ -15,6 +15,25 @@
{EXTRA_SCENARIO_MUSIC "northern_mountains.ogg"}
{EXTRA_SCENARIO_MUSIC "legends_of_the_north.ogg"}
{EXTRA_SCENARIO_MUSIC "casualties_of_war.ogg"}
[lua]
code=<<
function wesnoth.wml_actions.show_countdown(cfg)
local _ = wesnoth.textdomain "wesnoth-httt"
local n = wesnoth.get_variable("units_to_slay")
local obj = _("Defeat one more enemy unit", "Defeat $units_to_slay enemy units", n)
wesnoth.set_variable("units_to_slay_obj", wesnoth.format(obj, {units_to_slay = n}))
if not cfg.silent then
local splash = _("Still $units_to_slay clan member to defeat!", "Still $units_to_slay clan members to defeat!", n)
wesnoth.wml_actions.print{
text = wesnoth.format(splash, {units_to_slay = n}),
size = 18,
red = 255, green = 255, blue = 255
}
end
end
>>
[/lua]
# wmllint: local spelling Bayer
[event]
@ -36,10 +55,13 @@
side=1
type=Knight
[/disallow_recruit]
[show_countdown]
silent=yes
[/show_countdown]
[objectives]
side=1
[objective]
description= _ "Defeat $units_to_slay enemy units"
description=$|units_to_slay_obj
condition=win
[/objective]
[objective]
@ -475,7 +497,7 @@
[event]
name=victory
{CLEAR_VARIABLE units_to_slay}
{CLEAR_VARIABLE units_to_slay,units_to_slay_obj}
[/event]
[event]
@ -501,11 +523,8 @@
{BONUS_VICTORY}
[/then]
[else]
[print]
text= _ "Still $units_to_slay clan members to defeat!"
size=18
red,green,blue=255,255,255
[/print]
[show_countdown]
[/show_countdown]
[/else]
[/if]
[/event]