Author: zookeeper
Date: Fri Apr  4 11:54:16 2008
New Revision: 25529

URL: http://svn.gna.org/viewcvs/wesnoth?rev=25529&view=rev
Log:
Made the "get to work" and "oversee research" menus not invalidate undo if you 
cancel them and renamed the CAPTURE_VILLAGE macro to ANL_CAPTURE_VILLAGE to 
prevent conflicts.

Modified:
    trunk/data/multiplayer/scenarios/ANL_utils/ANL_general_macros.cfg
    trunk/data/multiplayer/scenarios/ANL_utils/ANL_research_options.cfg
    trunk/data/multiplayer/scenarios/ANL_utils/ANL_worker_options.cfg

Modified: trunk/data/multiplayer/scenarios/ANL_utils/ANL_general_macros.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/multiplayer/scenarios/ANL_utils/ANL_general_macros.cfg?rev=25529&r1=25528&r2=25529&view=diff
==============================================================================
--- trunk/data/multiplayer/scenarios/ANL_utils/ANL_general_macros.cfg (original)
+++ trunk/data/multiplayer/scenarios/ANL_utils/ANL_general_macros.cfg Fri Apr  
4 11:54:16 2008
@@ -28,7 +28,7 @@
        [/disallow_recruit]
 #enddef
 
-#define CAPTURE_VILLAGE
+#define ANL_CAPTURE_VILLAGE
        [capture_village]
                x=$x1
                y=$y1

Modified: trunk/data/multiplayer/scenarios/ANL_utils/ANL_research_options.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/multiplayer/scenarios/ANL_utils/ANL_research_options.cfg?rev=25529&r1=25528&r2=25529&view=diff
==============================================================================
--- trunk/data/multiplayer/scenarios/ANL_utils/ANL_research_options.cfg 
(original)
+++ trunk/data/multiplayer/scenarios/ANL_utils/ANL_research_options.cfg Fri Apr 
 4 11:54:16 2008
@@ -74,100 +74,118 @@
                                x=$x1
                                y=$y1
                        [/filter]
+                       kill=no
                        variable=unit
                [/store_unit]
 
-                       {VARIABLE finished_options no}
-                       [while]
-                               {CONDITION finished_options equals no}
-                               [do]
+               {VARIABLE finished_options no}
+               {VARIABLE cancelled no}
+               
+               [while]
+                       {CONDITION finished_options equals no}
+                       [do]
 # wmlindent:  start ignoring                           
-                                       [message]
-                                               speaker=unit
-                                               caption="Research"
+                               [message]
+                                       speaker=unit
+                                       caption="Research"
 #wmllint: display on
-                                               message= _ "We are currently 
studying $player_$side_number|.research.current_target|. To which end would you 
have our scholars devote their minds?
- 
+                                       message= _ "We are currently studying 
$player_$side_number|.research.current_target|. To which end would you have our 
scholars devote their minds?
+
 Our farms produce $player_$side_number|.farming.gold|g
 Our mines produce $player_$side_number|.mining.gold|g
-                                                                               
     "
+                                                                               
 "
 #wmllint: display off
 
-                                               [option]
-                                                       message= _ "Continue as 
before"
-                                                       [command]
-                                                               {VARIABLE 
finished_options yes}
-                                                       [/command]
-                                               [/option]
+                                       [option]
+                                               message= _ "Continue as before"
+                                               [command]
+                                                       {VARIABLE 
finished_options yes}
+                                                       {VARIABLE cancelled yes}
+                                               [/command]
+                                       [/option]
 # wmlindent: stop ignoring                                     
