From: terencehill Date: Mon, 14 Mar 2022 17:14:52 +0000 (+0100) Subject: Small cleanup X-Git-Tag: xonotic-v0.8.5~160 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f1a877b336d534790c8bb73bb617bb4beb4d02eb;p=xonotic%2Fxonotic-data.pk3dir.git Small cleanup --- diff --git a/qcsrc/client/hud/hud_config.qc b/qcsrc/client/hud/hud_config.qc index 2c05285e2..818ad0256 100644 --- a/qcsrc/client/hud/hud_config.qc +++ b/qcsrc/client/hud/hud_config.qc @@ -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; diff --git a/qcsrc/client/hud/panel/quickmenu.qc b/qcsrc/client/hud/panel/quickmenu.qc index 3c3a5ba86..6310a0e69 100644 --- a/qcsrc/client/hud/panel/quickmenu.qc +++ b/qcsrc/client/hud/panel/quickmenu.qc @@ -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(); }