mail[Wesnoth-commits] r33298 - in /trunk/data: campaigns/Eastern_Invasion/scenarios/ campaigns/Eastern_Invasion/utils/ campaigns/Legend_of_Wesmere...


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

Header


Content

Posted by esr on March 03, 2009 - 03:40:
Author: esr
Date: Tue Mar  3 03:40:17 2009
New Revision: 33298

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33298&view=rev
Log:
tweak some mcro forms so the calls can be typechecked.

Modified:
    trunk/data/campaigns/Eastern_Invasion/scenarios/12.Captured.cfg
    trunk/data/campaigns/Eastern_Invasion/utils/throneroom.cfg
    trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg
    trunk/data/campaigns/tutorial/scenarios/2_Speaking.cfg
    trunk/data/multiplayer/scenarios/ANL_utils/ANL_special_macros.cfg
    trunk/data/tools/wesnoth/wmltools.py

Modified: trunk/data/campaigns/Eastern_Invasion/scenarios/12.Captured.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Eastern_Invasion/scenarios/12.Captured.cfg?rev=33298&r1=33297&r2=33298&view=diff
==============================================================================
--- trunk/data/campaigns/Eastern_Invasion/scenarios/12.Captured.cfg (original)
+++ trunk/data/campaigns/Eastern_Invasion/scenarios/12.Captured.cfg Tue Mar  
3 03:40:17 2009
@@ -132,14 +132,14 @@
     [/clear_variable]
 #enddef
 
-#define ROLE TYPE ROLE X Y
+#define ROLE TYPE ROLE_VALUE X Y
     [role]
         type={TYPE}
         side=1
-        role={ROLE}
+        role={ROLE_VALUE}
     [/role]
     [recall]
-        role={ROLE}
+        role={ROLE_VALUE}
         x,y={X},{Y}
     [/recall]
 #enddef

Modified: trunk/data/campaigns/Eastern_Invasion/utils/throneroom.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Eastern_Invasion/utils/throneroom.cfg?rev=33298&r1=33297&r2=33298&view=diff
==============================================================================
--- trunk/data/campaigns/Eastern_Invasion/utils/throneroom.cfg (original)
+++ trunk/data/campaigns/Eastern_Invasion/utils/throneroom.cfg Tue Mar  3 
03:40:17 2009
@@ -1,12 +1,12 @@
 #textdomain wesnoth-ei
 # Macros for decorating the throneroom map.
 
-#define THRONEROOM_GUARD TYPE X Y FACING
+#define THRONEROOM_GUARD TYPE X Y FACING_VALUE
     [unit]
         side=2
         x,y={X},{Y}
         type={TYPE}
-        facing={FACING}
+        facing={FACING_VALUE}
     [/unit]
 #enddef
 

Modified: trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg?rev=33298&r1=33297&r2=33298&view=diff
==============================================================================
--- trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg (original)
+++ trunk/data/campaigns/Legend_of_Wesmere/utils/low-macros.cfg Tue Mar  3 
03:40:17 2009
@@ -267,7 +267,7 @@
 
 # Thanks to Shadow Master for this macro
 # !***Macro to random place unit within area***
-#define RANDOM_PLACEMENT _X _Y _RADIUS _UNIT_WML_STRUCT
+#define RANDOM_PLACEMENT _X _Y _RADIUS _WML
     [store_locations]
         x,y={_X},{_Y}
         radius={_RADIUS}
@@ -283,7 +283,7 @@
 
     {CLEAR_VARIABLE random_placement_locations}
 
-    {_UNIT_WML_STRUCT}
+    {_WML}
 
     [+unit]
         x,y=$random_placement_x,$random_placement_y

Modified: trunk/data/campaigns/tutorial/scenarios/2_Speaking.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/tutorial/scenarios/2_Speaking.cfg?rev=33298&r1=33297&r2=33298&view=diff
==============================================================================
--- trunk/data/campaigns/tutorial/scenarios/2_Speaking.cfg (original)
+++ trunk/data/campaigns/tutorial/scenarios/2_Speaking.cfg Tue Mar  3 
03:40:17 2009
@@ -1,23 +1,23 @@
 #textdomain wesnoth-tutorial
 
-#define TEACHER MESSAGE
+#define TEACHER MESSAGE_TEXT
     [message]
         speaker=Galdrad
-        message={MESSAGE}
+        message={MESSAGE_TEXT}
     [/message]
 #enddef
 
-#define STUDENT MESSAGE
+#define STUDENT MESSAGE_TEXT
     [message]
         speaker=student
-        message={MESSAGE}
+        message={MESSAGE_TEXT}
     [/message]
 #enddef
 
-#define NARRATOR MESSAGE
+#define NARRATOR MESSAGE_TEXT
     [message]
         speaker=narrator
