"other gamemodes except DM.\n"));
}
-string HUD_DefaultColumnLayout()
-{
- return strcat( // fteqcc sucks
- "ping pl name | ",
- "-teams,race,lms/kills +freezetag/kills -teams,lms/deaths +freezetag/deaths -teams,lms,race,ka/suicides +freezetag/suicides -race,dm,tdm,ka,freezetag/frags ", // tdm already has this in "score"
- "+tdm/kills +tdm/deaths +tdm/suicides ",
- "+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns ",
- "+lms/lives +lms/rank ",
- "+kh/caps +kh/pushes +kh/destroyed ",
- "?+race/laps ?+race/time ?+race/fastest ",
- "+as/objectives +nexball/faults +nexball/goals +ka/pickups +ka/bckills +ka/bctime +freezetag/revivals ",
- "-lms,race,nexball/score");
-}
+#define HUD_DefaultColumnLayout() \
+"ping pl name | " \
+"-teams,race,lms/kills +ft,tdm/kills -teams,lms/deaths +ft,tdm/deaths -teams,lms,race,ka/suicides +ft,tdm/suicides -race,dm,tdm,ka,ft/frags " /* tdm already has this in "score" */ \
+"+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns " \
+"+lms/lives +lms/rank " \
+"+kh/caps +kh/pushes +kh/destroyed " \
+"?+race/laps ?+race/time ?+race/fastest " \
+"+as/objectives +nb/faults +nb/goals +ka/pickups +ka/bckills +ka/bctime +ft/revivals " \
+"-lms,race,nb/score"
void Cmd_HUD_SetFields(float argc)
{
float have_name = 0, have_primary = 0, have_secondary = 0, have_separator = 0;
float missing;
+ if(!gametype)
+ {
+ // set up a temporary scoreboard layout
+ // no layout can be properly set up until score_info data haven't been received
+ argc = tokenizebyseparator("0 1 ping pl name | score", " ");
+ ps_primary = 0;
+ scores_label[ps_primary] = strzone("score");
+ scores_flags[ps_primary] = SFL_ALLOW_HIDE;
+ }
+
// TODO: re enable with gametype dependant cvars?
if(argc < 3) // no arguments provided
argc = tokenizebyseparator(strcat("0 1 ", autocvar_scoreboard_columns), " ");
{
case SP_PING:
if (!pl.gotscores)
- return "\xEE\x82\x8D\xEE\x82\x8D\xEE\x82\x8D"; // >>> sign
+ return "\xE2\x96\xB6\xE2\x96\xB6\xE2\x96\xB6"; // >>> sign using U+25B6
//str = getplayerkeyvalue(pl.sv_entnum, "ping");
f = pl.ping;
if(f == 0)
return str;
}
-void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_number)
+void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_self, float pl_number)
{
vector tmp, rgb;
rgb = Team_ColorRGB(pl.team);
rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
rgb_z = autocvar_scoreboard_color_bg_b + 0.5; }
- // Layout:
- tmp_x = sbwidth;
- tmp_y = hud_fontsize_y * 1.25;
- tmp_z = 0;
-
+ vector h_pos = pos - '1 1 0';
+ vector h_size = item_size + '2 0 0';
// alternated rows highlighting
if(is_self)
- drawfill(pos - '1 1 0', tmp + '2 0 0', rgb, scoreboard_highlight_alpha_self, DRAWFLAG_NORMAL);
+ drawfill(h_pos, h_size, rgb, scoreboard_highlight_alpha_self, DRAWFLAG_NORMAL);
else if((scoreboard_highlight) && (!mod(pl_number,2)))
- drawfill(pos - '1 1 0', tmp + '2 0 0', rgb, scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
+ drawfill(h_pos, h_size, rgb, scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
+ tmp_x = item_size_x;
tmp_y = 0;
+ tmp_z = 0;
for(i = 0; i < hud_num_fields; ++i)
{
pos_x -= hud_size[i] + hud_fontsize_x;
}
}
+
+ if(pl.eliminated)
+ drawfill(h_pos, h_size, '0 0 0', 0.5, DRAWFLAG_NORMAL);
}
/*
pos_y += 1.25 * hud_fontsize_y; // skip the header
pos_y += autocvar_scoreboard_border_thickness;
+ // item size
+ tmp_x = sbwidth;
+ tmp_y = hud_fontsize_y * 1.25;
+
// fill the table and draw the rows
i = 0;
if (teamplay)
{
if(pl.team != tm.team)
continue;
- HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localnum), i);
+ HUD_PrintScoreboardItem(pos, tmp, pl, (pl.sv_entnum == player_localnum), i);
pos_y += 1.25 * hud_fontsize_y;
++i;
}
{
if(pl.team == NUM_SPECTATOR)
continue;
- HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localnum), i);
+ HUD_PrintScoreboardItem(pos, tmp, pl, (pl.sv_entnum == player_localnum), i);
pos_y += 1.25 * hud_fontsize_y;
++i;
}
vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
{
float i;
- float weapon_cnt = WEP_COUNT - 3; // either vaporizer/nex are hidden, no port-o-launch, no tuba
+ float weapon_cnt = WEP_COUNT - 3; // either vaporizer/vortex are hidden, no port-o-launch, no tuba
float rows;
if(autocvar_scoreboard_accuracy_doublerows)
rows = 2;
average_accuracy += weapon_stats; // store sum of all accuracies in average_accuracy
string s;
- s = sprintf(_("%d%%"), weapon_stats*100);
+ s = sprintf("%d%%", weapon_stats*100);
float padding;
padding = (weapon_width - stringwidth(s, FALSE, '1 0 0' * fontsize)) / 2; // center the accuracy value
float stat_monsters_killed, stat_monsters_total;
float rows = 0;
string val;
-
+
// get monster stats
stat_monsters_killed = getstatf(STAT_MONSTERS_KILLED);
stat_monsters_total = getstatf(STAT_MONSTERS_TOTAL);
float specs;
specs = 0;
tmp = pos;
+ vector item_size;
+ item_size_x = sbwidth;
+ item_size_y = hud_fontsize_y * 1.25;
+ item_size_z = 0;
for(pl = players.sort_next; pl; pl = pl.sort_next)
{
if(pl.team != NUM_SPECTATOR)
continue;
pos_y += 1.25 * hud_fontsize_y;
- HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localnum), specs);
+ HUD_PrintScoreboardItem(pos, item_size, pl, (pl.sv_entnum == player_localnum), specs);
++specs;
}