]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 9d2b950d65730d3aea2c9624c4325f639b3d8f77..53476a6fe42779f57ed8934ea1c807815e2aece2 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 cafd6075a0e909b2bf4ff73e43ade0ec3fce2ef7..7ecf2798cccce95e034bd8630cd798e2d4ae500e 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 3f0c26fde53b8ba52f0cb2dbb5a36275d7a8ee2f..cb51c85beed2de76ed59f0dd49f065bfb3673f25 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
+}