From 12803c9c3f5a5d889b7f966949636a25a6b3149e Mon Sep 17 00:00:00 2001 From: FruitieX Date: Tue, 29 Jun 2010 13:37:20 +0300 Subject: [PATCH] allow to configure the hud when spectating, but still force a join when in the first frame --- qcsrc/client/hud.qc | 6 ++++-- qcsrc/client/scoreboard.qc | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 7071f83c2..dac378fa7 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4523,6 +4523,7 @@ void HUD_Reset (void) HUD_Mod_CTF_Reset(); } +float hud_configure_prev = -1; void HUD_Main (void) { if(disable_menu_alphacheck == 1) @@ -4585,7 +4586,6 @@ void HUD_Main (void) HUD_VoteWindow(); if(HUD_Panel_CheckActive(HUD_PANEL_MODICONS) || hud_configure) HUD_ModIcons(); - // TODO hud'ify if(HUD_Panel_CheckActive(HUD_PANEL_PRESSEDKEYS) || hud_configure) if(spectatee_status > 0 || cvar("hud_pressedkeys") >= 2 || hud_configure) HUD_DrawPressedKeys(); @@ -4602,9 +4602,11 @@ void HUD_Main (void) if (cvar("cl_showacceleration")) HUD_ShowAcceleration(); - if (hud_configure && spectatee_status) // try to join if we are in hud_configure mode, but still spectating (in order to get rid of motd and such) + if (hud_configure && spectatee_status && hud_configure_prev == -1) // try to join if we are in hud_configure mode, but still spectating, and in the first frame (in order to get rid of motd when launching a server via the menu "HUD Setup" button) localcmd("cmd selectteam auto; cmd join\n"); + hud_configure_prev = hud_configure; + if (!hud_configure) // hud config mode disabled, enable normal alpha stuff again disable_menu_alphacheck = 0; } diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index cd6ea9efe..256e6ac9b 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -870,7 +870,9 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz } float HUD_WouldDrawScoreboard() { - if (scoreboard_showscores) + if (hud_configure) + return 0; + else if (scoreboard_showscores) return 1; else if (intermission == 1) return 1; -- 2.39.2