]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud_config.qc
Merge remote-tracking branch 'origin/master' into terencehill/cursormode
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud_config.qc
index 0f990c69410d2646ccb0f8dca6a2281d6f46e3be..d1d5dfc8aec21da63dcada6245c0a9c36184f488 100644 (file)
@@ -635,8 +635,7 @@ 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)
@@ -646,6 +645,13 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        if(autocvar__menu_alpha)
                return true;
 
+       if(bInputType == 3)
+       {
+               mousepos_x = nPrimary;
+               mousepos_y = nSecondary;
+               return true;
+       }
+
        // allow console bind to work
        string con_keys;
        float keys;
@@ -908,7 +914,7 @@ float HUD_Panel_Check_Mouse_Pos(float allow_move)
                border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
 
                // move
-               if(allow_move && mousepos_x >= panel_pos_x && mousepos_y >= panel_pos_y && mousepos_x <= panel_pos_x + panel_size_x && mousepos_y <= panel_pos_y + panel_size_y)
+               if(allow_move && mousepos_x > panel_pos_x && mousepos_y > panel_pos_y && mousepos_x < panel_pos_x + panel_size_x && mousepos_y < panel_pos_y + panel_size_y)
                {
                        return 1;
                }
@@ -988,7 +994,7 @@ void HUD_Panel_Highlight(float allow_move)
                border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
 
                // move
-               if(allow_move && mousepos_x >= panel_pos_x && mousepos_y >= panel_pos_y && mousepos_x <= panel_pos_x + panel_size_x && mousepos_y <= panel_pos_y + panel_size_y)
+               if(allow_move && mousepos_x > panel_pos_x && mousepos_y > panel_pos_y && mousepos_x < panel_pos_x + panel_size_x && mousepos_y < panel_pos_y + panel_size_y)
                {
                        highlightedPanel = i;
                        HUD_Panel_FirstInDrawQ(i);
@@ -1070,11 +1076,6 @@ void HUD_Panel_Mouse()
        if(autocvar__menu_alpha == 1)
                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)