]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud_config.qc
Thanks to the use of the built in function setcursormode we can fix 2 bugs in hud...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud_config.qc
index 18ff119a79ef636abbf231f6a7cb92ae0ea5e49b..0c47ffa2d73e9f56b0ef1aa3b042b9a9eb47c797 100644 (file)
@@ -621,13 +621,19 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
 {
        string s;
 
-       // we only care for keyboard events
-       if(bInputType != 0 && bInputType != 1)
+       if(bInputType == 2)
                return false;
 
        if(!autocvar__hud_configure)
                return false;
 
+       if(bInputType == 3)
+       {
+               mousepos_x = nPrimary;
+               mousepos_y = nSecondary;
+               return true;
+       }
+
        // allow console bind to work
        string con_keys;
        float keys;
@@ -1055,11 +1061,6 @@ void HUD_Panel_Mouse()
        if(menu_enabled == 1 || (menu_enabled == 2 && !hud_fade_alpha))
                return;
 
-       mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
-
-       mousepos_x = bound(0, mousepos_x, vid_conwidth);
-       mousepos_y = bound(0, mousepos_y, vid_conheight);
-
        if(mouseClicked)
        {
                if(prevMouseClicked == 0)