]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
cvar to unbind both timer increment styles
authorDr. Jaska <drjaska83@gmail.com>
Mon, 7 Feb 2022 18:30:17 +0000 (18:30 +0000)
committerterencehill <piuntn@gmail.com>
Mon, 7 Feb 2022 18:30:17 +0000 (18:30 +0000)
_hud_common.cfg
qcsrc/client/hud/panel/timer.qc
qcsrc/client/hud/panel/timer.qh

index c5d37c1dc11a628cebf9d54c9bfd1a759f87240c..a97800ba15b33d8ed7c425f5ad60d30c83a0da4e 100644 (file)
@@ -93,6 +93,7 @@ seta hud_panel_healtharmor_progressbar_gfx_lowhealth 40 "health progressbar blin
 seta hud_panel_healtharmor_hide_ondeath 0 "hide this panel when dead"
 
 seta hud_panel_timer_increment "0" "show elapsed time instead of remaining time"
+seta hud_panel_timer_unbound "0" "show seconds leading up to the start of the match"
 
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage 1 "use an averaging method for calculating fps instead of counting frametime like engine does"
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_new_weight 0.1 "weight of latest data point"
index 035d21b60d9c889e00209f19076631aafc5251e5..f70e5a2805962a43cbebc48607f65b80d27cda8b 100644 (file)
@@ -41,7 +41,11 @@ void HUD_Timer()
 
        timelimit = STAT(TIMELIMIT);
 
-       timeleft = bound(0, timelimit * 60 + STAT(GAMESTARTTIME) - time, timelimit * 60);
+       if (autocvar_hud_panel_timer_unbound){
+               timeleft = max(0, timelimit * 60 + STAT(GAMESTARTTIME) - time);
+       } else {
+               timeleft = bound(0, timelimit * 60 + STAT(GAMESTARTTIME) - time, timelimit * 60);
+       }
        timeleft = ceil(timeleft);
 
        minutesLeft = floor(timeleft / 60);
@@ -71,7 +75,11 @@ void HUD_Timer()
                timer = _("WARMUP");
        } else if (autocvar_hud_panel_timer_increment || (!warmup_stage && timelimit == 0) || (warmup_stage && warmup_timeleft <= 0)) {
                if (time < STAT(GAMESTARTTIME))
-                       timer = seconds_tostring(0); //while restart is still active, show 00:00
+                       if (autocvar_hud_panel_timer_unbound){
+                               timer = seconds_tostring(-(STAT(GAMESTARTTIME) - time));
+                       } else {
+                               timer = seconds_tostring(0); //while restart is still active, show 00:00
+                       }
                else
                        timer = seconds_tostring(floor(time - STAT(GAMESTARTTIME)));
        } else {
index 309f04249ca9c7884863764d2c38d13c92c4c647..bbeeb727282064ec95637d2c6550c4e27a30036b 100644 (file)
@@ -4,3 +4,4 @@
 bool autocvar_hud_panel_timer;
 bool autocvar_hud_panel_timer_dynamichud        = true;
 bool autocvar_hud_panel_timer_increment;
+bool autocvar_hud_panel_timer_unbound;