From: Des Date: Sun, 15 Sep 2024 22:13:51 +0000 (-0300) Subject: Add speed in racetimer hud_configure example string X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d0daca2e30c5b96b725cdd05411fcd20dd582180;p=xonotic%2Fxonotic-data.pk3dir.git Add speed in racetimer hud_configure example string --- diff --git a/qcsrc/client/hud/panel/racetimer.qc b/qcsrc/client/hud/panel/racetimer.qc index b73f0319c..0d8f7ac27 100644 --- a/qcsrc/client/hud/panel/racetimer.qc +++ b/qcsrc/client/hud/panel/racetimer.qc @@ -194,7 +194,9 @@ 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 = strcat("^1", sprintf(_("Intermediate %d"), 1), " (+15.42)"); + float speed_conversion_factor = GetSpeedUnitFactor(autocvar_hud_speed_unit); + string units_text = autocvar_cl_race_cptimes_showspeed_unit ? GetSpeedUnit(autocvar_hud_speed_unit) : ""; + s = strcat("^1", sprintf(_("Intermediate %d"), 1), " (+15.42)", autocvar_cl_race_cptimes_showspeed ? sprintf(" ^7%d%s %s(%+d%s)", 345 * speed_conversion_factor, units_text, rgb_to_hexcolor(autocvar_hud_progressbar_acceleration_color), 123 * speed_conversion_factor, units_text) : ""); 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"));