Author: esr
Date: Thu Feb 11 21:26:35 2010
New Revision: 41164
URL: http://svn.gna.org/viewcvs/wesnoth?rev=41164&view=rev
Log:
More impprovements in macro type checking. No conflicts in mainline.
Modified:
trunk/data/core/macros/ai_controller.cfg
trunk/data/core/macros/animation-utils.cfg
trunk/data/core/macros/items.cfg
trunk/data/core/macros/utils.cfg
trunk/data/tools/wesnoth/wmltools.py
Modified: trunk/data/core/macros/ai_controller.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/ai_controller.cfg?rev=41164&r1=41163&r2=41164&view=diff
==============================================================================
--- trunk/data/core/macros/ai_controller.cfg (original)
+++ trunk/data/core/macros/ai_controller.cfg Thu Feb 11 21:26:35 2010
@@ -1,6 +1,6 @@
#textdomain wesnoth
-#define AI_CONTROLLER AFFIX PLAYER_SIDE ALLY_SIDES VARIABLES
+#define AI_CONTROLLER AFFIX PLAYER_SIDES ALLY_SIDES VARIABLES
# expects $order_type to be set
[event]
name=apply_ai_params
@@ -126,7 +126,7 @@
# This block contains all the default settings and options.
[literal]
enabled=yes
- player_side={PLAYER_SIDE}
+ player_side={PLAYER_SIDES}
ally_sides={ALLY_SIDES}
disabled_for_sides=0
Modified: trunk/data/core/macros/animation-utils.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/animation-utils.cfg?rev=41164&r1=41163&r2=41164&view=diff
==============================================================================
--- trunk/data/core/macros/animation-utils.cfg (original)
+++ trunk/data/core/macros/animation-utils.cfg Thu Feb 11 21:26:35 2010
@@ -1345,42 +1345,42 @@
[/magic_missile_flare_frame]
#enddef
-#define MERMAID_STAFF_FLARE X_POSITION Y_POSITION
+#define MERMAID_STAFF_FLARE X_OFFSET Y_OFFSET
flare_start_time=-420
[flare_frame]
duration=60
halo=halo/merfolk/staff-flare-1.png
- halo_x,halo_y={X_POSITION},{Y_POSITION}
+ halo_x,halo_y={X_OFFSET},{Y_OFFSET}
[/flare_frame]
[flare_frame]
duration=60
halo=halo/merfolk/staff-flare-2.png
- halo_x,halo_y={X_POSITION},{Y_POSITION}
+ halo_x,halo_y={X_OFFSET},{Y_OFFSET}
[/flare_frame]
[flare_frame]
duration=60
halo=halo/merfolk/staff-flare-3.png
- halo_x,halo_y={X_POSITION},{Y_POSITION}
+ halo_x,halo_y={X_OFFSET},{Y_OFFSET}
[/flare_frame]
[flare_frame]
duration=60
halo=halo/merfolk/staff-flare-4.png
- halo_x,halo_y={X_POSITION},{Y_POSITION}
+ halo_x,halo_y={X_OFFSET},{Y_OFFSET}
[/flare_frame]
[flare_frame]
duration=60
halo=halo/merfolk/staff-flare-5.png
- halo_x,halo_y={X_POSITION},{Y_POSITION}
+ halo_x,halo_y={X_OFFSET},{Y_OFFSET}
[/flare_frame]
[flare_frame]
duration=60
halo=halo/merfolk/staff-flare-6.png
- halo_x,halo_y={X_POSITION},{Y_POSITION}
+ halo_x,halo_y={X_OFFSET},{Y_OFFSET}
[/flare_frame]
[flare_frame]
duration=60
halo=halo/merfolk/staff-flare-7.png
- halo_x,halo_y={X_POSITION},{Y_POSITION}
+ halo_x,halo_y={X_OFFSET},{Y_OFFSET}
[/flare_frame]
[flare_frame]
duration=10
@@ -1934,7 +1934,7 @@
[/attack_anim]
#enddef
-#define DRAKE_FIRE_ANIM_N_DIAGONAL_CURRENT DRAKE_NAME OFFSET
+#define DRAKE_FIRE_ANIM_N_DIAGONAL_CURRENT DRAKE_NAME OFFSET_POSITION
[attack_anim]
[filter_attack]
name=fire breath
@@ -1944,7 +1944,7 @@
begin=-400
end=100
halo=projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80
- halo_x,halo_y={OFFSET}
+ halo_x,halo_y={OFFSET_POSITION}
[/missile_frame]
start_time=-900
[if]
@@ -2008,7 +2008,7 @@
[/attack_anim]
#enddef
-#define DRAKE_FIRE_ANIM_S DRAKE_NAME OFFSET
+#define DRAKE_FIRE_ANIM_S DRAKE_NAME OFFSET_POSITION
[attack_anim]
[filter_attack]
name=fire breath
@@ -2018,7 +2018,7 @@
begin=-400
end=100
halo=projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80
- halo_x,halo_y={OFFSET}
+ halo_x,halo_y={OFFSET_POSITION}
[/missile_frame]
start_time=-900
[if]
@@ -2082,7 +2082,7 @@
[/attack_anim]
#enddef
-#define DRAKE_FIRE_ANIM_N_CURRENT DRAKE_NAME OFFSET
+#define DRAKE_FIRE_ANIM_N_CURRENT DRAKE_NAME OFFSET_POSITION
[attack_anim]
[filter_attack]
name=fire breath
@@ -2092,7 +2092,7 @@
begin=-400
end=100
halo=projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80
- halo_x,halo_y={OFFSET}
+ halo_x,halo_y={OFFSET_POSITION}
[/missile_frame]
start_time=-900
[if]
Modified: trunk/data/core/macros/items.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/items.cfg?rev=41164&r1=41163&r2=41164&view=diff
==============================================================================
--- trunk/data/core/macros/items.cfg (original)
+++ trunk/data/core/macros/items.cfg Thu Feb 11 21:26:35 2010
@@ -93,7 +93,7 @@
[/item]
#enddef
-#define PICKUPPABLE_ITEM ID X Y CAN_TAKE_FILTER IMAGE MESSAGE
CANNOT_TAKE_MESSAGE OBJECT
+#define PICKUPPABLE_ITEM ID X Y CAN_TAKE_FILTER IMAGE TEXT CANNOT_TAKE_TEXT
OBJECT
# This places an item on the map which can be picked up once, but allows
the
# player to choose whether the unit stepping on it should take it or not.
# The "object" doesn't necessarily need to be an [object], any action
works.
@@ -141,7 +141,7 @@
[then]
[message]
speaker=narrator
- message={MESSAGE}
+ message={TEXT}
image={IMAGE}
[option]
@@ -183,7 +183,7 @@
[then]
[message]
speaker=narrator
- message={CANNOT_TAKE_MESSAGE}
+ message={CANNOT_TAKE_TEXT}
image={IMAGE}
for_side=$side_number
# the above is used to prevent an AI side from
Modified: trunk/data/core/macros/utils.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/utils.cfg?rev=41164&r1=41163&r2=41164&view=diff
==============================================================================
--- trunk/data/core/macros/utils.cfg (original)
+++ trunk/data/core/macros/utils.cfg Thu Feb 11 21:26:35 2010
@@ -214,7 +214,7 @@
{CLEAR_VARIABLE MODIFY_UNIT_store}
#enddef
-#define MOVE_UNIT_BY FILTER X_OFFSET Y_OFFSET
+#define MOVE_UNIT_BY FILTER OFFSET_X OFFSET_Y
#TODO COMMENT
[store_unit]
[filter]
@@ -226,8 +226,8 @@
[/store_unit]
{FOREACH MOVE_UNIT_store unit}
- {VARIABLE_OP MOVE_UNIT_store[$unit].x add {X_OFFSET}}
- {VARIABLE_OP MOVE_UNIT_store[$unit].y add {Y_OFFSET}}
+ {VARIABLE_OP MOVE_UNIT_store[$unit].x add {OFFSET_X}}
+ {VARIABLE_OP MOVE_UNIT_store[$unit].y add {OFFSET_Y}}
[unstore_unit]
variable=MOVE_UNIT_store[$unit]
find_vacant=no
@@ -379,8 +379,8 @@
# FIXME: Documentation for these is needed.
-#define MENU_IMG_TXT IMG TXT
-"&"+{IMG}+"="+{TXT}#enddef
+#define MENU_IMG_TXT IMAGE TEXT
+"&"+{IMAGE}+"="+{TEXT}#enddef
#define MENU_IMG_TXT2 IMG TXT1 TXT2
"&"+{IMG}+"="+{TXT1}+"="+{TXT2}#enddef
Modified: trunk/data/tools/wesnoth/wmltools.py
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/wmltools.py?rev=41164&r1=41163&r2=41164&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/wmltools.py (original)
+++ trunk/data/tools/wesnoth/wmltools.py Thu Feb 11 21:26:35 2010
@@ -145,12 +145,14 @@
# Deduce the expected type of the formal
if f.startswith("_"):
f = f[1:]
- if f in ("SIDE", "X", "Y", "RED", "GREEN", "BLUE", "TURN", "RADIUS",
"PROB", "LAYER") or f.endswith("NUMBER") or f.endswith("AMOUNT") or
f.endswith("COST") or f.endswith("_X") or f.endswith("_Y") or
f.endswith("_INCREMENT") or f.endswith("_FACTOR"):
+ if f in ("SIDE", "X", "Y", "RED", "GREEN", "BLUE", "TURN", "RADIUS",
"PROB", "LAYER") or f.endswith("_SIDE") or f.endswith("NUMBER") or
f.endswith("AMOUNT") or f.endswith("COST") or f.endswith("_X") or
f.endswith("_Y") or f.endswith("_INCREMENT") or f.endswith("_FACTOR"):
ftype = "numeric"
- elif f in ("POSITION",):
+ elif f in ("POSITION",) or f.endswith("_POSITION"):
ftype = "position"
- elif f.endswith("_SPAN") or f == "SIDES":
+ elif f.endswith("_SPAN"):
ftype = "span"
+ elif f == "SIDES" or f.endswith("_SIDES"):
+ ftype = "alliance"
elif f in ("RANGE",):
ftype = "range"
elif f in ("ALIGN",):
@@ -185,7 +187,7 @@
# Deduce the type of the actual
if a.isdigit() or a.startswith("-") and a[1:].isdigit():
atype = "numeric"
- elif re.match(r"[0-9]+,[0-9]+\Z", a):
+ elif re.match(r"-?[0-9]+,-?[0-9]+\Z", a):
atype = "position"
elif re.match(r"([0-9]+\-[0-9]+,?|[0-9]+,?)+\Z", a):
atype = "span"
@@ -238,6 +240,8 @@
elif atype in ("shortname", "name", "string", "stringliteral",
"empty") and ftype == "optional_string":
pass
elif atype in ("shortname",) and ftype == "terrain_code":
+ pass
+ elif atype in ("numeric", "position", "span", "empty") and ftype ==
"alliance":
pass
elif atype != ftype and ftype is not None and atype is not None:
return False
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits