added deprecated_message WML tag and schedule deprecated macros for removal.

added a small test scenario-test to demonstrate how the messages will look.
This commit is contained in:
Mark de Wever 2007-04-07 08:44:19 +00:00
parent f13c81ff91
commit 79c2e42a9d
4 changed files with 40 additions and 0 deletions

View file

@ -86,6 +86,8 @@ Version 1.3.1+svn:
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

View file

@ -527,5 +527,26 @@ _s, _s, _s, _s, Aa, Aa, _s, _s, _s, _s
[/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]

View file

@ -1,5 +1,14 @@
# 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:
# {ON_TILE 5 7 () (
@ -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}

View file

@ -1526,6 +1526,12 @@ bool event_handler::handle_event_command(const queued_event& event_info,
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") {