]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/timer.qc
Purge client/defs.qh
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / timer.qc
index a87ca93a22695b46d52ed5a9ebef74df401d55a4..e49c777db2491eeb25e0fa81bfa4d88ef001e1aa 100644 (file)
@@ -1,4 +1,16 @@
 #include "timer.qh"
+
+#include <client/autocvars.qh>
+#include <client/miscfunctions.qh>
+#include <client/view.qh>
+
+// Timer (#5)
+
+void HUD_Timer_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
 void HUD_Timer()
 {
        if(!autocvar__hud_configure)
@@ -6,7 +18,7 @@ void HUD_Timer()
                if(!autocvar_hud_panel_timer) return;
        }
 
-       HUD_Panel_UpdateCvars(1);
+       HUD_Panel_LoadCvars();
 
        draw_beginBoldFont();
 
@@ -47,15 +59,17 @@ void HUD_Timer()
        }
 
        vector timer_color;
-       if(gameover_time || minutesLeft >= 5 || warmup_stage || timelimit == 0)
+       if(intermission_time || minutesLeft >= 5 || warmup_stage || timelimit == 0)
                timer_color = '1 1 1'; //white
        else if(minutesLeft >= 1)
                timer_color = '1 1 0'; //yellow
        else
                timer_color = '1 0 0'; //red
 
-       if (gameover_time) {
-               timer = seconds_tostring(max(0, floor(gameover_time - STAT(GAMESTARTTIME))));
+       if (intermission_time) {
+               timer = seconds_tostring(max(0, floor(intermission_time - STAT(GAMESTARTTIME))));
+       } else if (warmup_stage && warmup_timeleft >= 60) {
+               timer = _("WARMUP");
        } else if (autocvar_hud_panel_timer_increment || (!warmup_stage && timelimit == 0) || (warmup_stage && warmup_timeleft <= 0)) {
                if (time < STAT(GAMESTARTTIME))
                        timer = seconds_tostring(0); //while restart is still active, show 00:00