Author: ai0867
Date: Mon Feb  2 22:02:41 2009
New Revision: 32557

URL: http://svn.gna.org/viewcvs/wesnoth?rev=32557&view=rev
Log:
Update test scenario for new [set_variable] functionality.
Also test case for GUI validation failure.

Modified:
    trunk/data/scenario-test.cfg

Modified: trunk/data/scenario-test.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=32557&r1=32556&r2=32557&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Mon Feb  2 22:02:41 2009
@@ -45,7 +45,7 @@
 
     [side]
         random_gender=yes
-               id="test"
+        id="test"
         type="Silver Mage"
         side=1
         canrecruit=yes
@@ -94,7 +94,7 @@
             generate_name=yes
         [/unit]
         [unit]
-                       # A unit without a portrait.
+            # A unit without a portrait.
             x,y=18,9
             type="Wolf Rider"
             generate_name=yes
@@ -105,7 +105,7 @@
             generate_name=yes
         [/unit]
         [unit]
-                       # A unit with an old small portrait.
+            # A unit with an old small portrait.
             x,y=19,10
             type="Thief"
             generate_name=yes
@@ -116,7 +116,7 @@
             generate_name=yes
         [/unit]
         [unit]
-                       # A unit whose portrait is only shown on the right side.
+            # A unit whose portrait is only shown on the right side.
             x,y=18,11
             type="White Mage"
             gender="female"
@@ -328,51 +328,50 @@
         [filter]
             x,y,side=20,9,1
         [/filter]
-       
-               [message]
-                       speaker=unit
-                       message="Who's the parrot"
-                       [text_input]
-                               text="test"
-                               variable="parrot"
-                       [/text_input]
-               [/message]
-               
-               [message]
-                       speaker=unit
-                       message="Set the parrot settings."
-                       [text_input]
-                               label="Parrot message"
-                               variable="text"
-                       [/text_input]
-
-                       [option]
-                               message="Parrot is in denial"
-                               [command]
-                                       [message]
-                                               speaker=$parrot
-                                               message="Why are you looking at 
me, I'm no parrot!!!"
-                                       [/message]
-                                       [message]
-                                               speaker=narrator
-                               image=wesnoth-icon.png
-                                               message="A short time passes..."
-                                       [/message]
-                               [/command]
-                       [/option]
-
-                       [option]
-                               message="Parrot accepted it's fate"
-                       [/option]
-
-               [/message]
-
-               [message]
-                       speaker=$parrot
-                       message=$text
-               [/message]
-       [/event]
-       
+
+        [message]
+            speaker=unit
+            message="Who's the parrot"
+            [text_input]
+                text="test"
+                variable="parrot"
+            [/text_input]
+        [/message]
+
+        [message]
+            speaker=unit
+            message="Set the parrot settings."
+            [text_input]
+                label="Parrot message"
+                variable="text"
+            [/text_input]
+
+            [option]
+                message="Parrot is in denial"
+                [command]
+                    [message]
+                        speaker=$parrot
+                        message="Why are you looking at me, I'm no parrot!!!"
+                    [/message]
+                    [message]
+                        speaker=narrator
+                        image=wesnoth-icon.png
+                        message="A short time passes..."
+                    [/message]
+                [/command]
+            [/option]
+
+            [option]
+                message="Parrot accepted it's fate"
+            [/option]
+        [/message]
+
+        [message]
+            speaker=$parrot
+            message=$text
+        [/message]
+    [/event]
+
     [label]
         x,y=18,8
         text="drink"
@@ -385,25 +384,25 @@
             x,y,side=18,8,1
         [/filter]
 
-               [message]
-                       speaker=unit
-                       message="Pick your drink"
-                       [option]
-                               message="Soda"
-                       [/option]
-                       [option]
-                               message="Water"
-                               [command]
-                                       [message]
-                                               speaker=narrator
-                               image=wesnoth-icon.png
-                                               message="Water is nice"
-                                       [/message]
-                               [/command]
-                       [/option]
-               [/message]
-       [/event]
-       
+        [message]
+            speaker=unit
+            message="Pick your drink"
+            [option]
+                message="Soda"
+            [/option]
+            [option]
+                message="Water"
+                [command]
+                    [message]
+                        speaker=narrator
+                        image=wesnoth-icon.png
+                        message="Water is nice"
+                    [/message]
+                [/command]
+            [/option]
+        [/message]
+    [/event]
+
     [label]
         x,y=18,10
         text="poison"
