]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Provide an off-switch for cts checkpoint splits
authordrjaska <drjaska83@gmail.com>
Mon, 22 Jul 2024 01:48:59 +0000 (04:48 +0300)
committerdrjaska <drjaska83@gmail.com>
Mon, 22 Jul 2024 01:48:59 +0000 (04:48 +0300)
Some users described this feature as "flooding the console",
"cl_race_checkpoint_splits_console 0" disables the prints.

Their collection is not disabled so that users can still opt-in
when they get a good run and want to see the splits.

qcsrc/client/main.qc
qcsrc/client/main.qh
xonotic-client.cfg

index 36dbd7e229a4e5cf6ff59df0071edd8050b8dce4..0185d06cd3906c4e6249f4179b40be315f22e7c5 100644 (file)
@@ -1209,8 +1209,9 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew)
                                        // does this index have a split?
                                        if (race_checkpoint_splits[i])
                                        {
-                                               // print it and free it
-                                               LOG_HELP(race_checkpoint_splits[i]);
+                                               // print it if enabled and free it
+                                               if (autocvar_cl_race_checkpoint_splits_console)
+                                                       LOG_HELP(race_checkpoint_splits[i]);
                                                strfree(race_checkpoint_splits[i]);
                                        }
                                }
index 34c8fc63be8bc5f08459b62e043275e0eccf6cc5..d4d97dc831e95f7cafc99a2b935c1598e412d8fe 100644 (file)
@@ -17,6 +17,14 @@ bool autocvar_hud_showbinds;
 bool autocvar_hud_showbinds_limit;
 bool autocvar__hud_showbinds_reload;
 bool autocvar_developer_csqcentities;
+#if 0
+// TODO: change this path after next (0.9) release
+// or the release after it to support the old-stable release
+// this can't be done now as players would lack these from their configs then
+bool autocvar_cl_race_checkpoint_splits_console;
+#else
+AUTOCVAR_SAVE(cl_race_checkpoint_splits_console, bool, 1, "Print checkpoint splits to console");
+#endif
 bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode
 bool autocvar_cl_race_cptimes_showself = false;
 bool autocvar_cl_welcome = true;
index 4abe50fa3738adc6fecbd73aa2f497ca283b98f2..2413a646a127ab4aa85e11a7263bc021210da9ed 100644 (file)
@@ -711,6 +711,7 @@ seta cl_jetpack_jump 1 "Activate jetpack by pressing jump in the air. 0 = Disabl
 
 seta cl_race_cptimes_showself 1 "Always show your own times as well as the current best on checkpoints in Race/CTS"
 seta cl_race_cptimes_onlyself 0 "Only show your own times on checkpoints in Race/CTS. Can be forced on by the server via g_race_cptimes_onlyself"
+seta cl_race_checkpoint_splits_console 1 "Print checkpoint splits to console"
 
 seta cl_cts_noautoswitch 0 "Prevent forced switching to new weapons in CTS"