20 int SCOREPANEL_MAX_ENTRIES = 6;
21 float SCOREPANEL_ASPECTRATIO = 2;
22 int entries =
bound(1,
floor(SCOREPANEL_MAX_ENTRIES * mySize.y/mySize.x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
23 vector fontsize =
'1 1 0' * (mySize.y/entries);
27 score_color =
'1 1 1';
29 float name_size = mySize.x*0.75;
30 float spacing_size = mySize.x*0.04;
31 const float highlight_alpha = 0.2;
32 int i = 0, first_pl = 0;
33 bool me_printed =
false;
37 float players_per_team = 0;
44 if (i ==
floor((entries - 2) / players_per_team) || (entries == 1 && i == 0))
51 score = 10 + SCOREPANEL_MAX_ENTRIES * 3;
52 for (i=first_pl; i<entries; ++i)
66 s = sprintf(_(
"Player %d"), i + 1 - first_pl);
86 for(tm =
teams.sort_next; tm; tm = tm.sort_next) {
92 if (tm.team == myteam)
104 for (pl =
players.sort_next; pl && i<entries; pl = pl.sort_next)
109 if (i == entries-1 && !me_printed && pl != me)
112 for (pl = me.sort_next; pl; pl = pl.sort_next)
132 s =
textShortenToWidth(entcs_GetName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
165 float score, distribution = 0;
167 vector distribution_color;
173 string timer, distrtimer;
192 if (distribution <= 0) {
193 distribution_color =
'0 1 0';
197 distribution_color =
'1 0 0';
203 if (distribution <= 0)
229 if(distribution >= 5)
230 distribution_color =
eY;
231 else if(distribution >= 0)
232 distribution_color =
'1 1 1';
233 else if(distribution >= -5)
234 distribution_color =
'1 1 0';
236 distribution_color =
eX;
238 string distribution_str;
239 distribution_str =
ftos(distribution);
241 if (distribution >= 0)
243 if (distribution > 0)
244 distribution_str =
strcat(
"+", distribution_str);
251 float row, column, rows = 0, columns = 0;
253 vector score_pos, score_size;
263 score_size =
vec2(mySize.x / columns, mySize.y / rows);
266 if(score_size.x/score_size.y > 3)
268 newSize = 3 * score_size.y;
269 offset.x = score_size.x - newSize;
271 score_size.x = newSize;
275 newSize = 1/3 * score_size.x;
276 offset.y = score_size.y - newSize;
278 score_size.y = newSize;
282 score_size =
vec2(mySize.x / 4, mySize.y / 3);
288 for(tm =
teams.sort_next; tm; tm = tm.sort_next) {
298 if (score > max_fragcount)
299 max_fragcount = score;
303 score_pos = pos +
vec2(column * (score_size.x + offset.x), row * (score_size.y + offset.y));
304 if (max_fragcount == score)
314 else if(tm.team == myteam) {
315 if (max_fragcount == score)
319 if (max_fragcount == score)
#define draw_endBoldFont()
ERASEABLE string ftos_decimals(float number, int decimals)
converts a number to a string with the indicated number of decimals
void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag)
void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag)
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
void HUD_Score_Rankings(vector pos, vector mySize, entity me)
bool autocvar__hud_configure
#define draw_beginBoldFont()
vector Team_ColorRGB(int teamid)
string textShortenToWidth(string theText, float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
#define SFL_ZERO_IS_WORST
#define TIME_ENCODED_TOSTRING(n)
bool autocvar_hud_panel_score
#define HUD_Panel_DrawBg()
void HUD_Score_Export(int fh)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
const float DRAWFLAG_NORMAL
#define scores_flags(this)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define ColorByTeam(number)
#define MUTATOR_CALLHOOK(id,...)
PlayerScoreField ps_primary
void Scoreboard_UpdatePlayerTeams()
#define HUD_Write_Cvar(cvar)
bool autocvar_hud_panel_score_rankings
bool autocvar_hud_panel_score_dynamichud
const int SFL_TIME
Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!) ...
float scoreboard_fade_alpha
void HUD_Panel_LoadCvars()