]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 c863d11153fd43ba03a91011c5c0f3b59eff93f3..fc49d5601b5c9851a67cb680905eefca3cb3faf2 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 e8c374ee40e87e030c49f24623eb913f21aa966f..e7677dfd6d80f851d386a9a694c32cda45acb545 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 f85035d81d0e02928921eac008e072d411cf7e9c..194461054e2303ee8e04a89a7ad2ad639a92c9c9 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 5a6b42dc467ecc5e17927f77fb97356d8bdbec61..19b7b63ce4912d424950877f576de9f64dd2ff8b 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 820d7cc3fc93d1ac4d5acd519f0bb59faac2afa8..e8b5516d04cb5cfa9c42a286d576861e30e9dfeb 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
+}