]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/racetimer.qc
Merge branch 'master' into terencehill/lms_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / racetimer.qc
index f82b60c4a959a3e64f2654537ec0592f89d13359..7ecdf1a8216afd975b9f8054ac49fa8cf0d2c153 100644 (file)
@@ -1,11 +1,13 @@
 #include "racetimer.qh"
 
-#include <client/autocvars.qh>
-#include <client/defs.qh>
-#include <client/miscfunctions.qh>
-#include <common/mapinfo.qh>
+#include <client/draw.qh>
 
-// Race timer (#6)
+// Race timer (#8)
+
+void HUD_RaceTimer_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
 
 // return the string of the onscreen race timer
 string MakeRaceString(int cp, float mytime, float theirtime, float othertime, float lapdelta, string theirname)
@@ -98,7 +100,7 @@ void HUD_RaceTimer ()
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_racetimer) return;
-               if(!(ISGAMETYPE(RACE) || ISGAMETYPE(CTS))) return;
+               if(!MUTATOR_CALLHOOK(ShowRaceTimer)) return;
                if(spectatee_status == -1) return;
        }
 
@@ -148,7 +150,7 @@ void HUD_RaceTimer ()
                str_pos = pos + eX * 0.5 * (mySize.x - stringwidth(s, false, '1 1 0' * 0.6 * mySize.y));
                drawstring(str_pos, s, '1 1 0' * 0.6 * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                draw_endBoldFont();
-               s = _("^1Intermediate 1 (+15.42)");
+               s = strcat("^1", sprintf(_("Intermediate %d"), 1), " (+15.42)");
                str_pos = pos + vec2(0.5 * (mySize.x - stringwidth(s, true, '1 1 0' * 0.2 * mySize.y)), 0.6 * mySize.y);
                drawcolorcodedstring(str_pos, s, '1 1 0' * 0.2 * mySize.y, panel_fg_alpha, DRAWFLAG_NORMAL);
                s = sprintf(_("PENALTY: %.1f (%s)"), 2, _("missing a checkpoint"));