//seta hud_panel_mapvote 1 "enable this panel"
seta hud_panel_itemstime 2 "enable this panel, 1 = show when spectating, 2 = even playing in warmup stage"
//seta hud_panel_quickmenu 1 "enable this panel"
+//seta hud_panel_scoreboard 1 "enable this panel"
seta hud_panel_weapons_dynamichud 1 "apply the dynamic hud effects to this panel"
seta hud_panel_ammo_dynamichud 1 "apply the dynamic hud effects to this panel"
seta hud_panel_quickmenu_bg_border "" "if set to something else than \"\" = override default size of border around the background"
seta hud_panel_quickmenu_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
seta hud_panel_quickmenu_align "" "text alignment: 0 left, 0.5 center, 1 right"
+
+seta hud_panel_scoreboard_pos "" "position of this base of the panel"
+seta hud_panel_scoreboard_size "" "size of this panel"
+seta hud_panel_scoreboard_bg "" "if set to something else than \"\" = override default background"
+seta hud_panel_scoreboard_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_panel_scoreboard_bg_color_team "" "override panel color with team color in team based games"
+seta hud_panel_scoreboard_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_panel_scoreboard_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_panel_scoreboard_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
seta scoreboard_highlight 1 "enable highlighting for rows and columns in the scoreboard"
seta scoreboard_highlight_alpha 0.08 "highlight alpha value (depends on hud_scoreboard_highlight 1)"
seta scoreboard_highlight_alpha_self 0.3 "self highlight alpha value"
-seta scoreboard_offset_left 0.15 "how far (by percent) the scoreboard is offset from the left screen edge"
-seta scoreboard_offset_right 0.15 "how far (by percent) the scoreboard is offset from the right screen edge"
-seta scoreboard_offset_vertical 0.05 "how far (by percent) the scoreboard is offset from the top and bottom of the screen"
seta scoreboard_bg_scale 0.25 "scale for the tiled scoreboard background"
seta scoreboard_respawntime_decimals 1 "decimal places to show for the respawntime countdown display on the scoreboard"
seta scoreboard_dynamichud 0 "apply the dynamic hud effects to the scoreboard"
seta hud_panel_quickmenu_bg_padding ""
seta hud_panel_quickmenu_align "0"
+seta hud_panel_scoreboard_pos "0.150000 0.150000"
+seta hud_panel_scoreboard_size "0.700000 0.700000"
+seta hud_panel_scoreboard_bg "0"
+seta hud_panel_scoreboard_bg_color ""
+seta hud_panel_scoreboard_bg_color_team ""
+seta hud_panel_scoreboard_bg_alpha ""
+seta hud_panel_scoreboard_bg_border ""
+seta hud_panel_scoreboard_bg_padding ""
+
menu_sync
seta hud_panel_quickmenu_bg_padding ""
seta hud_panel_quickmenu_align "0"
+seta hud_panel_scoreboard_pos "0.150000 0.150000"
+seta hud_panel_scoreboard_size "0.700000 0.700000"
+seta hud_panel_scoreboard_bg "0"
+seta hud_panel_scoreboard_bg_color ""
+seta hud_panel_scoreboard_bg_color_team ""
+seta hud_panel_scoreboard_bg_alpha ""
+seta hud_panel_scoreboard_bg_border ""
+seta hud_panel_scoreboard_bg_padding ""
+
menu_sync
seta hud_panel_quickmenu_bg_padding ""
seta hud_panel_quickmenu_align "0"
+seta hud_panel_scoreboard_pos "0.150000 0.150000"
+seta hud_panel_scoreboard_size "0.700000 0.700000"
+seta hud_panel_scoreboard_bg "0"
+seta hud_panel_scoreboard_bg_color ""
+seta hud_panel_scoreboard_bg_color_team ""
+seta hud_panel_scoreboard_bg_alpha ""
+seta hud_panel_scoreboard_bg_border ""
+seta hud_panel_scoreboard_bg_padding ""
+
menu_sync
seta hud_panel_quickmenu_bg_padding ""
seta hud_panel_quickmenu_align "0"
+seta hud_panel_scoreboard_pos "0.150000 0.150000"
+seta hud_panel_scoreboard_size "0.700000 0.700000"
+seta hud_panel_scoreboard_bg "0"
+seta hud_panel_scoreboard_bg_color ""
+seta hud_panel_scoreboard_bg_color_team ""
+seta hud_panel_scoreboard_bg_alpha ""
+seta hud_panel_scoreboard_bg_border ""
+seta hud_panel_scoreboard_bg_padding ""
+
menu_sync
seta hud_panel_quickmenu_bg_padding ""
seta hud_panel_quickmenu_align "1"
+seta hud_panel_scoreboard_pos "0.150000 0.150000"
+seta hud_panel_scoreboard_size "0.700000 0.700000"
+seta hud_panel_scoreboard_bg "0"
+seta hud_panel_scoreboard_bg_color ""
+seta hud_panel_scoreboard_bg_color_team ""
+seta hud_panel_scoreboard_bg_alpha ""
+seta hud_panel_scoreboard_bg_border ""
+seta hud_panel_scoreboard_bg_padding ""
+
menu_sync
seta hud_panel_quickmenu_bg_padding ""
seta hud_panel_quickmenu_align "0"
+seta hud_panel_scoreboard_pos "0.150000 0.150000"
+seta hud_panel_scoreboard_size "0.700000 0.700000"
+seta hud_panel_scoreboard_bg "0"
+seta hud_panel_scoreboard_bg_color ""
+seta hud_panel_scoreboard_bg_color_team ""
+seta hud_panel_scoreboard_bg_alpha ""
+seta hud_panel_scoreboard_bg_border ""
+seta hud_panel_scoreboard_bg_padding ""
+
menu_sync
bool autocvar_scoreboard_highlight;
float autocvar_scoreboard_highlight_alpha = 0.10;
float autocvar_scoreboard_highlight_alpha_self = 0.25;
-float autocvar_scoreboard_offset_left;
-float autocvar_scoreboard_offset_right;
-float autocvar_scoreboard_offset_vertical;
float autocvar_scoreboard_respawntime_decimals;
bool autocvar_scoreboard_dynamichud = false;
bool autocvar_v_flipped;
hud_shift_current = hud_shift;
}
+// Scoreboard panel
+//
+void HUD_DrawScoreboard();
+void HUD_Scoreboard(void)
+{
+ HUD_DrawScoreboard();
+}
+
void HUD_Main()
{
int i;
- // global hud alpha fade
+ // global hud alpha fade (scoreboard-related panels behave differently and override it temporarly)
if(menu_enabled == 1)
hud_fade_alpha = 1;
+ else if(!autocvar__hud_configure)
+ hud_fade_alpha = (1 - scoreboard_fade_alpha) * (1 - autocvar__menu_alpha);
else
- hud_fade_alpha = (1 - autocvar__menu_alpha);
-
- if(scoreboard_fade_alpha)
- hud_fade_alpha = (1 - scoreboard_fade_alpha);
+ hud_fade_alpha = 1 - autocvar__menu_alpha;
HUD_Configure_Frame();
// they must fade only when the menu does
if(scoreboard_fade_alpha == 1)
{
- HUD_Panel_Draw(HUD_PANEL(CENTERPRINT));
- return;
+ if(autocvar__menu_alpha == 1)
+ return;
+ if(scoreboard_fade_alpha == 1)
+ {
+ HUD_Panel_Draw(HUD_PANEL(SCOREBOARD));
+ HUD_Panel_Draw(HUD_PANEL(CENTERPRINT));
+ return;
+ }
}
if(!autocvar__hud_configure && !hud_fade_alpha)
REGISTER_HUD_PANEL(MAPVOTE, MapVote_Draw, mapvote, PANEL_CONFIG_NO , PANEL_SHOW_MAPVOTE )
REGISTER_HUD_PANEL(ITEMSTIME, HUD_ItemsTime, itemstime, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, quickmenu, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(SCOREBOARD, HUD_Scoreboard, scoreboard, PANEL_CONFIG_NO , PANEL_SHOW_ALWAYS )
// always add new panels to the end of list
// Because calling lots of functions in QC apparently cuts fps in half on many machines:
}
// this panel fades only when the menu does
- float hud_fade_alpha_save = 0;
- if(scoreboard_fade_alpha)
- {
- hud_fade_alpha_save = hud_fade_alpha;
+ float hud_fade_alpha_save = hud_fade_alpha;
+ if(menu_enabled == 1)
+ hud_fade_alpha = 1;
+ else
hud_fade_alpha = 1 - autocvar__menu_alpha;
- }
+
HUD_Panel_UpdateCvars();
+ hud_fade_alpha = hud_fade_alpha_save;
if ( HUD_Radar_Clickable() )
{
panel_pos = eY * hud_panel_radar_bottom + eX * 0.5 * (vid_conwidth - panel_size_x);
panel_size_y = min(panel_size_y, vid_conheight - hud_panel_radar_bottom);
}
- else if(scoreboard_fade_alpha)
+ else if(!autocvar__hud_configure && scoreboard_fade_alpha)
{
- hud_fade_alpha = hud_fade_alpha_save;
-
// move the panel below the scoreboard
if (scoreboard_bottom >= 0.96 * vid_conheight)
return;
vector target_pos;
-
target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size.x);
-
if(target_pos.y > panel_pos.y)
{
panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
}
float HUD_WouldDrawScoreboard() {
- if (autocvar__hud_configure)
- return 0;
- else if (QuickMenu_IsOpened())
+ if (QuickMenu_IsOpened())
return 0;
else if (HUD_Radar_Clickable())
return 0;
float hud_woulddrawscoreboard_change; // "time" at which HUD_WouldDrawScoreboard() changed
void HUD_DrawScoreboard()
{
- float hud_woulddrawscoreboard;
- hud_woulddrawscoreboard = scoreboard_active;
- if(hud_woulddrawscoreboard != hud_woulddrawscoreboard_prev) {
- hud_woulddrawscoreboard_change = time;
- hud_woulddrawscoreboard_prev = hud_woulddrawscoreboard;
- }
+ if(!autocvar__hud_configure)
+ {
+ float hud_woulddrawscoreboard;
+ hud_woulddrawscoreboard = scoreboard_active;
+ if(hud_woulddrawscoreboard != hud_woulddrawscoreboard_prev) {
+ hud_woulddrawscoreboard_change = time;
+ hud_woulddrawscoreboard_prev = hud_woulddrawscoreboard;
+ }
+
+ if(hud_woulddrawscoreboard) {
+ if(menu_enabled == 1)
+ scoreboard_fade_alpha = 1;
+ float scoreboard_fadeinspeed = autocvar_scoreboard_fadeinspeed;
+ if (scoreboard_fadeinspeed)
+ scoreboard_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
+ else
+ scoreboard_fade_alpha = 1;
+ }
+ else {
+ float scoreboard_fadeoutspeed = autocvar_scoreboard_fadeoutspeed;
+ if (scoreboard_fadeoutspeed)
+ scoreboard_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
+ else
+ scoreboard_fade_alpha = 0;
+ }
- if(hud_woulddrawscoreboard) {
- float scoreboard_fadeinspeed = autocvar_scoreboard_fadeinspeed;
- if (scoreboard_fadeinspeed)
- scoreboard_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
- else
- scoreboard_fade_alpha = 1;
+ if (!scoreboard_fade_alpha)
+ return;
}
- else {
- float scoreboard_fadeoutspeed = autocvar_scoreboard_fadeoutspeed;
- if (scoreboard_fadeoutspeed)
- scoreboard_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
- else
- scoreboard_fade_alpha = 0;
- }
-
- if (!scoreboard_fade_alpha)
- return;
+ else
+ scoreboard_fade_alpha = 0;
if (autocvar_scoreboard_dynamichud)
HUD_Scale_Enable();
else
HUD_Scale_Disable();
- HUD_UpdatePlayerTeams();
+ float hud_fade_alpha_save = hud_fade_alpha;
+ if(menu_enabled == 1)
+ hud_fade_alpha = 1;
+ else
+ hud_fade_alpha = scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
+ HUD_Panel_UpdateCvars();
- scoreboard_alpha_bg = autocvar_scoreboard_alpha_bg * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
- scoreboard_alpha_fg = autocvar_scoreboard_alpha_fg * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
+ scoreboard_alpha_bg = autocvar_scoreboard_alpha_bg * panel_fg_alpha;
+ scoreboard_alpha_fg = autocvar_scoreboard_alpha_fg * panel_fg_alpha;
scoreboard_highlight = autocvar_scoreboard_highlight;
- scoreboard_highlight_alpha = autocvar_scoreboard_highlight_alpha * scoreboard_alpha_fg;
- scoreboard_highlight_alpha_self = autocvar_scoreboard_highlight_alpha_self * scoreboard_alpha_fg;
- scoreboard_alpha_name = autocvar_scoreboard_alpha_name * scoreboard_alpha_fg;
- scoreboard_alpha_name_self = autocvar_scoreboard_alpha_name_self * scoreboard_alpha_fg;
+ scoreboard_highlight_alpha = autocvar_scoreboard_highlight_alpha * panel_fg_alpha;
+ scoreboard_highlight_alpha_self = autocvar_scoreboard_highlight_alpha_self * panel_fg_alpha;
+ scoreboard_alpha_name = autocvar_scoreboard_alpha_name * panel_fg_alpha;
+ scoreboard_alpha_name_self = autocvar_scoreboard_alpha_name_self * panel_fg_alpha;
+
+ hud_fade_alpha = hud_fade_alpha_save;
+
+ // don't overlap with con_notify
+ if(!autocvar__hud_configure)
+ panel_pos_y = max((autocvar_con_notify * autocvar_con_notifysize), panel_pos_y);
+
+ HUD_Panel_DrawBg(scoreboard_fade_alpha);
+
+ if(panel_bg_padding)
+ {
+ panel_pos += '1 1 0' * panel_bg_padding;
+ panel_size -= '2 2 0' * panel_bg_padding;
+ }
+
+ HUD_UpdatePlayerTeams();
vector rgb, pos, tmp;
entity pl, tm;
string str;
- xmin = (autocvar_scoreboard_offset_left * vid_conwidth);
- ymin = max((autocvar_con_notify * autocvar_con_notifysize), (autocvar_scoreboard_offset_vertical * vid_conwidth));
+ xmin = panel_pos_x;
+ ymin = panel_pos_y;
- xmax = ((1 - autocvar_scoreboard_offset_right) * vid_conwidth);
- ymax = (vid_conheight - ymin);
+ xmax = panel_pos_x + panel_size_x;
+ ymax = panel_pos_y + panel_size_y;
- sbwidth = xmax - xmin;
+ sbwidth = panel_size_x;
// Initializes position
pos.x = xmin;
Accuracy_LoadLevels();
HUD_Main();
- HUD_DrawScoreboard();
HUD_Scale_Disable();
}