seta hud_panel_radar_zoommode 0 "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4"
-seta hud_panel_score_rankings 0 "show rankings in non-team games instead of the distribution"
+seta hud_panel_score_rankings 0 "show rankings in non-team games instead of the score difference: 1 always show my own score; 2 pure rankings"
seta hud_panel_engineinfo_framecounter_time 0.1 "time between framerate display updates"
seta hud_panel_engineinfo_framecounter_decimals 0 "amount of decimals to show"
// Score (#7)
//
+void HUD_UpdatePlayerTeams();
void HUD_Score(void)
{
if(!autocvar__hud_configure && !autocvar_hud_panel_score)
vector fontsize = '0.9 0.9 0' * height;
pos_y += height * (1 - 0.9) / 2;
+ vector rgb;
+ rgb = '1 1 1';
+
+ if (!scoreboard_fade_alpha) // the scoreboard too calls HUD_UpdatePlayerTeams
+ HUD_UpdatePlayerTeams();
+
float name_size = mySize_x*0.75;
- float i, name_pos;
+ float i, me_printed;
for (pl = players.sort_next, i=0; pl && i<entries; pl = pl.sort_next, ++i)
{
+ if (pl.team == COLOR_SPECTATOR)
+ continue;
+
+ if (i == entries-1 && !me_printed && pl != me)
+ if (cvar("hud_panel_score_rankings") == 1 && spectatee_status != -1)
+ {
+ for (pl = me.sort_next; pl; pl = pl.sort_next)
+ if (pl.team != COLOR_SPECTATOR)
+ break;
+
+ if (pl)
+ rgb = '1 1 0'; //not last but not among the leading players: yellow
+ else
+ rgb = '1 0 0'; //last: red
+ pl = me;
+ }
+
+ if (pl == me)
+ {
+ if (i == 0)
+ rgb = '0 1 0'; //first: green
+ me_printed = 1;
+ drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, 0.3 * panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
string s = textShortenToWidth(GetPlayerName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring(pos + eX * mySize_x*0.79, ftos(pl.(scores[ps_primary])), fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Score:"));
me.TR(me);
me.TDempty(me, 0.2);
- me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_score_rankings", "Show rankings in non-team games"));
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Rankings:"));
+ me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "0", "Off"));
+ me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "1", "And me"));
+ me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "2", "Pure"));
}
#endif