18 float limitred, limityellow;
43 if (timeleft <= limitred)
45 else if (timeleft <= limityellow)
53 float time_elapsed = curtime - starttime;
55 time_elapsed =
max(0, time_elapsed);
56 return floor(time_elapsed);
61 float timeleft = timelimit + starttime - curtime;
63 timeleft =
bound(0, timeleft, timelimit);
64 return ceil(timeleft);
92 float curtime, timelimit, timeleft;
93 vector timer_size, subtext_size, subtimer_size;
94 vector timer_color =
'1 1 1';
95 vector subtimer_color =
'1 1 1';
118 if (
STAT(ROUNDSTARTTIME) == -1)
121 subtimer_str =
"--:--";
122 subtimer_color =
'1 0 0';
152 if (
STAT(WARMUP_TIMELIMIT) > 0)
153 subtext = _(
"Warmup");
158 subtext = _(
"Warmup: too few players!");
160 subtext = _(
"Warmup: teams unbalanced!");
162 subtext = _(
"Warmup: no time limit");
165 else if (
STAT(TIMEOUT_STATUS) == 2)
166 subtext = _(
"Timeout");
168 subtext = _(
"Sudden Death");
170 subtext = _(
"Overtime");
172 subtext = sprintf(_(
"Overtime #%d"),
overtimes);
174 subtext_size =
vec2(mySize.x, mySize.y / 3);
175 timer_size =
vec2(mySize.x, mySize.y - subtext_size.y);
176 subtimer_size =
vec2(mySize.x / 3, mySize.y - subtext_size.y);
184 float subtimer_padding = subtimer_size.y * 0.2;
185 timer_size.x -= subtimer_size.x;
187 (swap ? timer_str : subtimer_str), subtimer_size -
eY * 2 * subtimer_padding,
192 (swap ? subtimer_str : timer_str), timer_size,
void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag)
#define draw_beginBoldFont()
#define draw_endBoldFont()
const int OVERTIME_SUDDENDEATH
const float DRAWFLAG_NORMAL
void HUD_Panel_LoadCvars()
#define HUD_Panel_DrawBg()
bool autocvar__hud_configure
void Scoreboard_UpdatePlayerTeams()
ERASEABLE string seconds_tostring(float seconds)
vector HUD_Timer_Color(float timeleft, float timelimit)
void HUD_Timer_Export(int fh)
float HUD_Timer_TimeLeft(float curtime, float starttime, float timelimit)
float HUD_Timer_TimeElapsed(float curtime, float starttime)
float autocvar_hud_panel_timer_warning_red
int autocvar_hud_panel_timer_secondary
float autocvar_hud_panel_timer_warning_relative_red
float autocvar_hud_panel_timer_warning_relative_yellow
int autocvar_hud_panel_timer_warning_relative
bool autocvar_hud_panel_timer_unbound
bool autocvar_hud_panel_timer_dynamichud
bool autocvar_hud_panel_timer
bool autocvar_hud_panel_timer_increment
float autocvar_hud_panel_timer_warning_yellow