From 1de13fd7ad53460dc8c39d5f8710fadd04a98550 Mon Sep 17 00:00:00 2001 From: drjaska Date: Thu, 5 May 2022 21:35:08 +0300 Subject: [PATCH] change scoreboard columns for CTS Cup and make it supported on every map where CTS is supported --- gamemodes-client.cfg | 1 + qcsrc/client/hud/panel/scoreboard.qc | 12 ++++++------ qcsrc/common/gamemodes/gamemode/ctscup/ctscup.qh | 8 ++++++++ qcsrc/common/gamemodes/gamemode/race/cl_race.qc | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/gamemodes-client.cfg b/gamemodes-client.cfg index c43b9d1d3..526b95b86 100644 --- a/gamemodes-client.cfg +++ b/gamemodes-client.cfg @@ -28,6 +28,7 @@ alias cl_hook_gamestart_as alias cl_hook_gamestart_rc alias cl_hook_gamestart_nb alias cl_hook_gamestart_cts +alias cl_hook_gamestart_ctscup alias cl_hook_gamestart_ka alias cl_hook_gamestart_ft alias cl_hook_gamestart_inv diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index ed8715e02..5ae8cdcd9 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -398,21 +398,21 @@ void Cmd_Scoreboard_Help() // e.g. -teams,rc,cts,lms/kills ?+rc/kills #define SCOREBOARD_DEFAULT_COLUMNS \ "ping pl fps name |" \ -" -teams,rc,cts,inv,lms/kills +ft,tdm/kills ?+rc,inv/kills" \ +" -teams,rc,cts,ctscup,inv,lms/kills +ft,tdm/kills ?+rc,inv/kills" \ " -teams,lms/deaths +ft,tdm/deaths" \ " +tdm/sum" \ -" -teams,lms,rc,cts,inv,ka/suicides +ft,tdm/suicides ?+rc,inv/suicides" \ -" -cts,dm,tdm,ka,ft/frags" /* tdm already has this in "score" */ \ +" -teams,lms,rc,cts,ctscup,inv,ka/suicides +ft,tdm/suicides ?+rc,inv/suicides" \ +" -cts,ctscup,dm,tdm,ka,ft/frags" /* tdm already has this in "score" */ \ " +tdm,ft,dom,ons,as/teamkills"\ -" -rc,cts,nb/dmg -rc,cts,nb/dmgtaken" \ +" -rc,cts,ctscup,nb/dmg -rc,cts,nb/dmgtaken" \ " +ctf/pickups +ctf/fckills +ctf/returns +ctf/caps +ons/takes +ons/caps" \ " +lms/lives +lms/rank" \ " +kh/kckills +kh/losses +kh/caps" \ -" ?+rc/laps ?+rc/time +rc,cts/fastest" \ +" ?+rc/laps ?+rc/time +rc,cts,ctscup/fastest" \ " +as/objectives +nb/faults +nb/goals" \ " +ka/pickups +ka/bckills +ka/bctime +ft/revivals" \ " +dom/ticks +dom/takes" \ -" -lms,rc,cts,inv,nb/score" +" -lms,rc,cts,ctscup,inv,nb/score" void Cmd_Scoreboard_SetFields(int argc) { diff --git a/qcsrc/common/gamemodes/gamemode/ctscup/ctscup.qh b/qcsrc/common/gamemodes/gamemode/ctscup/ctscup.qh index 254ddef43..3cd886736 100644 --- a/qcsrc/common/gamemodes/gamemode/ctscup/ctscup.qh +++ b/qcsrc/common/gamemodes/gamemode/ctscup/ctscup.qh @@ -15,6 +15,14 @@ CLASS(RaceCTSCup, Gametype) if(v == "target_startTimer") MapInfo_Map_supportedGametypes |= this.m_flags; } + METHOD(RaceCTSCup, m_isForcedSupported, bool(Gametype this)) + { + // if this is used, all CTS maps support CTS Cup too + if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTS.m_flags)) + return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported) + + return false; + } METHOD(RaceCTSCup, m_setTeams, void(string sa)) { // this is the skill of the map diff --git a/qcsrc/common/gamemodes/gamemode/race/cl_race.qc b/qcsrc/common/gamemodes/gamemode/race/cl_race.qc index 4311ce777..71646c1fe 100644 --- a/qcsrc/common/gamemodes/gamemode/race/cl_race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/cl_race.qc @@ -53,7 +53,7 @@ void HUD_Mod_Race(vector pos, vector mySize) // clientside personal record string rr; - if(ISGAMETYPE(CTS)) + if(ISGAMETYPE(CTS) || ISGAMETYPE(CTSCUP)) rr = CTS_RECORD; else rr = RACE_RECORD; -- 2.39.2