19 int SCOREPANEL_MAX_ENTRIES = 6;
20 float SCOREPANEL_ASPECTRATIO = 2;
21 int entries =
bound(1,
floor(SCOREPANEL_MAX_ENTRIES * mySize.y / mySize.x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
22 vector fontsize =
'1 1 0' * (mySize.y / entries);
25 vector score_color =
'1 1 1';
27 float name_size = mySize.x * 0.75;
28 float spacing_size = mySize.x * 0.04;
29 const float highlight_alpha = 0.2;
30 int i = 0, first_pl = 0;
34 float players_per_team = 0;
42 if (i ==
floor((entries - 2) / players_per_team) || (entries == 1 && i == 0))
49 score = 10 + SCOREPANEL_MAX_ENTRIES * 3;
50 for (i = first_pl; i < entries; ++i)
64 s = sprintf(_(
"Player %d"), i + 1 - first_pl);
79 bool me_printed =
false;
86 for (tm =
teams.sort_next; tm; tm = tm.sort_next)
103 for (pl =
players.sort_next; pl && i<entries; pl = pl.sort_next)
108 if (i == entries - 1 && !me_printed && pl != me
111 for (pl = me.sort_next; pl; pl = pl.sort_next)
165 float score, distribution = 0;
166 vector distribution_color;
191 if (distribution <= 0)
193 distribution_color =
'0 1 0';
198 distribution_color =
'1 0 0';
204 if (distribution <= 0)
232 if (distribution >= 5)
233 distribution_color =
eY;
234 else if (distribution >= 0)
235 distribution_color =
'1 1 1';
236 else if (distribution >= -5)
237 distribution_color =
'1 1 0';
239 distribution_color =
eX;
241 string distribution_str;
242 distribution_str =
ftos(distribution);
244 if (distribution >= 0)
246 if (distribution > 0)
247 distribution_str =
strcat(
"+", distribution_str);
261 float rows = 0, columns = 0;
268 score_size =
vec2(mySize.x / columns, mySize.y / rows);
271 if (score_size.x / score_size.y > 3)
273 newSize = 3 * score_size.y;
274 offset.x = score_size.x - newSize;
275 pos.x += offset.x * 0.5;
276 score_size.x = newSize;
280 newSize = 1/3 * score_size.x;
281 offset.y = score_size.y - newSize;
282 pos.y += offset.y * 0.5;
283 score_size.y = newSize;
287 score_size =
vec2(mySize.x / 4, mySize.y / 3);
289 float max_fragcount = -99;
290 float row = 0, column = 0;
292 for (
entity tm =
teams.sort_next; tm; tm = tm.sort_next)
301 if (score > max_fragcount)
302 max_fragcount = score;
306 vector score_pos = pos +
vec2(column * (score_size.x + offset.x), row * (score_size.y + offset.y));
307 if (max_fragcount == score)
317 else if (tm.team ==
myteam)
319 if (max_fragcount == score)
325 if (max_fragcount == score)
#define MUTATOR_CALLHOOK(id,...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag)
#define drawcolorcodedstring(position, text, scale, alpha, flag)
#define drawstring(position, text, scale, rgb, alpha, flag)
#define draw_beginBoldFont()
#define drawfill(position, size, rgb, alpha, flag)
#define draw_endBoldFont()
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
const int SFL_TIME
Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!...
#define scores_flags(this)
#define SFL_ZERO_IS_WORST
string textShortenToWidth(string theText, float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
#define TIME_ENCODED_TOSTRING(n, compact)
const float DRAWFLAG_NORMAL
string entcs_GetName(int i)
void HUD_Panel_LoadCvars()
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag)
#define HUD_Panel_DrawBg()
PlayerScoreField ps_primary
#define HUD_Write_Cvar(cvar)
bool autocvar__hud_configure
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void HUD_Score_Rankings(vector pos, vector mySize, entity me)
void HUD_Score_Export(int fh)
bool autocvar_hud_panel_score_dynamichud
bool autocvar_hud_panel_score
bool autocvar_hud_panel_score_rankings
void Scoreboard_UpdatePlayerTeams()
ERASEABLE string ftos_decimals(float number, int decimals)
converts a number to a string with the indicated number of decimals
float stringwidth_colors(string s, vector theSize)
#define ColorByTeam(number)
vector Team_ColorRGB(int teamid)