-                                           # Farming
-                                               
-                                               [option]
-                                                       message= {MENU_IMG_TXT 
"items/flower4.png" _"@Agriculture
+                                   # Farming
+                                       
+                                       [option]
+                                               message= {MENU_IMG_TXT 
"items/flower4.png" _"@Agriculture
 Farmers produce +1 gold
 Study Progress: 
$player_$side_number|.farming.progress|/$player_$side_number|.farming.target"}
-                                                       [command]
-                                                               {VARIABLE 
player_$side_number|.research.current_target "agriculture"}
-                                                               {VARIABLE 
finished_options yes}
-                                                               {VARIABLE_OP 
unit.moves format 0}
-                                                       [/command]
-                                               [/option]
-                                               
-                                               # Mining
-                                               
-                                               [option]
-                                                       message= {MENU_IMG_TXT 
"items/gold-coins-small.png" _"@Mining 
+                                               [command]
+                                                       {VARIABLE 
player_$side_number|.research.current_target "agriculture"}
+                                                       {VARIABLE 
finished_options yes}
+                                                       {VARIABLE_OP unit.moves 
format 0}
+                                               [/command]
+                                       [/option]
+                                       
+                                       # Mining
+                                       
+                                       [option]
+                                               message= {MENU_IMG_TXT 
"items/gold-coins-small.png" _"@Mining 
 Miners produce +1 gold 
 Study Progress: 
$player_$side_number|.mining.progress|/$player_$side_number|.mining.target"}
-                                                       [command]
-                                                               {VARIABLE 
player_$side_number|.research.current_target "mining"}
-                                                               {VARIABLE 
finished_options yes}
-                                                               {VARIABLE_OP 
unit.moves format 0}
-                                                       [/command]
-                                               [/option]
-                                               
-                                               #Warfare
-                                               
-                                               [option]
-                                                       message= {MENU_IMG_TXT 
"wesnoth-icon.png" _"@Warfare
+                                               [command]
+                                                       {VARIABLE 
player_$side_number|.research.current_target "mining"}
+                                                       {VARIABLE 
finished_options yes}
+                                                       {VARIABLE_OP unit.moves 
format 0}
+                                               [/command]
+                                       [/option]
+                                       
+                                       #Warfare
+                                       
+                                       [option]
+                                               message= {MENU_IMG_TXT 
"wesnoth-icon.png" _"@Warfare
 Allows you to recruit a new type of unit
 Study Progress: 
$player_$side_number|.warfare.progress|/$player_$side_number|.warfare.target"}
-                                                       [show_if]
-                                                               {CONDITION 
player_$side_number|.troop_1 equals no}
-                                                               [or]
-                                                                       
{CONDITION player_$side_number|.troop_2 equals no}
-                                                               [/or]
-                                                               [or]
-                                                                       
{CONDITION player_$side_number|.troop_3 equals no}
-                                                               [/or]
-                                                               [or]
-                                                                       
{CONDITION player_$side_number|.troop_4 equals no}
-                                                               [/or]
-                                                               [or]
-                                                                       
{CONDITION player_$side_number|.troop_5 equals no}
-                                                               [/or]
-                                                               [or]
-                                                                       
{CONDITION player_$side_number|.troop_6 equals no}
-                                                               [/or]
-                                                               [or]
-                                                                       
{CONDITION player_$side_number|.troop_7 equals no}
-                                                               [/or]
-                                                       [/show_if]
+                                               [show_if]
+                                                       {CONDITION 
player_$side_number|.troop_1 equals no}
+                                                       [or]
+                                                               {CONDITION 
player_$side_number|.troop_2 equals no}
+                                                       [/or]
+                                                       [or]
+                                                               {CONDITION 
player_$side_number|.troop_3 equals no}
+                                                       [/or]
+                                                       [or]
+                                                               {CONDITION 
player_$side_number|.troop_4 equals no}
+                                                       [/or]
+                                                       [or]
+                                                               {CONDITION 
player_$side_number|.troop_5 equals no}
+                                                       [/or]
+                                                       [or]
+                                                               {CONDITION 
player_$side_number|.troop_6 equals no}
+                                                       [/or]
+                                                       [or]
+                                                               {CONDITION 
player_$side_number|.troop_7 equals no}
+                                                       [/or]
+                                               [/show_if]
+       
+                                               [command]
+                                                       {VARIABLE 
player_$side_number|.research.current_target "warfare"}
+                                                       {VARIABLE 
finished_options yes}
+                                                       {VARIABLE_OP unit.moves 
format 0}
+                                               [/command]
+                                   [/option]
+                               [/message]
+                       [/do]
+               [/while]
                
-                                                       [command]
-                                                               {VARIABLE 
player_$side_number|.research.current_target "warfare"}
-                                                               {VARIABLE 
finished_options yes}
-                                                               {VARIABLE_OP 
unit.moves format 0}
-                                                       [/command]
-                                                       [/option]
-                                               
-                                       [/message]
-                               [/do]
-                       [/while]
-       [unstore_unit]
-               variable=unit
-       [/unstore_unit]
-[/command]
+               [if]
+                   [variable]
+                       name=cancelled
+                       not_equals=yes
+                   [/variable]
+                   
+                   [then]
+                [unstore_unit]
+                       variable=unit
+                       find_vacant=no
+                [/unstore_unit]
+            [/then]
+            
+            [else]
+                [allow_undo][/allow_undo]
+            [/else]
+        [/if]
+    [/command]
 [/set_menu_item]
 #enddef
 

Modified: trunk/data/multiplayer/scenarios/ANL_utils/ANL_worker_options.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/multiplayer/scenarios/ANL_utils/ANL_worker_options.cfg?rev=25529&r1=25528&r2=25529&view=diff
==============================================================================
--- trunk/data/multiplayer/scenarios/ANL_utils/ANL_worker_options.cfg (original)
+++ trunk/data/multiplayer/scenarios/ANL_utils/ANL_worker_options.cfg Fri Apr  
4 11:54:16 2008
@@ -46,7 +46,9 @@
 [option]
 message= _ "Nothing"
        [command]
-               {VARIABLE finished yes} 
+               {VARIABLE finished yes}
+               
+               [allow_undo][/allow_undo]
        [/command]
 [/option]
 
@@ -91,7 +93,7 @@
                [then]
                        {COMPLETE_ACTION (-15)}
                        {MODIFY_TERRAIN "Gg^Vh" $x1 $y1}
-                       {CAPTURE_VILLAGE}
+                       {ANL_CAPTURE_VILLAGE}
                        {BUILD_SOUND_1}
                [/then]
                [/if]
@@ -189,7 +191,7 @@
                [then]
                        {COMPLETE_ACTION (-25)}
                        {MODIFY_TERRAIN "Hh^Vhh" $x1 $y1}
-                       {CAPTURE_VILLAGE}
+                       {ANL_CAPTURE_VILLAGE}
                        {BUILD_SOUND_1}
                [/then]
                [/if]
@@ -210,7 +212,7 @@
                [then]
                        {COMPLETE_ACTION (-25)}
                        {MODIFY_TERRAIN "Mm^Vhh" $x1 $y1}
-                       {CAPTURE_VILLAGE}
+                       {ANL_CAPTURE_VILLAGE}
                        {BUILD_SOUND_1}
                [/then]
                [/if]
@@ -384,7 +386,7 @@
                [then]
                        {COMPLETE_ACTION (-7)}
                        {MODIFY_TERRAIN "Gg^Ve" $x1 $y1}
-                       {CAPTURE_VILLAGE}
+                       {ANL_CAPTURE_VILLAGE}
                        {BUILD_SOUND_2}
                [/then]
                [/if]


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

Reply via email to