From 9219e1f701c6cdda3d0b5344d06078c5ae8769d4 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 11 Jun 2022 19:24:29 +0200 Subject: [PATCH] Allow scoreboard team selection to fade out cleanly --- qcsrc/client/hud/panel/scoreboard.qc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 76f97fd0e..416564cc9 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -166,9 +166,16 @@ string Label_getInfo(string label, int mode) return label; } +bool scoreboard_ui_disabling; void HUD_Scoreboard_UI_Disable() { + scoreboard_ui_disabling = true; scoreboard_showscores = false; +} + +void HUD_Scoreboard_UI_Disable_Instantly() +{ + scoreboard_ui_disabling = false; scoreboard_ui_enabled = 0; scoreboard_selected_panel = 0; scoreboard_selected_player = NULL; @@ -210,7 +217,7 @@ float HUD_Scoreboard_InputEvent(float bInputType, float nPrimary, float nSeconda { string s; - if(!scoreboard_ui_enabled) + if(!scoreboard_ui_enabled || scoreboard_ui_disabling) return false; if(bInputType == 3) @@ -1554,9 +1561,15 @@ bool Scoreboard_WouldDraw() { if (scoreboard_ui_enabled) { + if (scoreboard_ui_disabling) + { + if (scoreboard_fade_alpha == 0) + HUD_Scoreboard_UI_Disable_Instantly(); + return false; + } if (intermission && scoreboard_ui_enabled == 2) { - HUD_Scoreboard_UI_Disable(); + HUD_Scoreboard_UI_Disable_Instantly(); return false; } return true; -- 2.39.2