From 713982af4af36b6a4209dab3dcc78e43037d5986 Mon Sep 17 00:00:00 2001 From: "Dr. Jaska" Date: Mon, 7 Feb 2022 18:30:17 +0000 Subject: [PATCH] cvar to unbind both timer increment styles --- _hud_common.cfg | 1 + qcsrc/client/hud/panel/timer.qc | 12 ++++++++++-- qcsrc/client/hud/panel/timer.qh | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/_hud_common.cfg b/_hud_common.cfg index c5d37c1dc..a97800ba1 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -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" diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 035d21b60..f70e5a280 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -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 { diff --git a/qcsrc/client/hud/panel/timer.qh b/qcsrc/client/hud/panel/timer.qh index 309f04249..bbeeb7272 100644 --- a/qcsrc/client/hud/panel/timer.qh +++ b/qcsrc/client/hud/panel/timer.qh @@ -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; -- 2.39.2