{
TC(int, cp);
string cpname, lapstr = "", timestr = "", col = "^7", othercol = "^7", othertimestr = "";
+ float namesize = autocvar_cl_race_cptimes_namesize * hud_fontsize.x;
if(theirname == "" || !autocvar_cl_race_cptimes_showself)
othertime = 0; // don't count personal time
else
cpname = _("Finish line");
+ if(theirname != "" && theirtime >= 0)
+ theirname = textShortenToWidth(ColorTranslateRGB(theirname), namesize, hud_fontsize, stringwidth_colors);
+
if(theirtime < 0)
return strcat(col, cpname);
else if(theirname == "")
return strcat(col, sprintf("%s (%s)", cpname, timestr));
else if(othertime)
- return strcat(col, sprintf("%s %s(%s)%s (%s %s)", cpname, othercol, othertimestr, col, timestr, strcat(ColorTranslateRGB(theirname), col, lapstr)));
+ return strcat(col, sprintf("%s %s(%s)%s (%s %s)", cpname, othercol, othertimestr, col, timestr, strcat(theirname, col, lapstr)));
else
- return strcat(col, sprintf("%s (%s %s)", cpname, timestr, strcat(ColorTranslateRGB(theirname), col, lapstr)));
+ return strcat(col, sprintf("%s (%s %s)", cpname, timestr, strcat(theirname, col, lapstr)));
}
void ClearRaceSplits() {
bool autocvar_cl_race_checkpoint_splits_hud;
bool autocvar_cl_race_cptimes_showspeed = false;
bool autocvar_cl_race_cptimes_showspeed_unit = true;
+float autocvar_cl_race_cptimes_namesize = 10;
#else
AUTOCVAR_SAVE(cl_race_checkpoint_splits_console, bool, 1, "Print checkpoint splits to console");
AUTOCVAR_SAVE(cl_race_checkpoint_splits_hud, bool, 1, "Show race checkpoint splits on HUD in infomessages");
AUTOCVAR_SAVE(cl_race_cptimes_showspeed, bool, 0, "Show race checkpoint speed (NOTE: ignores vertical speed)");
AUTOCVAR_SAVE(cl_race_cptimes_showspeed_unit, bool, 1, "Show race checkpoint speed units");
+AUTOCVAR_SAVE(cl_race_cptimes_namesize, float, 10, "Maximum player name length in checkpoint messages");
#endif
bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode
bool autocvar_cl_race_cptimes_showself = false;
seta cl_race_cptimes_onlyself 0 "Only show your own times on checkpoints in Race/CTS. Can be forced on by the server via g_race_cptimes_onlyself"
seta cl_race_cptimes_showspeed 0 "Show race checkpoint speed (NOTE: ignores vertical speed)"
seta cl_race_cptimes_showspeed_unit 1 "Show race checkpoint speed units"
+seta cl_race_cptimes_namesize 10 "Maximum length of player names in checkpoint messages"
seta cl_race_checkpoint_splits_console 1 "Print checkpoint splits to console"
seta cl_race_checkpoint_splits_hud 1 "Show race checkpoint splits on HUD in infomessages"