mail[Wesnoth-commits] r44749 - /trunk/data/lua/wml-tags.lua


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by lari . nieminen on July 27, 2010 - 10:29:
Author: zookeeper
Date: Tue Jul 27 10:29:58 2010
New Revision: 44749

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44749&view=rev
Log:
Added support for a [gold_carryover] tag inside [objectives] so that note= 
doesn't need to be abused for the carryover notes.

Modified:
    trunk/data/lua/wml-tags.lua

Modified: trunk/data/lua/wml-tags.lua
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/lua/wml-tags.lua?rev=44749&r1=44748&r2=44749&view=diff
==============================================================================
--- trunk/data/lua/wml-tags.lua (original)
+++ trunk/data/lua/wml-tags.lua Tue Jul 27 10:29:58 2010
@@ -26,9 +26,11 @@
        local objectives = ""
        local win_objectives = ""
        local lose_objectives = ""
+       local gold_carryover = ""
 
        local win_string = cfg.victory_string or _ "Victory:"
        local lose_string = cfg.defeat_string or _ "Defeat:"
+       local gold_carryover_string = cfg.gold_carryover_string or _ "Gold 
carryover:"
 
        for obj in helper.child_range(cfg, "objective") do
                local show_if = helper.get_child(obj, "show_if")
@@ -46,6 +48,20 @@
                end
        end
 
+       for obj in helper.child_range(cfg, "gold_carryover") do
+               if obj.bonus ~= nil then
+                       if obj.bonus then
+                               gold_carryover = color_prefix(255, 255, 192) 
.. "<small>" .. _"Early finish bonus." .. "</small></span>\n"
+                       else
+                               gold_carryover = color_prefix(255, 255, 192) 
.. "<small>" .. _"No early finish bonus." .. "</small></span>\n"
+                       end
+               end
+
+               if obj.carryover_percentage then
+                       gold_carryover = gold_carryover .. color_prefix(255, 
255, 192) .. "<small>" .. string.format(tostring(_ "%d%% of gold carried over 
to the next scenario."), obj.carryover_percentage) .. "</small></span>\n"
+               end
+       end
+
        local summary = cfg.summary
        if summary then
                objectives = "<big>" .. insert_before_nl(summary, "</big>") 
.. "\n"
@@ -55,6 +71,9 @@
        end
        if lose_objectives ~= "" then
                objectives = objectives .. "<big>" .. lose_string .. 
"</big>\n" .. lose_objectives
+       end
+       if gold_carryover ~= "" then
+               objectives = objectives .. gold_carryover_string .. "\n" .. 
gold_carryover
        end
        local note = cfg.note
        if note then




Related Messages


Powered by MHonArc, Updated Tue Jul 27 10:40:17 2010