From: z411 Date: Fri, 2 Dec 2022 05:05:18 +0000 (-0300) Subject: Quick timer fix before upstream timer marge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4ed89d50302d6b5b5200eb718364fb6c4d43be9c;p=xonotic%2Fxonotic-data.pk3dir.git Quick timer fix before upstream timer marge --- diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 3ff1d2b44..ac4cb4c4c 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -64,7 +64,6 @@ void HUD_Timer() mySize -= '2 2 0' * panel_bg_padding; } - string timer; string subtimer = string_null; string subtext = string_null; float curtime, timelimit, timeleft; @@ -115,16 +114,16 @@ void HUD_Timer() { // Lock timer in infinite warmup if (autocvar_hud_panel_timer_increment) - timer = seconds_tostring(0); + timer = 0; else - timer = seconds_tostring(STAT(TIMELIMIT) * 60); + timer = STAT(TIMELIMIT) * 60; } else { if (autocvar_hud_panel_timer_increment || timelimit <= 0) - timer = seconds_tostring(HUD_Timer_TimeElapsed(curtime, STAT(GAMESTARTTIME))); + timer = HUD_Timer_TimeElapsed(curtime, STAT(GAMESTARTTIME)); else - timer = seconds_tostring(timeleft); + timer = timeleft; } // Secondary timer for round-based game modes @@ -190,10 +189,10 @@ void HUD_Timer() if(subtimer) { float subtimer_padding = subtimer_size.y / 5; timer_size.x -= subtimer_size.x; - drawstring_aspect(pos + eX * timer_size.x + eY * subtimer_padding, (swap ? timer : subtimer), subtimer_size - eY * subtimer_padding * 2, (swap ? timer_color : subtimer_color), panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(pos + eX * timer_size.x + eY * subtimer_padding, (swap ? seconds_tostring(timer) : subtimer), subtimer_size - eY * subtimer_padding * 2, (swap ? timer_color : subtimer_color), panel_fg_alpha, DRAWFLAG_NORMAL); } - drawstring_aspect(pos, (swap ? subtimer : timer), timer_size, (swap ? subtimer_color : timer_color), panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(pos, (swap ? subtimer : seconds_tostring(timer)), timer_size, (swap ? subtimer_color : timer_color), panel_fg_alpha, DRAWFLAG_NORMAL); if(subtext) drawstring_aspect(pos + eY * timer_size.y, subtext, subtext_size, '0 1 0', panel_fg_alpha, DRAWFLAG_NORMAL);