]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/racetimer.qc
Show compact times (1.34 instead of 0:01.34) in some places (messages, scoreboard...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / racetimer.qc
index cd0b26e0bd7af067bd797092e82f045b20b796dc..9b812b81a302e1e311f76dabcfaabbf378a86dfb 100644 (file)
@@ -1,9 +1,6 @@
 #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 (#8)
 
@@ -70,12 +67,12 @@ string MakeRaceString(int cp, float mytime, float theirtime, float othertime, fl
                if(mytime >= theirtime)
                        timestr = strcat("+", ftos_decimals(mytime - theirtime, TIME_DECIMALS));
                else
-                       timestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(theirtime));
+                       timestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(theirtime), false);
                col = "^3";
                if(mytime >= othertime)
                        othertimestr = strcat("+", ftos_decimals(mytime - othertime, TIME_DECIMALS));
                else
-                       othertimestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(othertime));
+                       othertimestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(othertime), false);
                othercol = "^7";
        }
 
@@ -103,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;
        }
 
@@ -175,7 +172,7 @@ void HUD_RaceTimer ()
                                else
                                        s = MakeRaceString(race_checkpoint, 0, -1, 0, 0, race_previousbestname);
                                if(race_time)
-                                       forcetime = TIME_ENCODED_TOSTRING(race_time);
+                                       forcetime = TIME_ENCODED_TOSTRING(race_time, false);
                        }
                }
                else
@@ -223,7 +220,7 @@ void HUD_RaceTimer ()
 
                if(race_laptime && race_checkpoint != 255)
                {
-                       s = TIME_ENCODED_TOSTRING(TIME_ENCODE(time + TIME_DECODE(race_penaltyaccumulator) - race_laptime));
+                       s = TIME_ENCODED_TOSTRING(TIME_ENCODE(time + TIME_DECODE(race_penaltyaccumulator) - race_laptime), false);
                        str_pos = pos + eX * 0.5 * (mySize.x - stringwidth(s, false, '0.6 0.6 0' * mySize.y));
                        drawstring(str_pos, s, '0.6 0.6 0' * mySize.y, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
                }