From: Mario Date: Mon, 13 Jul 2020 07:56:38 +0000 (+1000) Subject: Add a mutator hook to not show the scoreboard while dead X-Git-Tag: xonotic-v0.8.5~855^2~13 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4d69bc363b46db67af10034383b8d11f5f43a2d2;p=xonotic%2Fxonotic-data.pk3dir.git Add a mutator hook to not show the scoreboard while dead --- 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 +}