From: terencehill Date: Sat, 11 Jun 2022 17:24:29 +0000 (+0200) Subject: Allow scoreboard team selection to fade out cleanly X-Git-Tag: xonotic-v0.8.6~409^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9219e1f701c6cdda3d0b5344d06078c5ae8769d4;p=xonotic%2Fxonotic-data.pk3dir.git Allow scoreboard team selection to fade out cleanly --- 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;