Author: mordante
Date: Sat Apr  7 10:44:19 2007
New Revision: 16673

URL: http://svn.gna.org/viewcvs/wesnoth?rev=16673&view=rev
Log:
added deprecated_message WML tag and schedule deprecated macros for removal.
added a small test scenario-test to demonstrate how the messages will look.

Modified:
    trunk/changelog
    trunk/data/scenario-test.cfg
    trunk/data/utils/deprecated-utils.cfg
    trunk/src/game_events.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=16673&r1=16672&r2=16673&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sat Apr  7 10:44:19 2007
@@ -86,6 +86,8 @@
      when ToD changes
    * more powerful [filter_location], now accepts radius=, [not], and 
      [filter] to match units at the location
+   * added [deprecated_message] so WML can also trigger the deprecated 
+     messages; used to tag macros scheduled for removal
  * user interface:
    * new sounds for user interface events
    * added the option to show warnings about deprecated WML usage

Modified: trunk/data/scenario-test.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=16673&r1=16672&r2=16673&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Sat Apr  7 10:44:19 2007
@@ -527,5 +527,26 @@
                        [/command]
                [/set_menu_item]
        [/event]
+
+       [label]
+       x,y=10,10
+       text="Keep out!!!"
+       [/label]
+
+       [event]
+       name=moveto
+       first_time_only=no
+               [filter]
+                       x,y=10, 10
+               [/filter]
+               [deprecated_message]
+                       message="Moveing to this location is no longer 
supported... bye bye"
+               [/deprecated_message]
+               [kill]
+                       x,y=10,10
+                       animate=yes
+               [/kill]
+       [/event]
+
 [/test]
 

Modified: trunk/data/utils/deprecated-utils.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/utils/deprecated-utils.cfg?rev=16673&r1=16672&r2=16673&view=diff
==============================================================================
--- trunk/data/utils/deprecated-utils.cfg (original)
+++ trunk/data/utils/deprecated-utils.cfg Sat Apr  7 10:44:19 2007
@@ -1,4 +1,13 @@
 # These are clutter, scheduled to be removed.
+
+# This one it used to tag macros for removal, the number in the name is the
+# release where the message is shown the first time.
+# The removal will be 2 versions later.
+#define DEPRECATE_132 NAME
+       [deprecated_message]
+               message="Macro '" + {NAME} + "' is scheduled for removal in 
Wesnoth 1.3.4."
+       [/deprecated_message]
+#enddef        
 
 # Allows the player to undo the effects of a moveto event.
 # For example, lets allow undoing reading a note:
@@ -12,6 +21,7 @@
 # )}
 
 #define ALLOW_UNDO ACTION
+       {DEPRECATE_132 ALLOW_UNDO_ACTION}
        [allow_undo]
                {ACTION}
        [/allow_undo]
@@ -22,6 +32,7 @@
 # {ADD_GOLD 1 999}
 
 #define ADD_GOLD SIDE AMOUNT
+       {DEPRECATE_132 ADD_GOLD}
        [gold]
                side={SIDE}
                amount={AMOUNT}

Modified: trunk/src/game_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=16673&r1=16672&r2=16673&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Sat Apr  7 10:44:19 2007
@@ -1526,6 +1526,12 @@
                                                 
0.0,0.0,lifetime,rect,font::CENTER_ALIGN);
                }
        }
+                               
+       else if(cmd == "deprecated_message") {
+               // note since only used for deprecated things no need to 
translate the string
+               const std::string message = cfg["message"];
+               lg::wml_error << message << '\n';
+       }
 
        //displaying a message dialog
        else if(cmd == "message") {


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

Reply via email to