seta hud_panel_racesplits_bg_border "" "if set to something else than \"\" = override default size of border around the background"
seta hud_panel_racesplits_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
seta hud_panel_racesplits_lines "" "amount of lines to show, max 50, font size will adapt accordingly"
-seta hud_panel_racesplits_flip "" "1 = align the items to the right"
+seta hud_panel_racesplits_flip "" "order the list top to bottom instead of bottom to top"
+seta hud_panel_racesplits_align "" "text alignment: 0 left, 1 right"
seta hud_panel_vote_pos "" "position of this base of the panel"
seta hud_panel_vote_size "" "size of this panel"
seta hud_panel_racesplits_bg_border ""
seta hud_panel_racesplits_bg_padding ""
seta hud_panel_racesplits_lines "8"
-seta hud_panel_racesplits_flip "1"
+seta hud_panel_racesplits_flip "0"
+seta hud_panel_racesplits_align "1"
seta hud_panel_vote_pos "0.740000 0.690000"
seta hud_panel_vote_size "0.190000 0.090000"
seta hud_panel_racesplits_bg_border ""
seta hud_panel_racesplits_bg_padding ""
seta hud_panel_racesplits_lines "8"
-seta hud_panel_racesplits_flip "1"
+seta hud_panel_racesplits_flip "0"
+seta hud_panel_racesplits_align "1"
seta hud_panel_vote_pos "0.720000 0.670000"
seta hud_panel_vote_size "0.190000 0.090000"
seta hud_panel_racesplits_bg_border ""
seta hud_panel_racesplits_bg_padding ""
seta hud_panel_racesplits_lines "8"
-seta hud_panel_racesplits_flip "1"
+seta hud_panel_racesplits_flip "0"
+seta hud_panel_racesplits_align "1"
seta hud_panel_vote_pos "0.720000 0.890000"
seta hud_panel_vote_size "0.170000 0.110000"
seta hud_panel_racesplits_bg_border ""
seta hud_panel_racesplits_bg_padding ""
seta hud_panel_racesplits_lines "8"
-seta hud_panel_racesplits_flip "1"
+seta hud_panel_racesplits_flip "0"
+seta hud_panel_racesplits_align "1"
seta hud_panel_vote_pos "0.720000 0.890000"
seta hud_panel_vote_size "0.170000 0.110000"
seta hud_panel_racesplits_bg_border ""
seta hud_panel_racesplits_bg_padding ""
seta hud_panel_racesplits_lines "6"
-seta hud_panel_racesplits_flip "1"
+seta hud_panel_racesplits_flip "0"
+seta hud_panel_racesplits_align "1"
seta hud_panel_vote_pos "0.020000 0.650000"
seta hud_panel_vote_size "0.230000 0.110000"
seta hud_panel_racesplits_bg_border ""
seta hud_panel_racesplits_bg_padding ""
seta hud_panel_racesplits_lines "6"
-seta hud_panel_racesplits_flip "1"
+seta hud_panel_racesplits_flip "0"
+seta hud_panel_racesplits_align "1"
seta hud_panel_vote_pos "0.690000 0.750000"
seta hud_panel_vote_size "0.300000 0.100000"
void HUD_RaceSplits_Export(int fh)
{
// allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_racesplits_align");
HUD_Write_Cvar("hud_panel_racesplits_flip");
HUD_Write_Cvar("hud_panel_racesplits_lines");
}
while(getWrappedLine_remaining)
{
s = getWrappedLine(sz.x - offset, fontsize, stringwidth_colors);
- if(autocvar_hud_panel_racesplits_flip)
+ if(autocvar_hud_panel_racesplits_align)
offset = sz.x - stringwidth_colors(s, fontsize) - offset;
drawcolorcodedstring(pos + eX * offset, s, fontsize, a, DRAWFLAG_NORMAL);
pos.y += fontsize.y;
offset = fontsize.x;
}
- pos.y += fontsize.y * 0.25;
+ pos.y += fontsize.y * (offset ? 0.25 : 1.25);
return pos;
}
#define HUD_RACESPLITS_MAX_NRLINES 50 // feels like twice more than enough
int nrlines = min(HUD_RACESPLITS_MAX_NRLINES, autocvar_hud_panel_racesplits_lines);
- vector fontsize = '0.8 1 0' * (mySize.y / (nrlines+2));
+ vector fontsize = '0.8 1 0' * (mySize.y / (nrlines*1.25));
+
+
string s;
if(!autocvar__hud_configure)
{
}
}
for (int j = 0; j < nrlines; ++j)
- RaceSplit(race_checkpoint_splits[mlines[j]]);
+ RaceSplit(race_checkpoint_splits[mlines[autocvar_hud_panel_racesplits_flip ? nrlines - 1 -j : j]]);
}
else
{
string units_text = autocvar_cl_race_cptimes_showspeed_unit ? GetSpeedUnit(autocvar_hud_speed_unit) : "";
float speed_conv_f = GetSpeedUnitFactor(autocvar_hud_speed_unit);
int j;
+ string demolines[HUD_RACESPLITS_MAX_NRLINES];
for(j = 0; j < nrlines && j < 4; ++j)
{
string timestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(18.7 + (j-1) * 5.33), false);
string speed_color = rgb_to_hexcolor(j == 0 ? autocvar_hud_progressbar_acceleration_neg_color : autocvar_hud_progressbar_acceleration_color);
if(j == 3)
speed_color = "^3";
- RaceSplit(sprintf(strcat("%s %s", _("Intermediate %d"), " (%s) ^7%d%s %s"), timestr, col, j+1, time_split, speed_split, units_text, sprintf("%s(%+d%s)", speed_color, speed_diff, units_text)));
+ demolines[j] = sprintf(strcat("%s %s", _("Intermediate %d"), " (%s) ^7%d%s %s"), timestr, col, j+1, time_split, speed_split, units_text, sprintf("%s(%+d%s)", speed_color, speed_diff, units_text));
}
for(; j < nrlines; ++j)
- RaceSplit(sprintf(strcat("%s ^7", _("Intermediate %d"), " ^7%d%s"), TIME_ENCODED_TOSTRING(TIME_ENCODE(j*9.37), false), j+1, (1100 + j*63) * speed_conv_f, units_text));
+ demolines[j] = sprintf(strcat("%s ^7", _("Intermediate %d"), " ^7%d%s"), TIME_ENCODED_TOSTRING(TIME_ENCODE(j*9.37), false), j+1, (1100 + j*63) * speed_conv_f, units_text);
+ for (int j = 0; j < nrlines; ++j)
+ RaceSplit(demolines[autocvar_hud_panel_racesplits_flip ? nrlines - 1 -j : j]);
}
}
bool autocvar_hud_panel_racesplits;
bool autocvar_hud_panel_racesplits_dynamichud = false;
bool autocvar_hud_panel_racesplits_flip;
+bool autocvar_hud_panel_racesplits_align;
int autocvar_hud_panel_racesplits_lines;
me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Race Splits:")));
me.TR(me);
me.TDempty(me, 0.2);
- me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_racesplits_flip", _("Flip align")));
+ me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_racesplits_align", _("Align right")));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_racesplits_flip", _("Flip splits order")));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Splits to keep on screen:")));