@@ -416,23 +415,23 @@
             x,y,side=18,10,1
         [/filter]
 
-               [message]
-                       speaker=unit
-                       message="Pick your poison"
-                       # Uses the special syntax as described at
-                       # http://www.wesnoth.org/wiki/DescriptionWML
-                       # The ; doesn't seem to work in the old gui so no need 
to port it.
-                       [option]
-                               message="&items/potion-red.png=Something 
red=Take a sip and enjoy"
-                       [/option]
-                       [option]
-                               message="*&items/potion-blue.png=Nice 
blue=Surely you'll like that one"
-                       [/option]
-                       [option]
-                               message="&items/potion-yellow.png=Oh noes 
yellow=Oh I'm sure you'll love that one"
-                       [/option]
-               [/message]
-       [/event]
+        [message]
+            speaker=unit
+            message="Pick your poison"
+            # Uses the special syntax as described at
+            # http://www.wesnoth.org/wiki/DescriptionWML
+            # The ; doesn't seem to work in the old gui so no need to port it.
+            [option]
+                message="&items/potion-red.png=Something red=Take a sip and 
enjoy"
+            [/option]
+            [option]
+                message="*&items/potion-blue.png=Nice blue=Surely you'll like 
that one"
+            [/option]
+            [option]
+                message="&items/potion-yellow.png=Oh noes yellow=Oh I'm sure 
you'll love that one"
+            [/option]
+        [/message]
+    [/event]
 
     [label]
         x,y=17,9
@@ -446,9 +445,9 @@
             x,y,side=17,9,1
         [/filter]
 
-               [message]
-                       speaker=unit
-                       message="Battle for Wesnoth User's Manual
+        [message]
+            speaker=unit
+            message="Battle for Wesnoth User's Manual
 ================================
 
 Preface
@@ -484,9 +483,9 @@
 In the world of Wesnoth there dwell humans, elves, dwarves, orcs, drakes, 
saurians, mermen, nagas, and many other races yet more obscure and wondrous. In 
accursed lands walk undead and ghosts and specters; monsters lurk in its ruins 
and dungeons.  Each has adapted to particular terrains. Humans inhabit 
primarily the temperate grasslands. In the hills, mountains and underground 
caves orcs and dwarves are most at home. In the forests the elves reign 
supreme. In the oceans and rivers mermen and nagas dominate.
 
 For game purposes, the races group into factions; for example, orcs often 
cooperate with trolls, and elves or dwarves with humans. Some other factions 
reflect divisions within human society -- loyalists vs. outlaws, for example. 
In most campaigns, you will control units drawn a single faction. But sometimes 
factions make alliances with others, so you may face more than one faction in a 
scenario."
-               [/message]
-       [/event]
-       
+        [/message]
+    [/event]
+
     {PLACE_IMAGE items/book1.png 2 2}
     {PLACE_IMAGE items/book2.png 3 2}
     {PLACE_IMAGE items/book3.png 4 2}
@@ -732,25 +731,131 @@
             [/message]
             [message]
                 speaker=narrator
