Author: fendrin
Date: Thu Apr 23 20:29:43 2009
New Revision: 35137

URL: http://svn.gna.org/viewcvs/wesnoth?rev=35137&view=rev
Log:
More framework for wml meta tags.

Modified:
    trunk/data/scenario-lua.cfg

Modified: trunk/data/scenario-lua.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-lua.cfg?rev=35137&r1=35136&r2=35137&view=diff
==============================================================================
--- trunk/data/scenario-lua.cfg (original)
+++ trunk/data/scenario-lua.cfg Thu Apr 23 20:29:43 2009
@@ -22,7 +22,6 @@
             [attribute]
                 name=name
             [/attribute]
-
             [attribute]
                 name=lua_function
             [/attribute]
@@ -37,7 +36,7 @@
         [/wml_subtag]
 
         [wml_subtag]
-            name=standard_unit_filter
+            name=standard_location_filter
             wiki=""
             [location]
             [/location]
@@ -50,31 +49,20 @@
         [/wml_subtag]
 
         [wml_subtag]
+            name=standard_unit_filter
+            wiki=""
+            [location]
+            [/location]
+            [attribute]
+                name=id
+            [/attribute]
+            [attribute]
+                name=typ
+            [/attribute]
+        [/wml_subtag]
+
+        [wml_subtag]
             name=option
-        [/wml_subtag]
-
-        [wml_subtag]
-            name=and
-            [conditions]
-                lua_function= << return function(t) wesnoth.message "Hello 
World!" end  >>
-            [/conditions]
-        [/wml_subtag]
-
-        [wml_subtag]
-            name=or
-            wiki=""
-            [conditions]
-
-            [/conditions]
-            lua_function= << return function(cfg) end >>
-        [/wml_subtag]
-
-        [wml_subtag]
-            name=not
-            [conditions]
-
-            [/conditions]
-            lua_function= << return function(cfg) end >>
         [/wml_subtag]
 
         [wml_subtag]
@@ -82,35 +70,14 @@
             lua_function= << return function(cfg) end >>
         [/wml_subtag]
 
-        [wml_subtag]
-            name=conditions
-                [subtag]
-                    name=have_unit
-                [/subtag]
-                [subtag]
-                    name=have_location
-                [/subtag]
-                [subtag]
-                    name=variable
-                [/subtag]
-                #Meta Condition Tags
-                [subtag]
-                    name=and
-                [/subtag]
-                [subtag]
-                    name=or
-                [/subtag]
-                [subtag]
-                    name=not
-                [/subtag]
-        [/wml_subtag]
+#### Conditional Actions ####
 
         [wml_action]
             name=if
             wiki="Blah blah"
             
             [conditions]
-                
+                mode=and
             [/conditions]
 
             [subtag]
@@ -120,15 +87,79 @@
             [subtag]
                 name=else
             [/subtag]
-            lua_function= << return function(cfg) return end >>
+            lua_function= << return function(cfg) if conditions(cfg) then      
      return end >>
         [/wml_action]
 
         [wml_subtag]
             name=then
-            wiki=
-            parent=
+            wiki=""
             [actions]
             [/actions]
+        [/wml_subtag]
+
+        [wml_subtag]
+            name=else
+            wiki=""
+            [actions]
+            [/actions]
+        [/wml_subtag]
+
+        [wml_action]
+            name=switch
+            wiki= << The [switch] tag is a special case because it does not 
use Condition Tags to control whether actions are performed. Instead, it 
executes different sets of actions based on the value of a variable. >>
+            [attribute]
+                name=variable
+                wiki="The name of the variable to check."
+            [/attribute]
+            [subtag]
+                name=case
+            [/subtag]
+            [subtag]
+                name=else
+            [/subtag]
+        [/wml_action]
+
+        [wml_subtag]
+            name=case
+            [attribute]
+                name=value
+            [/attribute]
+            [action_wml]
+            [/action_wml]
+        [/wml_subtag]
+
+        [wml_action]
+            name=while
+            [conditions]
+                mode=and
+            [/conditions]
+            [subtag]
+                name=do
+            [/subtag]
+        [/wml_action]
+
+
+        [wml_subtag]
+            name=conditions
+                [subtag]
+                    name=have_unit
+                [/subtag]
+                [subtag]
+                    name=have_location
+                [/subtag]
+                [subtag]
+                    name=variable
+                [/subtag]
+                #Meta Condition Tags
+                [subtag]
+                    name=and
+                [/subtag]
+                [subtag]
+                    name=or
+                [/subtag]
+                [subtag]
+                    name=not
+                [/subtag]
         [/wml_subtag]
 
         [wml_action]
@@ -150,6 +181,81 @@
 
             lua_function= << return function(cfg) wesnoth.fire("message", { 
speaker=cfg.speaker, message=cfg.message }) end >>
         [/wml_action]
+
+#### Condition Tags ####
+        [wml_subtag]
+            name=have_unit
+            wiki="A unit with greater than zero hit points matching this 
filter exists."
+            [attribute]
+                name=count
+                wiki= <<If used, a number of units equal to the value must 
match the filter. Accepts a number, range, or comma separated range. If not 
used, the default value is "1-99999".>>
+                optional=yes
+            [/attribute]
+        [/wml_subtag]
+
+        [wml_subtag]
+            name=have_location
+            [attribute]
+                name=count
+                wiki= <<If used, a number of locations equal to the value must 
match the filter. Accepts a number, range, or comma separated range. If not 
used, the default value is "1-99999".>>
+                optional=yes
+            [/attribute]
+        [/wml_subtag]
+
+        [wml_subtag]
+            name=variable
+            wiki=""
+
+            [attribute]
+                name=name
+                type=string
+            [/attribute]
+
+            [option]
+                [attribute]
+                    name=contains
+                [/attribute]
+                [attribute]
+                    name=equals
+                [/attribute]
+                [attribute]
+                    name=not_equals
+                [/attribute]
+                [attribute]
+                    name=numerical_equals
+                [/attribute]
+                [attribute]
+                    name=numerical_not_equals
+                [/attribute]
+                [attribute]
+                    name=greater_than
+                [/attribute]
+                [attribute]
+                    name=greater_than_equal_to
+                [/attribute]
+                [attribute]
+                    name=less_than
+                [/attribute]
+                [attribute]
+                    name=less_than_equal_to
+                [/attribute]
+                [attribute]
+                    name=boolean_equals
+                    type=boolean
+                [/attribute]
+                [attribute]
+                    name=boolean_not_equals
+                    type=boolean
+                [/attribute]
+            [/option]
+
+            lua_function= << return function(cfg) return end >>
+        [/wml_subtag]
+
+
+
+#### /Condition Tags ####
+
 
     [/event]
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to