case "overall/last_seen_dt":
{
order = 1;
- outstr = _("Last_Seen:");
+ outstr = _("Last seen:");
data = XonoticStatsList_convertDate(car(data));
break;
}
case "overall/alivetime":
{
order = 1;
- outstr = _("Time_Played:");
+ outstr = _("Time played:");
data = process_time(3, stof(data));
break;
}
case "overall/favorite-map":
{
order = 2;
- outstr = _("Favorite_Map:");
+ outstr = _("Favorite map:");
data = car(data);
break;
}
if((order == -1) && (out_total_matches >= 0) && (out_total_wins >= 0))
{
- bufstr_add(me.listStats, sprintf("003Matches: %d", out_total_matches), true);
+ bufstr_add(me.listStats, sprintf("003%s\n%d", _("Matches:"), out_total_matches), true);
if(out_total_matches > 0) // don't show extra info if there are no matches played
{
out_total_losses = max(0, (out_total_matches - out_total_wins));
- bufstr_add(me.listStats, sprintf("003Wins/Losses: %d/%d", out_total_wins, out_total_losses), true);
- bufstr_add(me.listStats, sprintf("004Win_Percentage: %d%%", ((out_total_wins / out_total_matches) * 100)), true);
+ bufstr_add(me.listStats, sprintf("003%s\n%d/%d", _("Wins/Losses:"), out_total_wins, out_total_losses), true);
+ bufstr_add(me.listStats, sprintf("004%s\n%d%%", _("Win percentage:"), ((out_total_wins / out_total_matches) * 100)), true);
}
out_total_matches = -1;
if((order == -1) && (out_total_kills >= 0) && (out_total_deaths >= 0))
{
- bufstr_add(me.listStats, sprintf("005Kills/Deaths: %d/%d", out_total_kills, out_total_deaths), true);
+ bufstr_add(me.listStats, sprintf("005%s\n%d/%d", _("Kills/Deaths:"), out_total_kills, out_total_deaths), true);
// if there are no deaths, just show kill count
- if(out_total_deaths > 0)
- bufstr_add(me.listStats, sprintf("006Kill_Ratio: %.2f", (out_total_kills / out_total_deaths)), true);
- else
- bufstr_add(me.listStats, sprintf("006Kill_Ratio: %.2f", out_total_kills), true);
+ if(out_total_deaths == 0)
+ out_total_deaths = 1;
+
+ bufstr_add(me.listStats, sprintf("006%s\n%.2f", _("Kill ratio:"), (out_total_kills / out_total_deaths)), true);
out_total_kills = -1;
out_total_deaths = -1;
case "matches":
{
order = 1;
- outstr = sprintf(_("%s_Matches:"), strtoupper(gametype));
- //data = sprintf(_("%d (unranked)"), data);
+ outstr = _("Matches:");
break;
}
case "elo":
{
order = 2;
- outstr = sprintf(_("%s_ELO:"), strtoupper(gametype));
+ outstr = _("ELO:");
data = sprintf("%d", stof(data));
break;
}
case "rank":
{
order = 3;
- outstr = sprintf(_("%s_Rank:"), strtoupper(gametype));
+ outstr = _("Rank:");
data = sprintf("%d", stof(data));
break;
}
case "percentile":
{
order = 4;
- outstr = sprintf(_("%s_Percentile:"), strtoupper(gametype));
+ outstr = _("Percentile:");
data = sprintf("%d%%", stof(data));
break;
}
case "favorite-map":
{
order = 5;
- outstr = sprintf(_("%s_Favorite_Map:"), strtoupper(gametype));
- //data = sprintf(_("%d (unranked)"), data);
+ outstr = _("Favorite map:");
break;
}
#endif
default: continue; // nothing to see here
}
+ outstr = strcat(strtoupper(gametype), " ", outstr);
// now set up order for sorting later
orderstr = sprintf("%2.2s%d", gametype, order);
}
else if(event == "matches")
{
- outstr = sprintf(_("%s_Matches:"), strtoupper(gametype));
+ outstr = _("Matches:");
+ outstr = strcat(strtoupper(gametype), " ", outstr);
data = sprintf(_("%d (unranked)"), stof(data));
// unranked game modes ALWAYS get put last
else { continue; }
}
- bufstr_add(me.listStats, sprintf("%s%s %s", orderstr, outstr, data), true);
+ bufstr_add(me.listStats, sprintf("%s%s\n%s", orderstr, outstr, data), true);
}
me.nItems = buf_getsize(me.listStats);
}
string data = bufstr_get(me.listStats, i);
- string s = car(data);
- string d = cdr(data);
+ int ofs = strstrofs(data, "\n", 0);
- s = substring(s, 3, strlen(s) - 3);
- s = strreplace("_", " ", s);
+ string s = substring(data, 3, ofs - 3);
s = draw_TextShortenToWidth(s, 0.5 * me.columnNameSize, 0, me.realFontSize);
draw_Text(me.realUpperMargin * eY + me.columnNameOrigin * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 1);
+ string d = substring(data, ofs + 1, strlen(data) - (ofs + 1));
d = draw_TextShortenToWidth(d, me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize), 0, me.realFontSize);
draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 1 * (me.columnNameSize - draw_TextWidth(d, 0, me.realFontSize))) * eX, d, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 1);
}