Support bonus="string" in [objectives][gold_carryover]

This will take the string as an explanation of a condition that needs to be satisfied to receive an early finish bonus.
This commit is contained in:
Celtic Minstrel 2018-08-04 23:36:49 -04:00
parent 9ba7fd6d4a
commit e1506935a1

View File

@ -121,6 +121,9 @@ function wml_actions.objectives.gold_carryover.generate(cfg, default_bullet)
local bonus_string = wesnoth.format(_"Early finish bonus ×$multiple.", {multiple = obj.bonus})
gold_carryover = color_prefix(r, g, b) .. gold_carryover_bullet
.. "<small>" .. bonus_string .. "</small></span>\n"
elseif type(obj.bonus) == 'string' or (type(obj.bonus) == 'userdata' and getmetatable(obj.bonus) == 'translatable string') then
gold_carryover = color_prefix(r, g, b) .. gold_carryover_bullet
.. "<small>" .. _"Early finish bonus if:" .. " " .. obj.bonus .. "</small></span>\n"
end
end