]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix #2675 "Quickmenu closes when navigated by mouse"
authorterencehill <piuntn@gmail.com>
Sat, 19 Mar 2022 11:21:19 +0000 (12:21 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 19 Mar 2022 11:21:19 +0000 (12:21 +0100)
qcsrc/client/hud/panel/quickmenu.qc

index 6310a0e6957f515c2785c476718c911c1b64322b..51f1e7373f2186177779788513fb8cf8771782c3 100644 (file)
@@ -449,6 +449,8 @@ bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary)
        // at this point bInputType can only be 0 or 1 (key pressed or released)
        bool key_pressed = (bInputType == 0);
 
+       int hudShiftState_prev = hudShiftState;
+       int mouseClicked_prev = mouseClicked;
        if(key_pressed)
        {
                if(nPrimary == K_ALT) hudShiftState |= S_ALT;
@@ -474,7 +476,7 @@ bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary)
        {
                QuickMenu_Page_ActiveEntry(stof(chr2str(nPrimary)));
        }
-       else
+       else if (hudShiftState_prev == hudShiftState && mouseClicked_prev == mouseClicked)
        {
                // allow console bind to work
                string con_keys = findkeysforcommand("toggleconsole", 0);