From: terencehill Date: Thu, 1 Dec 2011 17:30:17 +0000 (+0100) Subject: Pressing ctrl when execing a command avoids to close the quick menu X-Git-Tag: xonotic-v0.8.2~1987^2~55^2~32 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=da1df515317395255f9a1e0d2961420d94ec194f;p=xonotic%2Fxonotic-data.pk3dir.git Pressing ctrl when execing a command avoids to close the quick menu --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 3ed5688f6..ec2bb8257 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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) @@ -4994,7 +4993,8 @@ void HUD_QuickMenu_ActionForNumber(float num) if (QuickMenu_Command[num] != "") { localcmd(QuickMenu_Command[num]); - HUD_QuickMenu_Close(); + if (!(hudShiftState & S_CTRL)) + HUD_QuickMenu_Close(); return; } if (QuickMenu_Description[num] != "") @@ -5024,6 +5024,17 @@ float HUD_Panel_QuickMenu_InputEvent(float bInputType, float nPrimary, float nSe 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)