}
string timer, subtimer, subtext;
- float timelimit, timeleft, minutesLeft, overtimes;
+ float timelimit, timeleft, overtimes;
float round_timelimit, round_timeleft;
// Calculate timelimit
timelimit = STAT(WARMUP_TIMELIMIT);
if(timelimit == 0)
timelimit = STAT(TIMELIMIT) * 60;
- else if(timelimit == -1)
- timelimit = 0;
}
else
{
timeleft = bound(0, timelimit + STAT(GAMESTARTTIME) - time, timelimit);
timeleft = ceil(timeleft);
- minutesLeft = floor(timeleft / 60);
-
// Timer color
vector timer_color;
- if(intermission_time || minutesLeft >= 5 || warmup_stage || timelimit == 0)
+ if(intermission_time || timeleft >= 300 || warmup_stage || timelimit <= 0)
timer_color = '1 1 1'; //white
- else if(minutesLeft >= 1)
+ else if(timeleft >= 60)
timer_color = '1 1 0'; //yellow
else
timer_color = '1 0 0'; //red
// Timer text
if (intermission_time) {
timer = seconds_tostring(max(0, floor(intermission_time - STAT(GAMESTARTTIME))));
- } else if (autocvar_hud_panel_timer_increment || timelimit == 0) {
+ } else if (autocvar_hud_panel_timer_increment || timelimit <= 0) {
float time_elapsed = floor(time - STAT(GAMESTARTTIME));
timer = seconds_tostring(max(0, time_elapsed));
} else {
// Subtext
overtimes = STAT(OVERTIMESADDED);
- if(warmup_stage)
- subtext = "Warmup";
+ if(warmup_stage || autocvar__hud_configure)
+ subtext = _("Warmup");
+ else if(intermission_time)
+ subtext = _("Intermission");
+ else if(STAT(TIMEOUT_STATUS))
+ subtext = _("Timeout");
else if(overtimes == 1)
- subtext = "Overtime";
+ subtext = _("Overtime");
else if (overtimes > 1)
- subtext = sprintf("Overtime #%d", overtimes);
+ subtext = sprintf(_("Overtime #%d"), overtimes);
else
subtext = string_null;
float round_starttime; //point in time when the countdown to round start is over
int autocvar_leadlimit;
float checkrules_overtimesadded;
+float timeout_status; // (values: 0, 1, 2) contains whether a timeout is not active (0), was called but still at leadtime (1) or is active (2)
// TODO: world.qh can't be included here due to circular includes!
#define autocvar_fraglimit cvar("fraglimit")
REGISTER_STAT(RESPAWN_TIME, float)
REGISTER_STAT(ROUNDSTARTTIME, float, round_starttime)
REGISTER_STAT(OVERTIMESADDED, float, checkrules_overtimesadded)
+REGISTER_STAT(TIMEOUT_STATUS, float, timeout_status)
REGISTER_STAT(MONSTERS_TOTAL, int)
REGISTER_STAT(MONSTERS_KILLED, int)
REGISTER_STAT(NADE_BONUS, float)
float orig_slowmo; // contains the value of autocvar_slowmo so that, after timeout finished, it isn't set to slowmo 1 necessarily
float timeout_time; // contains the time in seconds that the active timeout has left
float timeout_leadtime; // contains the number of seconds left of the leadtime (before the timeout starts)
-float timeout_status; // (values: 0, 1, 2) contains whether a timeout is not active (0), was called but still at leadtime (1) or is active (2)
.float allowed_timeouts; // contains the number of allowed timeouts for each player
.vector lastV_angle; // used when pausing the game in order to force the player to keep his old view angle fixed