Add a mutator hook to not show the scoreboard while dead
authorMario <mario.mario@y7mail.com>
Mon, 13 Jul 2020 07:56:38 +0000 (17:56 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 13 Jul 2020 07:56:38 +0000 (17:56 +1000)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/mutators/events.qh
qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc

index 9d2b950..53476a6 100644 (file)
@@ -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;
index cafd607..7ecf279 100644 (file)
@@ -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) \
index 3f0c26f..cb51c85 100644 (file)
@@ -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
+}