]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Pressing ctrl when execing a command avoids to close the quick menu
authorterencehill <piuntn@gmail.com>
Thu, 1 Dec 2011 17:30:17 +0000 (18:30 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 2 Dec 2011 21:45:57 +0000 (22:45 +0100)
qcsrc/client/hud.qc

index 3ed5688f61f2ce1e7773ce2814089419d4d4b647..ec2bb8257f893a5efa3c136bcde0797bb71e9698 100644 (file)
@@ -4955,8 +4955,7 @@ void HUD_QuickMenu_Open(string target_submenu, float new_page)
                        }
                }
 
                        }
                }
 
-               // QuickMenu_Entries has been incremented before loading the entries
-               // because we want to store entries starting from 1, not from 0
+               // NOTE: entries are loaded starting from 1, not from 0
                if (argc == 1 && argv(0) != "") // submenu
                {
                        if (total - QuickMenu_CurrentPage_FirstEntry >= 0)
                if (argc == 1 && argv(0) != "") // submenu
                {
                        if (total - QuickMenu_CurrentPage_FirstEntry >= 0)
@@ -4994,7 +4993,8 @@ void HUD_QuickMenu_ActionForNumber(float num)
        if (QuickMenu_Command[num] != "")
        {
                localcmd(QuickMenu_Command[num]);
        if (QuickMenu_Command[num] != "")
        {
                localcmd(QuickMenu_Command[num]);
-               HUD_QuickMenu_Close();
+               if (!(hudShiftState & S_CTRL))
+                       HUD_QuickMenu_Close();
                return;
        }
        if (QuickMenu_Description[num] != "")
                return;
        }
        if (QuickMenu_Description[num] != "")
@@ -5024,6 +5024,17 @@ float HUD_Panel_QuickMenu_InputEvent(float bInputType, float nPrimary, float nSe
                        hit_con_bind = 1;
        }
 
                        hit_con_bind = 1;
        }
 
+       if(bInputType == 0) {
+               if(nPrimary == K_ALT) hudShiftState |= S_ALT;
+               if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
+               if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
+       }
+       else if(bInputType == 1) {
+               if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
+               if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
+               if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
+       }
+
        if(nPrimary == K_ESCAPE)
        {
                if (bInputType == 1)
        if(nPrimary == K_ESCAPE)
        {
                if (bInputType == 1)