]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a mutator hook to hide the score HUD panel
authorMario <mario.mario@y7mail.com>
Mon, 13 Jul 2020 07:50:12 +0000 (17:50 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 13 Jul 2020 07:50:12 +0000 (17:50 +1000)
qcsrc/client/hud/panel/score.qc
qcsrc/client/mutators/events.qh
qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc
qcsrc/common/gamemodes/gamemode/race/cl_race.qc

index 70a47a8120e4fa3c126cdc0a0a3daa4ee2891771..32db0a29fbf6d16ec6d478319fd20fc2b76e45d2 100644 (file)
@@ -147,7 +147,7 @@ void HUD_Score()
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_score) return;
-               if(spectatee_status == -1 && (ISGAMETYPE(RACE) || ISGAMETYPE(CTS))) return;
+               if(MUTATOR_CALLHOOK(HUD_Score_show)) return;
        }
 
        HUD_Panel_LoadCvars();
index 7ddcb204aa3144cf6d46e10db0d67cffc4088728..cafd6075a0e909b2bf4ff73e43ade0ec3fce2ef7 100644 (file)
@@ -121,6 +121,9 @@ MUTATOR_HOOKABLE(HUD_Powerups_add, EV_NO_ARGS);
 /** return true to show the physics HUD panel when optional mode is enabled */
 MUTATOR_HOOKABLE(HUD_Physics_showoptional, EV_NO_ARGS);
 
+/** return true to hide the score HUD panel */
+MUTATOR_HOOKABLE(HUD_Score_show, EV_NO_ARGS);
+
 /** Return true to not draw any vortex beam */
 #define EV_Particles_VortexBeam(i, o) \
        /** beam shot origin */  i(vector, MUTATOR_ARGV_0_vector) \
index ded220d9ccb0b949507601a6eb5147b28d0e1637..3f0c26fde53b8ba52f0cb2dbb5a36275d7a8ee2f 100644 (file)
@@ -6,3 +6,8 @@ MUTATOR_HOOKFUNCTION(cl_cts, HUD_Physics_showoptional)
 {
        return ISGAMETYPE(CTS); // show the optional physics panel
 }
+
+MUTATOR_HOOKFUNCTION(cl_cts, HUD_Score_show)
+{
+       return spectatee_status == -1 && ISGAMETYPE(CTS); // hide the score panel while observing
+}
index cb5e647b27a9383bb353a7f92e6e660d9f963ca8..92d75dc4d6a7eef8ffc34c67585704680bc7adb8 100644 (file)
@@ -152,3 +152,8 @@ MUTATOR_HOOKFUNCTION(cl_race, HUD_Physics_showoptional)
 {
        return ISGAMETYPE(RACE); // show the optional physics panel
 }
+
+MUTATOR_HOOKFUNCTION(cl_race, HUD_Score_show)
+{
+       return spectatee_status == -1 && ISGAMETYPE(RACE); // hide the score panel while observing
+}