]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/minigames/cl_minigames_hud.qc
Merge branch 'terencehill/ons_camera' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / minigames / cl_minigames_hud.qc
index 12d2f06d18caecf4bbf6f07d8f803e5ef5073544..1a6d4ff52272e39e4204c9e892545e6688536f63 100644 (file)
@@ -575,7 +575,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary
        {
                mousepos_x = nPrimary;
                mousepos_y = nSecondary;
-               if ( minigame_isactive() && HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) )
+               if ( active_minigame && HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) )
                        active_minigame.minigame_event(active_minigame,"mouse_moved",mousepos);
                return true;
 
@@ -607,7 +607,7 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary
                                return false;
                }
 
-               if ( minigame_isactive() && ( bInputType == 0 || bInputType == 1 ) )
+               if ( active_minigame && ( bInputType == 0 || bInputType == 1 ) )
                {
                        string device = "";
                        string action = bInputType == 0 ? "pressed" : "released";
@@ -682,21 +682,11 @@ void HUD_Minigame_Mouse()
        if( !HUD_MinigameMenu_IsOpened() || autocvar__hud_configure || mv_active )
                return;
 
-       if(!autocvar_hud_cursormode)
-       {
-               mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
-
-               mousepos_x = bound(0, mousepos_x, vid_conwidth);
-               mousepos_y = bound(0, mousepos_y, vid_conheight);
-       }
+       if (!autocvar_hud_cursormode)
+               update_mousepos();
 
        if ( HUD_MinigameMenu_IsOpened() && HUD_mouse_over(HUD_PANEL(MINIGAME_MENU)) )
                HUD_MinigameMenu_MouseInput();
 
        draw_cursor_normal(mousepos, '1 1 1', panel_fg_alpha);
 }
-
-bool HUD_Minigame_Showpanels()
-{
-       return (HUD_MinigameMenu_IsOpened() && minigame_isactive());
-}