-                image=wesnoth-icon.png
-                message="How should we round $number|?
+                message="What should we do with the number $number|?"
+                [option]
+                    message="Round it"
+                    [command]
+                        [message]
+                            speaker=narrator
+                            image=wesnoth-icon.png
+                            message="How should we round $number|?
 `(any integer)
 `ceil
 `floor"
-                [text_input]
-                    variable=round
-                [/text_input]
-            [/message]
-            {VARIABLE rounded $number}
-            #            {SET_VARIABLE rounded round $round}
-            [set_variable]
-                name=rounded
-                round=$round
-            [/set_variable]
-            [message]
-                speaker=narrator
-                image=wesnoth-icon.png
-                message="Rounding $number| to $round| results in $rounded|."
+                            [text_input]
+                                variable=round
+                            [/text_input]
+                        [/message]
+                        {VARIABLE rounded $number}
+                        [set_variable]
+                            name=rounded
+                            round=$round
+                        [/set_variable]
+                        [message]
+                            speaker=narrator
+                            image=wesnoth-icon.png
+                            message="Rounding $number| to $round| results in 
$rounded|."
+                        [/message]
+                    [/command]
+                [/option]
+                [option]
+                    message="Add something"
+                    [command]
+                        [message]
+                            speaker=narrator
+                            [text_input]
+                                label="Amount"
+                                variable=amount
+                            [/text_input]
+                        [/message]
+                        {VARIABLE total $number}
+                        [set_variable]
+                            name=total
+                            add=$amount
+                        [/set_variable]
+                        [message]
+                            speaker=narrator
+                            message="Adding $amount| to $number| results in 
$total|."
+                        [/message]
+                    [/command]
+                [/option]
+                [option]
+                    message="Multiply"
+                    [command]
+                        [message]
+                            speaker=narrator
+                            [text_input]
+                                label="Amount"
+                                variable=amount
+                            [/text_input]
+                        [/message]
+                        {VARIABLE total $number}
+                        [set_variable]
+                            name=total
+                            multiply=$amount
+                        [/set_variable]
+                        [message]
+                            speaker=narrator
+                            message="$number| * $amount| = $total|."
+                        [/message]
+                    [/command]
+                [/option]
+                [option]
+                    message="Divide by something"
+                    [command]
+                        [message]
+                            speaker=narrator
+                            [text_input]
+                                label="Divisor"
+                                variable=divisor
+                            [/text_input]
+                        [/message]
+                        {VARIABLE total $number}
+                        [set_variable]
+                            name=total
+                            divide=$divisor
+                        [/set_variable]
+                        [message]
+                            speaker=narrator
+                            message="Dividing $number| by $devisor| results in 
$total|."
+                        [/message]
+                    [/command]
+                [/option]
+                [option]
+                    message="Modulo"
+                    [command]
+                        [message]
+                            speaker=narrator
+                            [text_input]
+                                label="Modulo"
+                                variable=modulo
+                            [/text_input]
+                        [/message]
+                        {VARIABLE total $number}
+                        [set_variable]
+                            name=total
+                            modulo=$modulo
+                        [/set_variable]
+                        [message]
+                            speaker=narrator
+                            message="$number| % $modulo| = $total|."
+                        [/message]
+                    [/command]
+                [/option]
+                [option]
+                    message="ints&floats"
+                    [command]
+                        [set_variable]
+                            name=int
+                            ipart=$number
+                        [/set_variable]
+                        {VARIABLE_OP float fpart $number}
+                        [message]
+                            speaker=narrator
+                            message="$number| = $int| + $float|"
+                        [/message]
+                    [/command]
+                [/option]
             [/message]
         [/event]
     [/event]
@@ -1398,7 +1503,7 @@
         x,y=10,2
         text="map change"
     [/label]
-       
+
     [event]
         name=moveto
         [filter]
@@ -1408,16 +1513,16 @@
             side=2
             message="Suddenly, Elves Besieged!"
         [/message]
-               [replace_map]
-                       
map="{campaigns/Heir_To_The_Throne/maps/01_The_Elves_Besieged.map}"
-               [/replace_map]          
+        [replace_map]
+            map="{campaigns/Heir_To_The_Throne/maps/01_The_Elves_Besieged.map}"
+        [/replace_map]
     [/event]
 
     [label]
         x,y=10,3
         text="map change2"
     [/label]
-       
+
     [event]
         name=moveto
         [filter]
@@ -1427,9 +1532,9 @@
             side=2
             message="Suddenly, Blackwater Port!"
         [/message]
-               [replace_map]
-                       
map="{campaigns/Heir_To_The_Throne/maps/02_Blackwater_Port.map}"
-               [/replace_map]  
+        [replace_map]
+            map="{campaigns/Heir_To_The_Throne/maps/02_Blackwater_Port.map}"
+        [/replace_map]
     [/event]
 
     # Capture connected villages near 13,2 for team 2


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

Reply via email to