]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Small cleanup
authorterencehill <piuntn@gmail.com>
Mon, 14 Mar 2022 17:14:52 +0000 (18:14 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 14 Mar 2022 17:14:52 +0000 (18:14 +0100)
qcsrc/client/hud/hud_config.qc
qcsrc/client/hud/panel/quickmenu.qc

index 2c05285e282a13a3dbfdc582b57d0adbe709442d..818ad0256c99771053a77f1917b865bf7a62bf51 100644 (file)
@@ -553,11 +553,15 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                if(nPrimary == K_ALT) hudShiftState |= S_ALT;
                if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
                if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
+               if(nPrimary == K_MOUSE1) mouseClicked |= S_MOUSE1;
+               if(nPrimary == K_MOUSE2) mouseClicked |= S_MOUSE2;
        }
        else {
                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_MOUSE1) mouseClicked -= (mouseClicked & S_MOUSE1);
+               if(nPrimary == K_MOUSE2) mouseClicked -= (mouseClicked & S_MOUSE2);
        }
 
        if(nPrimary == K_CTRL)
@@ -576,21 +580,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                }
        }
 
-       if(nPrimary == K_MOUSE1)
-       {
-               if(key_pressed)
-                       mouseClicked |= S_MOUSE1;
-               else
-                       mouseClicked -= (mouseClicked & S_MOUSE1);
-       }
-       else if(nPrimary == K_MOUSE2)
-       {
-               if(key_pressed)
-                       mouseClicked |= S_MOUSE2;
-               else
-                       mouseClicked -= (mouseClicked & S_MOUSE2);
-       }
-       else if(nPrimary == K_ESCAPE)
+       if(nPrimary == K_ESCAPE)
        {
                if (!key_pressed)
                        return true;
index 3c3a5ba864c5ea2a8e0be619c58337d5b20007ad..6310a0e6957f515c2785c476718c911c1b64322b 100644 (file)
@@ -454,29 +454,19 @@ bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary)
                if(nPrimary == K_ALT) hudShiftState |= S_ALT;
                if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
                if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
+               if(nPrimary == K_MOUSE1) mouseClicked |= S_MOUSE1;
+               if(nPrimary == K_MOUSE2) mouseClicked |= S_MOUSE2;
        }
        else
        {
                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_MOUSE1) mouseClicked -= (mouseClicked & S_MOUSE1);
+               if(nPrimary == K_MOUSE2) mouseClicked -= (mouseClicked & S_MOUSE2);
        }
 
-       if(nPrimary == K_MOUSE1)
-       {
-               if(key_pressed)
-                       mouseClicked |= S_MOUSE1;
-               else
-                       mouseClicked -= (mouseClicked & S_MOUSE1);
-       }
-       else if(nPrimary == K_MOUSE2)
-       {
-               if(key_pressed)
-                       mouseClicked |= S_MOUSE2;
-               else
-                       mouseClicked -= (mouseClicked & S_MOUSE2);
-       }
-       else if(nPrimary == K_ESCAPE && key_pressed)
+       if(nPrimary == K_ESCAPE && key_pressed)
        {
                QuickMenu_Close();
        }