HUD_Scale_Disable();
}
-bool cursor_activestate;
-
bool HUD_WouldShowCursor()
{
if(autocvar__hud_configure)
return true;
return false;
}
-void HUD_Cursor()
-{
- if(HUD_WouldShowCursor())
- {
- if(!cursor_activestate)
- {
- cursor_activestate = true;
- if(autocvar_hud_cursormode)
- setcursormode(1);
- }
- }
- else
- {
- if(cursor_activestate)
- {
- cursor_activestate = false;
- if(autocvar_hud_cursormode)
- setcursormode(0);
- }
- }
-}
void HUD_Main()
{
HUD_Panel_Draw(HUD_PANEL(QUICKMENU));
HUD_Panel_Draw(HUD_PANEL(SCOREBOARD));
- HUD_Cursor();
+ bool cursor_active_prev = cursor_active;
+ cursor_active = HUD_WouldShowCursor();
+ if (cursor_active_prev != cursor_active && autocvar_hud_cursormode)
+ setcursormode(cursor_active);
if (intermission == 2)
HUD_Reset();
//draw_cursor(viewloc_mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
}
-void HUD_Draw_Mouse()
+void HUD_Cursor_Show()
{
float cursor_alpha = 1 - autocvar__menu_alpha;
if(cursor_type == CURSOR_NORMAL)
if(autocvar__menu_alpha == 1)
return;
- if(!HUD_WouldShowCursor())
+ if(!cursor_active)
{
if(player.viewloc && (player.viewloc.spawnflags & VIEWLOC_FREEAIM))
ViewLocation_Mouse(); // NOTE: doesn't use cursormode
prevMouseClicked = mouseClicked;
- HUD_Draw_Mouse();
+ HUD_Cursor_Show();
}
bool ov_enabled;