From 4d69bc363b46db67af10034383b8d11f5f43a2d2 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 13 Jul 2020 17:56:38 +1000 Subject: [PATCH] Add a mutator hook to not show the scoreboard while dead --- qcsrc/client/hud/panel/scoreboard.qc | 2 +- qcsrc/client/mutators/events.qh | 3 +++ qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 9d2b950d6..53476a6fe 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -1149,7 +1149,7 @@ bool Scoreboard_WouldDraw() return true; else if (intermission == 2) return false; - else if (spectatee_status != -1 && STAT(HEALTH) <= 0 && autocvar_cl_deathscoreboard && !ISGAMETYPE(CTS) + else if (spectatee_status != -1 && STAT(HEALTH) <= 0 && autocvar_cl_deathscoreboard && !MUTATOR_CALLHOOK(DrawDeathScoreboard) && (!HUD_MinigameMenu_IsOpened() || !active_minigame)) { return true; diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index cafd6075a..7ecf2798c 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -169,6 +169,9 @@ MUTATOR_HOOKABLE(DrawCrosshair, EV_NO_ARGS); /** Return true to not draw scoreboard */ MUTATOR_HOOKABLE(DrawScoreboard, EV_NO_ARGS); +/** Return true to not draw scoreboard while dead */ +MUTATOR_HOOKABLE(DrawDeathScoreboard, EV_NO_ARGS); + /** Called when drawing info messages, allows adding new info messages. Return true to hide the standard join message */ #define EV_DrawInfoMessages(i, o) \ /** pos */ i(vector, MUTATOR_ARGV_0_vector) \ diff --git a/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc b/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc index 3f0c26fde..cb51c85be 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc +++ b/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc @@ -11,3 +11,8 @@ MUTATOR_HOOKFUNCTION(cl_cts, HUD_Score_show) { return spectatee_status == -1 && ISGAMETYPE(CTS); // hide the score panel while observing } + +MUTATOR_HOOKFUNCTION(cl_cts, DrawDeathScoreboard) +{ + return ISGAMETYPE(CTS); // no scoreboard shown while dead +} -- 2.39.2