From: terencehill Date: Sun, 27 Dec 2020 18:01:24 +0000 (+0100) Subject: Map vote: reset keyboard selection in a simpler way in MapVote_InputEvent X-Git-Tag: xonotic-v0.8.5~597^2~11 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=14be8cdefb51a082250275410fec48d92cd4f583 Map vote: reset keyboard selection in a simpler way in MapVote_InputEvent --- diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index d6ee23046..0b60bfcad 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -339,7 +339,6 @@ float MapVote_Selection(vector topleft, vector cellsize, float rows, float colum return mv_mouse_selection; } -vector prev_mousepos; // draws map vote or gametype vote void MapVote_Draw() { @@ -357,15 +356,6 @@ void MapVote_Draw() HUD_Panel_LoadCvars(); - if (!autocvar_hud_cursormode) - { - if (mousepos.x != prev_mousepos.x || mousepos.y != prev_mousepos.y) - { - mv_selection_keyboard = 0; - prev_mousepos = mousepos; - } - } - center = (vid_conwidth - 1)/2; xmin = vid_conwidth * 0.08; xmax = vid_conwidth - xmin; @@ -813,7 +803,10 @@ float MapVote_InputEvent(int bInputType, float nPrimary, float nSecondary) } if (bInputType == 2) + { + mv_selection_keyboard = 0; return false; + } // at this point bInputType can be 0 or 1 (key pressed or released) bool key_pressed = (bInputType == 0);