From: FruitieX Date: Tue, 29 Jun 2010 08:23:19 +0000 (+0300) Subject: return from the keyboard function if the mouse is clicked, easy way to prevent bugs... X-Git-Tag: xonotic-v0.1.0preview~457^2~61 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=8b22ede5be0de3b93dad1cbb5e46fbe696d2272e return from the keyboard function if the mouse is clicked, easy way to prevent bugs caused by doing just that (small detail that you missed, terencehill ;)) --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 6d56b6314..75fc7b60f 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1116,10 +1116,17 @@ void HUD_Panel_SetPosSize(float id, vector mySize) cvar_set(strcat("hud_", HUD_Panel_GetName(id), "_pos"), s); } +float mouseClicked; +float prevMouseClicked; // previous state +float prevMouseClickedTime; // time during previous mouse click, to check for doubleclicks +vector prevMouseClickedPos; // pos during previous mouse click, to check for doubleclicks + +float menu_enabled; +float menu_enabled_time; float pressed_key_time; void HUD_Panel_Arrow_Action(float nPrimary) { - if (highlightedPanel_prev == -1) + if (highlightedPanel_prev == -1 || mouseClicked) return; hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && cvar("hud_configure_checkcollisions")); @@ -1191,13 +1198,6 @@ void HUD_Panel_Arrow_Action(float nPrimary) } } -float mouseClicked; -float prevMouseClicked; // previous state -float prevMouseClickedTime; // time during previous mouse click, to check for doubleclicks -vector prevMouseClickedPos; // pos during previous mouse click, to check for doubleclicks - -float menu_enabled; -float menu_enabled_time; float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary) { if(!hud_configure)