Author: alink
Date: Sun Nov  4 21:44:53 2007
New Revision: 21495

URL: http://svn.gna.org/viewcvs/wesnoth?rev=21495&view=rev
Log:
Context-menu with only one item stop to automaticaly execute this item
It make sense to show the menu and let the user decide to use the item or not
and it will fix a right-click bug for the 1-item context-menu during AI turn

Modified:
    trunk/src/hotkeys.cpp

Modified: trunk/src/hotkeys.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/hotkeys.cpp?rev=21495&r1=21494&r2=21495&view=diff
==============================================================================
--- trunk/src/hotkeys.cpp (original)
+++ trunk/src/hotkeys.cpp Sun Nov  4 21:44:53 2007
@@ -823,12 +823,12 @@
        }
 }
 
-void command_executor::show_menu(const std::vector<std::string>& items_arg, 
int xloc, int yloc, bool /*context_menu*/, display& gui)
+void command_executor::show_menu(const std::vector<std::string>& items_arg, 
int xloc, int yloc, bool context_menu, display& gui)
 {
        std::vector<std::string> items = items_arg;
        if (can_execute_command(hotkey::get_hotkey(items.front()).get_id(), 0)){
                //if just one item is passed in, that means we should execute 
that item
-               if(items.size() == 1 && items_arg.size() == 1) {
+               if(!context_menu && items.size() == 1 && items_arg.size() == 1) 
{
                        
hotkey::execute_command(gui,hotkey::get_hotkey(items.front()).get_id(),this);
                        return;
                }


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

Reply via email to