Add a mutator hook to hide the accuracy panel in the scoreboard
authorMario <mario.mario@y7mail.com>
Mon, 13 Jul 2020 08:58:57 +0000 (18:58 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 13 Jul 2020 08:58:57 +0000 (18:58 +1000)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/mutators/events.qh
qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc
qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qc
qcsrc/common/gamemodes/gamemode/race/cl_race.qc

index c863d11..fc49d56 100644 (file)
@@ -1505,7 +1505,7 @@ float scoreboard_time;
 bool have_weapon_stats;
 bool Scoreboard_AccuracyStats_WouldDraw(float ypos)
 {
-       if (ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || ISGAMETYPE(NEXBALL))
+       if (MUTATOR_CALLHOOK(DrawScoreboardAccuracy))
                return false;
        if (!autocvar_hud_panel_scoreboard_accuracy || warmup_stage || ypos > 0.91 * vid_conheight)
                return false;
index e8c374e..e7677df 100644 (file)
@@ -172,6 +172,9 @@ MUTATOR_HOOKABLE(DrawScoreboard, EV_NO_ARGS);
 /** Return true to not draw scoreboard while dead */
 MUTATOR_HOOKABLE(DrawDeathScoreboard, EV_NO_ARGS);
 
+/** Return true to not show accuracy stats in the scoreboard */
+MUTATOR_HOOKABLE(DrawScoreboardAccuracy, 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 f85035d..1944610 100644 (file)
@@ -17,6 +17,11 @@ MUTATOR_HOOKFUNCTION(cl_cts, DrawDeathScoreboard)
        return ISGAMETYPE(CTS); // no scoreboard shown while dead
 }
 
+MUTATOR_HOOKFUNCTION(cl_cts, DrawScoreboardAccuracy)
+{
+       return ISGAMETYPE(CTS); // accuracy is not a factor in this gamemode
+}
+
 MUTATOR_HOOKFUNCTION(cl_cts, ShowRankings)
 {
        if(ISGAMETYPE(CTS))
index 5a6b42d..19b7b63 100644 (file)
@@ -42,3 +42,8 @@ MUTATOR_HOOKFUNCTION(cl_nb, WantEventchase)
                return true;
        return false;
 }
+
+MUTATOR_HOOKFUNCTION(cl_nb, DrawScoreboardAccuracy)
+{
+       return ISGAMETYPE(NEXBALL); // accuracy is not a factor in this gamemode
+}
index 820d7cc..e8b5516 100644 (file)
@@ -166,3 +166,8 @@ MUTATOR_HOOKFUNCTION(cl_race, ShowRankings)
                return true;
        }
 }
+
+MUTATOR_HOOKFUNCTION(cl_race, DrawScoreboardAccuracy)
+{
+       return ISGAMETYPE(RACE); // accuracy is not a factor in this gamemode
+}