Author: alink
Date: Wed Apr 30 06:01:23 2008
New Revision: 26244

URL: http://svn.gna.org/viewcvs/wesnoth?rev=26244&view=rev
Log:
Improve the previous custom command feature: allow sequence of commands like :
custom Thief ; unit gender female ; unit hitpoints 100 ; unit name Wonderwoman
Then the hotkey will always create this special unit.
Not very useful with the current set of commands but was easy to implement.
The main use is probably custom Thief ; unit moves 10

Modified:
    trunk/src/menu_events.cpp

Modified: trunk/src/menu_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/menu_events.cpp?rev=26244&r1=26243&r2=26244&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Wed Apr 30 06:01:23 2008
@@ -2904,7 +2904,11 @@
 
        void menu_handler::custom_command(mouse_handler& mousehandler, const 
unsigned int team_num)
        {
-               do_command(preferences::custom_command(), team_num, 
mousehandler);
+               std::vector<std::string> commands = 
utils::split(preferences::custom_command(), ';');
+               std::vector<std::string>::iterator c = commands.begin();
+               for (; c != commands.end() ; ++c) {
+                       do_command(*c, team_num, mousehandler);
+               }
        }
 
        void menu_handler::ai_formula()


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

Reply via email to