mail[Wesnoth-commits] r25089 - /trunk/src/play_controller.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by dragonking on March 25, 2008 - 03:00:
Author: dragonking
Date: Tue Mar 25 03:00:12 2008
New Revision: 25089

URL: http://svn.gna.org/viewcvs/wesnoth?rev=25089&view=rev
Log:
Made commandline hide just after pressing enter, not after executing function.

Modified:
    trunk/src/play_controller.cpp

Modified: trunk/src/play_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/play_controller.cpp?rev=25089&r1=25088&r2=25089&view=diff
==============================================================================
--- trunk/src/play_controller.cpp (original)
+++ trunk/src/play_controller.cpp Tue Mar 25 03:00:12 2008
@@ -577,24 +577,32 @@
                return;
        }
 
+       const std::string str = menu_handler_.get_textbox().box()->text();
+       const unsigned int team_num = player_number_;
+       events::mouse_handler& mousehandler = mouse_handler_;
+
        switch(menu_handler_.get_textbox().mode()) {
        case gui::TEXTBOX_SEARCH:
-               
menu_handler_.do_search(menu_handler_.get_textbox().box()->text());
+               menu_handler_.do_search(str);
+               menu_handler_.get_textbox().close(*gui_);
                break;
        case gui::TEXTBOX_MESSAGE:
                menu_handler_.do_speak();
+               menu_handler_.get_textbox().close(*gui_);  //need to close 
that one after executing do_speak() !
                break;
        case gui::TEXTBOX_COMMAND:
-               
menu_handler_.do_command(menu_handler_.get_textbox().box()->text(), 
player_number_, mouse_handler_);
+               menu_handler_.get_textbox().close(*gui_);
+               menu_handler_.do_command(str, team_num, mousehandler);
                break;
        case gui::TEXTBOX_AI:
-               
menu_handler_.do_ai_formula(menu_handler_.get_textbox().box()->text(), 
player_number_, mouse_handler_);
+               menu_handler_.get_textbox().close(*gui_);
+               menu_handler_.do_ai_formula(str, team_num, mousehandler);
                break;
        default:
+               menu_handler_.get_textbox().close(*gui_);
                LOG_STREAM(err, display) << "unknown textbox mode\n";
        }
 
-       menu_handler_.get_textbox().close(*gui_);
 }
 
 team& play_controller::current_team() 




Related Messages


Powered by MHonArc, Updated Tue Mar 25 03:01:49 2008