float SCOREBOARD_OFFSET = 50;
+// wrapper to put all possible scores titles through gettext
+string TranslateScoresLabel(string l)
+{
+ switch(l)
+ {
+ case "bckills": return CTX(_("SCO^bckills"));
+ case "bctime": return CTX(_("SCO^bctime"));
+ case "caps": return CTX(_("SCO^caps"));
+ case "deaths": return CTX(_("SCO^deaths"));
+ case "destroyed": return CTX(_("SCO^destroyed"));
+ case "drops": return CTX(_("SCO^drops"));
+ case "faults": return CTX(_("SCO^faults"));
+ case "fckills": return CTX(_("SCO^fckills"));
+ case "goals": return CTX(_("SCO^goals"));
+ case "kckills": return CTX(_("SCO^kckills"));
+ case "kdratio": return CTX(_("SCO^kdratio"));
+ case "k/d": return CTX(_("SCO^k/d"));
+ case "kd": return CTX(_("SCO^kd"));
+ case "kdr": return CTX(_("SCO^kdr"));
+ case "kills": return CTX(_("SCO^kills"));
+ case "laps": return CTX(_("SCO^laps"));
+ case "lives": return CTX(_("SCO^lives"));
+ case "losses": return CTX(_("SCO^losses"));
+ case "name": return CTX(_("SCO^name"));
+ case "nick": return CTX(_("SCO^nick"));
+ case "objectives": return CTX(_("SCO^objectives"));
+ case "pickups": return CTX(_("SCO^pickups"));
+ case "ping": return CTX(_("SCO^ping"));
+ case "pl": return CTX(_("SCO^pl"));
+ case "pushes": return CTX(_("SCO^pushes"));
+ case "rank": return CTX(_("SCO^rank"));
+ case "returns": return CTX(_("SCO^returns"));
+ case "revivals": return CTX(_("SCO^revivals"));
+ case "score": return CTX(_("SCO^score"));
+ case "suicides": return CTX(_("SCO^suicides"));
+ case "takes": return CTX(_("SCO^takes"));
+ case "ticks": return CTX(_("SCO^ticks"));
+ default: return l;
+ }
+}
+
void MapVote_Draw();
void HUD_FinaleOverlay()
{
print(_("^3frags^7 kills - suicides\n"));
print(_("^3kd^7 The kill-death ratio\n"));
print(_("^3caps^7 How often a flag (CTF) or a key (KeyHunt) was captured\n"));
- print(_("^3pickups^7 How often a flag (CTF) or a key (KeyHunt) was picked up\n"));
+ print(_("^3pickups^7 How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
print(_("^3fckills^7 Number of flag carrier kills\n"));
print(_("^3returns^7 Number of flag returns\n"));
print(_("^3drops^7 Number of flag drops\n"));
print(_("^3fastest^7 Time of fastest lap (race/cts)\n"));
print(_("^3ticks^7 Number of ticks (DOM)\n"));
print(_("^3takes^7 Number of domination points taken (DOM)\n"));
+ print(_("^3bckills^7 Number of ball carrier kills\n"));
+ print(_("^3bctime^7 Total amount of time holding the ball in Keepaway\n"));
print(_("^3score^7 Total score\n\n"));
print(_("Before a field you can put a + or - sign, then a comma separated list\n"
"+lms/lives +lms/rank ",
"+kh/caps +kh/pushes +kh/destroyed ",
"?+race/laps ?+race/time ?+race/fastest ",
- "+as/objectives +nexball/faults +nexball/goals +ka/drops +ka/pickups +ka/bckills +ka/time +freezetag/revivals ",
+ "+as/objectives +nexball/faults +nexball/goals +ka/pickups +ka/bckills +ka/bctime +freezetag/revivals ",
"-lms,race,nexball/score");
}
pattern = substring(str, 0, slash);
str = substring(str, slash + 1, strlen(str) - (slash + 1));
- if not(isGametypeInFilter(gametype, teamplay, pattern))
+ if not(isGametypeInFilter(gametype, teamplay, FALSE, pattern))
continue;
}
strunzone(hud_title[hud_num_fields]);
- hud_title[hud_num_fields] = strzone(str);
- hud_size[hud_num_fields] = stringwidth(str, FALSE, hud_fontsize);
+ hud_title[hud_num_fields] = strzone(TranslateScoresLabel(str));
+ hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize);
str = strtolower(str);
if(str == "ping") {
hud_size[i] = hud_size[i-1];
hud_field[i] = hud_field[i-1];
}
- hud_title[0] = strzone("name");
+ hud_title[0] = strzone(TranslateScoresLabel("name"));
hud_field[0] = SP_NAME;
++hud_num_fields;
print(sprintf(_("fixed missing field '%s'\n"), "name"));
if(!have_secondary)
{
strunzone(hud_title[hud_num_fields]);
- hud_title[hud_num_fields] = strzone(scores_label[ps_secondary]);
+ hud_title[hud_num_fields] = strzone(TranslateScoresLabel(scores_label[ps_secondary]));
hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize);
hud_field[hud_num_fields] = ps_secondary;
++hud_num_fields;
if(!have_primary)
{
strunzone(hud_title[hud_num_fields]);
- hud_title[hud_num_fields] = strzone(scores_label[ps_primary]);
+ hud_title[hud_num_fields] = strzone(TranslateScoresLabel(scores_label[ps_primary]));
hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize);
hud_field[hud_num_fields] = ps_primary;
++hud_num_fields;
body_table_height = 1.25 * hud_fontsize_y * max(1, tm.team_size); // no player? show 1 empty line
+ pos_y += autocvar_scoreboard_border_thickness;
pos -= '1 1 0';
tmp_x = sbwidth + 2;
return 1;
else if (intermission == 2)
return 0;
- else if (getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != GAME_CTS)
- return 1;
- else if (spectatee_status == -1)
+ else if (spectatee_status != -1 && getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != GAME_CTS)
return 1;
else if (scoreboard_showscores_force)
return 1;
float weapon_width = sbwidth / weapon_cnt;
drawstring(pos, sprintf(_("Accuracy stats (average %d%%)"), average_accuracy), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
- pos_y += 1.25 * hud_fontsize_y;
+ pos_y += 1.25 * hud_fontsize_y + autocvar_scoreboard_border_thickness;
vector tmp;
tmp_x = sbwidth;
tmp_y = height * rows;
if(getstati(STAT_SWITCHWEAPON) == WEP_MINSTANEX)
g_minstagib = 1; // TODO: real detection for minstagib?
- float weapon_stats, weapon_number;
+ float weapon_stats;
if (!acc_levels)
rgb = '1 1 1';
pos_y += hud_fontsize_y;
drawstring(pos, _("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
- pos_y += hud_fontsize_y;
+ pos_y += hud_fontsize_y + autocvar_scoreboard_border_thickness;
vector tmp;
tmp_x = sbwidth;
tmp_y = 1.25 * hud_fontsize_y * RANKINGS_RECEIVED_CNT;
drawcolorcodedstring(pos + '8 0 0' * hud_fontsize_y, n, '1 1 0' * hud_fontsize_y, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += 1.25 * hud_fontsize_y;
}
+ pos_y += autocvar_scoreboard_border_thickness;
return pos;
}
vector rgb, pos, tmp;
entity pl, tm;
+ string str;
xmin = autocvar_scoreboard_offset_left * vid_conwidth;
ymin = autocvar_con_notify * autocvar_con_notifysize;
pos_z = 0;
// Heading
- drawstring(pos, _("Scoreboard"), '24 24 0', '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
- centerprint_start_x = vid_conwidth - 0.5 * (pos_x + stringwidth(_("Scoreboard"), FALSE, '24 24 0'));
- centerprint_start_y = pos_y;
+ vector sb_heading_fontsize;
+ sb_heading_fontsize = hud_fontsize * 2;
+ drawstring(pos, _("Scoreboard"), sb_heading_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
- pos_y += 24;
+ pos_y += sb_heading_fontsize_y + hud_fontsize_y * 0.25;
// Draw the scoreboard
vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * autocvar_scoreboard_bg_scale;
if(teamplay)
{
+ vector team_score_baseoffset;
+ team_score_baseoffset = eY * (2 * autocvar_scoreboard_border_thickness + hud_fontsize_y) - eX * (autocvar_scoreboard_border_thickness + hud_fontsize_x * 0.25);
for(tm = teams.sort_next; tm; tm = tm.sort_next)
{
if(tm.team == COLOR_SPECTATOR)
continue;
rgb = GetTeamRGB(tm.team);
- drawstring(pos - '2 0 0' * hud_fontsize_x + '0 1 0' * hud_fontsize_y, ftos(tm.(teamscores[ts_primary])), '1 1 0' * hud_fontsize_y * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ str = ftos(tm.(teamscores[ts_primary]));
+ drawstring(pos + team_score_baseoffset - eX * stringwidth(str, FALSE, hud_fontsize * 1.5), str, hud_fontsize * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
if(ts_primary != ts_secondary)
- drawstring(pos - '2 0 0' * hud_fontsize_x + '0 2.5 0' * hud_fontsize_y, ftos(tm.(teamscores[ts_secondary])), '1 1 0' * hud_fontsize_y * 1, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-
+ {
+ str = ftos(tm.(teamscores[ts_secondary]));
+ drawstring(pos + team_score_baseoffset - eX * stringwidth(str, FALSE, hud_fontsize) + eY * hud_fontsize_y * 1.5, str, hud_fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+ }
pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
}
}
}
// Print info string
- string str;
float tl, fl, ll;
str = sprintf(_("playing on ^2%s^7"), shortmapname);
tl = getstatf(STAT_TIMELIMIT);
if(gametype == GAME_LMS)
{
if(tl > 0)
- str = strcat(str, sprintf(_(" for up to ^1%.1g minutes^7"), tl));
+ str = strcat(str, sprintf(_(" for up to ^1%1.0f minutes^7"), tl));
}
else
{
if(tl > 0)
- str = strcat(str, sprintf(_(" for up to ^1%.1g minutes^7"), tl));
+ str = strcat(str, sprintf(_(" for up to ^1%1.0f minutes^7"), tl));
if(fl > 0)
{
if(tl > 0)
if(teamplay)
{
str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], fl),
- (teamscores_label[ts_primary] == "score") ? _("points") :
- (teamscores_label[ts_primary] == "fastest") ? _("is beaten") :
- teamscores_label[ts_primary]));
+ (teamscores_label[ts_primary] == "score") ? CTX(_("SCO^points")) :
+ (teamscores_label[ts_primary] == "fastest") ? CTX(_("SCO^is beaten")) :
+ TranslateScoresLabel(teamscores_label[ts_primary])));
}
else
{
str = strcat(str, sprintf(_(" until ^3%s %s^7"), ScoreString(scores_flags[ps_primary], fl),
- (teamscores_label[ts_primary] == "score") ? _("points") :
- (teamscores_label[ts_primary] == "fastest") ? _("is beaten") :
- teamscores_label[ts_primary]));
+ (scores_label[ps_primary] == "score") ? CTX(_("SCO^points")) :
+ (scores_label[ps_primary] == "fastest") ? CTX(_("SCO^is beaten")) :
+ TranslateScoresLabel(scores_label[ps_primary])));
}
}
if(ll > 0)
if(teamplay)
{
str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(teamscores_flags[ts_primary], ll),
- (teamscores_label[ts_primary] == "score") ? _("points") :
- (teamscores_label[ts_primary] == "fastest") ? _("is beaten") :
- teamscores_label[ts_primary]));
+ (teamscores_label[ts_primary] == "score") ? CTX(_("SCO^points")) :
+ (teamscores_label[ts_primary] == "fastest") ? CTX(_("SCO^is beaten")) :
+ TranslateScoresLabel(teamscores_label[ts_primary])));
}
else
{
str = strcat(str, sprintf(_(" until a lead of ^3%s %s^7"), ScoreString(scores_flags[ps_primary], ll),
- (teamscores_label[ts_primary] == "score") ? _("points") :
- (teamscores_label[ts_primary] == "fastest") ? _("is beaten") :
- teamscores_label[ts_primary]));
+ (scores_label[ps_primary] == "score") ? CTX(_("SCO^points")) :
+ (scores_label[ps_primary] == "fastest") ? CTX(_("SCO^is beaten")) :
+ TranslateScoresLabel(scores_label[ps_primary])));
}
}
}