From 6c077d4e8408e3953ea650fd34a7fd855108a90d Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 6 Nov 2020 23:29:00 +1000 Subject: [PATCH] Hide the item stats panel in CTS, Race, Nexball and Invasion (items serve little purpose in these gamemodes) --- qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc | 5 +++++ qcsrc/common/gamemodes/gamemode/invasion/_mod.inc | 3 +++ qcsrc/common/gamemodes/gamemode/invasion/_mod.qh | 3 +++ .../common/gamemodes/gamemode/invasion/cl_invasion.qc | 10 ++++++++++ .../common/gamemodes/gamemode/invasion/cl_invasion.qh | 1 + qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qc | 5 +++++ qcsrc/common/gamemodes/gamemode/race/cl_race.qc | 5 +++++ 7 files changed, 32 insertions(+) create mode 100644 qcsrc/common/gamemodes/gamemode/invasion/cl_invasion.qc create mode 100644 qcsrc/common/gamemodes/gamemode/invasion/cl_invasion.qh diff --git a/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc b/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc index ee62df152..ce095bf20 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc +++ b/qcsrc/common/gamemodes/gamemode/cts/cl_cts.qc @@ -19,6 +19,11 @@ MUTATOR_HOOKFUNCTION(cl_cts, HUD_Score_show) return spectatee_status == -1 && ISGAMETYPE(CTS); // hide the score panel while observing } +MUTATOR_HOOKFUNCTION(cl_cts, DrawScoreboardItemStats) +{ + return ISGAMETYPE(CTS); // hide the item stats panel +} + MUTATOR_HOOKFUNCTION(cl_cts, DrawDeathScoreboard) { return ISGAMETYPE(CTS); // no scoreboard shown while dead diff --git a/qcsrc/common/gamemodes/gamemode/invasion/_mod.inc b/qcsrc/common/gamemodes/gamemode/invasion/_mod.inc index e8b28e96b..ab033e317 100644 --- a/qcsrc/common/gamemodes/gamemode/invasion/_mod.inc +++ b/qcsrc/common/gamemodes/gamemode/invasion/_mod.inc @@ -1,5 +1,8 @@ // generated file; do not modify #include +#ifdef CSQC + #include +#endif #ifdef SVQC #include #endif diff --git a/qcsrc/common/gamemodes/gamemode/invasion/_mod.qh b/qcsrc/common/gamemodes/gamemode/invasion/_mod.qh index 5181956f2..0b663f5ab 100644 --- a/qcsrc/common/gamemodes/gamemode/invasion/_mod.qh +++ b/qcsrc/common/gamemodes/gamemode/invasion/_mod.qh @@ -1,5 +1,8 @@ // generated file; do not modify #include +#ifdef CSQC + #include +#endif #ifdef SVQC #include #endif diff --git a/qcsrc/common/gamemodes/gamemode/invasion/cl_invasion.qc b/qcsrc/common/gamemodes/gamemode/invasion/cl_invasion.qc new file mode 100644 index 000000000..e7dc879bc --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/invasion/cl_invasion.qc @@ -0,0 +1,10 @@ +#include "cl_invasion.qh" + +#include + +REGISTER_MUTATOR(cl_inv, true); + +MUTATOR_HOOKFUNCTION(cl_inv, DrawScoreboardItemStats) +{ + return ISGAMETYPE(INVASION); // hide the item stats panel +} diff --git a/qcsrc/common/gamemodes/gamemode/invasion/cl_invasion.qh b/qcsrc/common/gamemodes/gamemode/invasion/cl_invasion.qh new file mode 100644 index 000000000..6f70f09be --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/invasion/cl_invasion.qh @@ -0,0 +1 @@ +#pragma once diff --git a/qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qc index 276995716..fa7be6e50 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qc @@ -48,3 +48,8 @@ MUTATOR_HOOKFUNCTION(cl_nb, DrawScoreboardAccuracy) { return ISGAMETYPE(NEXBALL); // accuracy is not a factor in this gamemode } + +MUTATOR_HOOKFUNCTION(cl_nb, DrawScoreboardItemStats) +{ + return ISGAMETYPE(NEXBALL); // hide the item stats panel +} diff --git a/qcsrc/common/gamemodes/gamemode/race/cl_race.qc b/qcsrc/common/gamemodes/gamemode/race/cl_race.qc index a47ce272e..4311ce777 100644 --- a/qcsrc/common/gamemodes/gamemode/race/cl_race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/cl_race.qc @@ -166,6 +166,11 @@ MUTATOR_HOOKFUNCTION(cl_race, HUD_Score_show) return spectatee_status == -1 && ISGAMETYPE(RACE); // hide the score panel while observing } +MUTATOR_HOOKFUNCTION(cl_race, DrawScoreboardItemStats) +{ + return ISGAMETYPE(RACE); // hide the item stats panel +} + MUTATOR_HOOKFUNCTION(cl_race, ShowRankings) { if(ISGAMETYPE(RACE)) -- 2.39.2