]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'des/racetimer_speed' into des/racesplits_panel
authorDes <xon@damianv.com.ar>
Fri, 29 Nov 2024 13:08:01 +0000 (10:08 -0300)
committerDes <xon@damianv.com.ar>
Fri, 29 Nov 2024 13:08:01 +0000 (10:08 -0300)
1  2 
_hud_common.cfg
qcsrc/client/hud/panel/_mod.inc
qcsrc/client/hud/panel/_mod.qh
qcsrc/client/hud/panel/racetimer.qc
qcsrc/client/main.qh
qcsrc/menu/xonotic/_mod.inc
qcsrc/menu/xonotic/_mod.qh
xonotic-client.cfg

diff --cc _hud_common.cfg
Simple merge
Simple merge
Simple merge
index 12143d1c92c7bb65e5fb14b88295b631abdc7d31,be6787c2eb129e3b16de87bcf2651f6408e9244c..814a0edb4e58aa39dd5d10ea388ffb5b4de039df
@@@ -201,9 -194,7 +201,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(_("Checkpoint %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) : ""); 
++              s = strcat("^1", sprintf(_("Checkpoint %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"));
                                        string speed_text = string_null;
                                        if(autocvar_cl_race_cptimes_showspeed)
                                        {
-                                               string speed_color = rgb_to_hexcolor(autocvar_hud_progressbar_acceleration_neg_color);
                                                float speed_conversion_factor = GetSpeedUnitFactor(autocvar_hud_speed_unit);
-                                               float speed = vlen(vec2(csqcplayer.velocity));
+                                               float speed = race_timespeed; //vlen(vec2(csqcplayer.velocity));
                                                float speed_diff = rint(speed - race_checkpoint_splits_speed[race_checkpoint]);
                                                string units_text = autocvar_cl_race_cptimes_showspeed_unit ? GetSpeedUnit(autocvar_hud_speed_unit) : "";
+                                               // figure out color
+                                               string speed_color = rgb_to_hexcolor(autocvar_hud_progressbar_acceleration_neg_color);
                                                if(speed_diff > 0) speed_color = rgb_to_hexcolor(autocvar_hud_progressbar_acceleration_color);
                                                else if (speed_diff == 0) speed_color = "^3";
                                                if(race_time && race_previousbesttime && race_checkpoint_splits_speed[race_checkpoint])
 -                                                      speed_text = sprintf(" ^7%d%s %s(%+d%s)", speed * speed_conversion_factor, units_text, speed_color, speed_diff, units_text);
 +                                                      speed_text = sprintf(" ^7%d%s %s(%+d%s)", speed * speed_conversion_factor, units_text, speed_color, speed_diff * speed_conversion_factor, units_text);
                                                else
                                                        speed_text = sprintf(" ^7%d%s", speed * speed_conversion_factor, units_text);
+                                               // if fastest cp time, store speed for later comparison
                                                if((TIME_DECODE(race_time) - TIME_DECODE(race_previousbesttime)) < 0 || !race_checkpoint_splits_speed[race_checkpoint])
                                                {
                                                        race_checkpoint_splits_speed[race_checkpoint] = speed;
Simple merge
Simple merge
Simple merge
Simple merge