3 if(!autocvar__hud_configure)
5 if(!autocvar_hud_panel_timer) return;
8 HUD_Panel_UpdateCvars();
19 pos += '1 1 0' * panel_bg_padding;
20 mySize -= '2 2 0' * panel_bg_padding;
24 float timelimit, elapsedTime, timeleft, minutesLeft;
26 timelimit = STAT(TIMELIMIT);
28 timeleft = max(0, timelimit * 60 + STAT(GAMESTARTTIME) - time);
29 timeleft = ceil(timeleft);
31 minutesLeft = floor(timeleft / 60);
34 if(minutesLeft >= 5 || warmup_stage || timelimit == 0) //don't use red or yellow in warmup or when there is no timelimit
35 timer_color = '1 1 1'; //white
36 else if(minutesLeft >= 1)
37 timer_color = '1 1 0'; //yellow
39 timer_color = '1 0 0'; //red
41 if (autocvar_hud_panel_timer_increment || timelimit == 0 || warmup_stage) {
42 if (time < STAT(GAMESTARTTIME)) {
43 //while restart is still active, show 00:00
44 timer = seconds_tostring(0);
46 elapsedTime = floor(time - STAT(GAMESTARTTIME)); //127
47 timer = seconds_tostring(elapsedTime);
50 timer = seconds_tostring(timeleft);
53 drawstring_aspect(pos, timer, mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);