]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Map vote: reset keyboard selection in a simpler way in MapVote_InputEvent
authorterencehill <piuntn@gmail.com>
Sun, 27 Dec 2020 18:01:24 +0000 (19:01 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 27 Dec 2020 18:01:24 +0000 (19:01 +0100)
qcsrc/client/mapvoting.qc

index d6ee23046cdcf74c1044ef24a376999691aa6e98..0b60bfcadecaf8996888a741c541ec2e3487cad3 100644 (file)
@@ -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);