4 if(!autocvar__hud_configure)
6 if(!autocvar_hud_panel_timer) return;
9 HUD_Panel_UpdateCvars();
20 pos += '1 1 0' * panel_bg_padding;
21 mySize -= '2 2 0' * panel_bg_padding;
25 float timelimit, elapsedTime, timeleft, minutesLeft;
27 timelimit = STAT(TIMELIMIT);
29 timeleft = max(0, timelimit * 60 + STAT(GAMESTARTTIME) - time);
30 timeleft = ceil(timeleft);
32 minutesLeft = floor(timeleft / 60);
35 if(minutesLeft >= 5 || warmup_stage || timelimit == 0) //don't use red or yellow in warmup or when there is no timelimit
36 timer_color = '1 1 1'; //white
37 else if(minutesLeft >= 1)
38 timer_color = '1 1 0'; //yellow
40 timer_color = '1 0 0'; //red
42 if (autocvar_hud_panel_timer_increment || timelimit == 0 || warmup_stage) {
43 if (time < STAT(GAMESTARTTIME)) {
44 //while restart is still active, show 00:00
45 timer = seconds_tostring(0);
47 elapsedTime = floor(time - STAT(GAMESTARTTIME)); //127
48 timer = seconds_tostring(elapsedTime);
51 timer = seconds_tostring(timeleft);
54 drawstring_aspect(pos, timer, mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);