X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fracetimer.qc;h=9b812b81a302e1e311f76dabcfaabbf378a86dfb;hb=6e10fc43de8a770d58c08c66412bc3e033772337;hp=f82b60c4a959a3e64f2654537ec0592f89d13359;hpb=2c0cc838282e01af2743508e709d939f36776dd0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/racetimer.qc b/qcsrc/client/hud/panel/racetimer.qc index f82b60c4a..9b812b81a 100644 --- a/qcsrc/client/hud/panel/racetimer.qc +++ b/qcsrc/client/hud/panel/racetimer.qc @@ -1,11 +1,13 @@ #include "racetimer.qh" -#include -#include -#include -#include +#include -// 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) @@ -65,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"; } @@ -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")); @@ -170,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 @@ -218,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); }