]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
change scoreboard columns for CTS Cup and make it supported on every map where CTS...
authordrjaska <drjaska83@gmail.com>
Thu, 5 May 2022 18:35:08 +0000 (21:35 +0300)
committerdrjaska <drjaska83@gmail.com>
Thu, 5 May 2022 18:35:08 +0000 (21:35 +0300)
gamemodes-client.cfg
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/gamemodes/gamemode/ctscup/ctscup.qh
qcsrc/common/gamemodes/gamemode/race/cl_race.qc

index c43b9d1d3f2e6fe73fddbb33e8489670350edc4d..526b95b86cdbfb97bc8481ed22fb878cb23cb2d4 100644 (file)
@@ -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
index ed8715e022909cd1545784a29c222d3d1d130c92..5ae8cdcd91e792f7ea172831c486863de05e0545 100644 (file)
@@ -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)
 {
index 254ddef43bf2e1d945ec06ec15237a82bb678245..3cd8867360fd8a08d8ced9c3b20f03f970615ebe 100644 (file)
@@ -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
index 4311ce777aa813560420fa6cb2bc3fb0df62696f..71646c1fe2ad378b3abca5b5c42832b3170713b6 100644 (file)
@@ -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;