-        message={MESSAGE}
+        message={MESSAGE_TEXT}
         image=wesnoth-icon.png
     [/message]
 #enddef
@@ -28,7 +28,7 @@
     [allow_undo][/allow_undo]
 #enddef
 
-#define TALK_ABOUT ID_STRING MESSAGE
+#define TALK_ABOUT ID_STRING MESSAGE_TEXT
     [scroll_to_unit]
         id={ID_STRING}
     [/scroll_to_unit]
@@ -37,21 +37,21 @@
         speaker=narrator
         image=portraits/elves/captain.png
         message=_ "*Galdrad" + "
-" + {MESSAGE}
+" + {MESSAGE_TEXT}
     [/message]
 #enddef
 
-#define TALK_NO_MOVE MESSAGE
+#define TALK_NO_MOVE MESSAGE_TEXT
     # Pretend this is narrator, since otherwise we scroll back.
     [message]
         speaker=narrator
         image=portraits/elves/captain.png
         message=_ "*Galdrad" + "
-" + {MESSAGE}
+" + {MESSAGE_TEXT}
     [/message]
 #enddef
 
-#define TALK_ABOUT_LOC POSITION MESSAGE
+#define TALK_ABOUT_LOC POSITION MESSAGE_TEXT
     [scroll_to]
         x,y={POSITION}
     [/scroll_to]
@@ -60,7 +60,7 @@
         speaker=narrator
         image=portraits/elves/captain.png
         message=_ "*Galdrad" + "
-" + {MESSAGE}
+" + {MESSAGE_TEXT}
     [/message]
 #enddef
 

Modified: trunk/data/multiplayer/scenarios/ANL_utils/ANL_special_macros.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/multiplayer/scenarios/ANL_utils/ANL_special_macros.cfg?rev=33298&r1=33297&r2=33298&view=diff
==============================================================================
--- trunk/data/multiplayer/scenarios/ANL_utils/ANL_special_macros.cfg 
(original)
+++ trunk/data/multiplayer/scenarios/ANL_utils/ANL_special_macros.cfg Tue Mar 
 3 03:40:17 2009
@@ -135,13 +135,13 @@
     [/if]
 #enddef
 
-#define ANL_RESCUE_TRAPPED_UNIT X Y X2 Y2
+#define ANL_RESCUE_TRAPPED_UNIT MOVETO_X MOVETO_Y UNIT_X UNIT_Y
     [event]
         name=moveto
         [filter]
             side=1,2,3,4
-            x={X}
-            y={Y}
+            x={MOVETO_X}
+            y={MOVETO_Y}
         [/filter]
 
         [message]
@@ -156,8 +156,8 @@
 
         [store_unit]
             [filter]
-                x={X2}
-                y={Y2}
+                x={UNIT_X}
+                y={UNIT_Y}
             [/filter]
             variable=critter
             kill=no

Modified: trunk/data/tools/wesnoth/wmltools.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/wmltools.py?rev=33298&r1=33297&r2=33298&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/wmltools.py (original)
+++ trunk/data/tools/wesnoth/wmltools.py Tue Mar  3 03:40:17 2009
@@ -126,7 +126,9 @@
 
 def formaltype(f):
     # Deduce the expected type of the formal
-    if f in ("SIDE", "X", "Y", "RED", "GREEN", "BLUE", "TURN", "RADIUS") or 
f.endswith("NUMBER") or f.endswith("AMOUNT") or f.endswith("_X") or 
f.endswith("_Y"):
+    if f.startswith("_"):
+        f = f[1:]
+    if f in ("SIDE", "X", "Y", "RED", "GREEN", "BLUE", "TURN", "RADIUS") or 
f.endswith("NUMBER") or f.endswith("AMOUNT") or f.endswith("COST") or 
f.endswith("_X") or f.endswith("_Y"):
         ftype = "numeric"
     elif f in ("POSITION",):
         ftype = "position"
@@ -140,7 +142,7 @@
         ftype = "terrain_code"
     elif f in ("NAME", "VAR", "IMAGESTEM", "ID") or f.endswith("_NAME"):
         ftype = "name"
-    elif f in ("STRING", "TYPE", "TEXT"):
+    elif f in ("STRING", "TYPE", "TEXT") or f.endswith("_TEXT"):
         ftype = "string"
     elif f in ("ID_STRING", "NAME_STRING", "DESCRIPTION"):
         ftype = "optional_string"
@@ -150,7 +152,7 @@
         ftype = "sound"
     elif f in ("FILTER",):
         ftype = "filter"
-    elif f.endswith("_WML"):
+    elif f == "WML" or f.endswith("_WML"):
         ftype = "wml"
     elif f in ("AFFIX",):
         ftype = "affix"




Related Messages


Powered by MHonArc, Updated Tue Mar 03 05:40:12 2009