}
HUD_Panel_UpdateCvars(weapons);
+ HUD_Panel_ApplyFadeAlpha();
if (timeout && time >= weapontime + timeout && !autocvar__hud_configure)
{
hud_configure_active_panel = HUD_PANEL_AMMO;
HUD_Panel_UpdateCvars(ammo);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
}
HUD_Panel_UpdateCvars(powerups);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
}
HUD_Panel_UpdateCvars(healtharmor);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
hud_configure_active_panel = HUD_PANEL_NOTIFY;
HUD_Panel_UpdateCvars(notify);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
hud_configure_active_panel = HUD_PANEL_TIMER;
HUD_Panel_UpdateCvars(timer);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
hud_configure_active_panel = HUD_PANEL_RADAR;
HUD_Panel_UpdateCvars(radar);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
hud_configure_active_panel = HUD_PANEL_SCORE;
HUD_Panel_UpdateCvars(score);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
hud_configure_active_panel = HUD_PANEL_RACETIMER;
HUD_Panel_UpdateCvars(racetimer);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
return;
HUD_Panel_UpdateCvars(vote);
+ HUD_Panel_ApplyFadeAlpha();
if(uid2name_dialog)
{
hud_configure_active_panel = HUD_PANEL_MODICONS;
HUD_Panel_UpdateCvars(modicons);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
HUD_Panel_UpdateCvars(pressedkeys);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
hud_configure_active_panel = HUD_PANEL_CHAT;
HUD_Panel_UpdateCvars(chat);
+ HUD_Panel_ApplyFadeAlpha();
if(autocvar__con_chat_maximized && !autocvar__hud_configure) // draw at full screen height if maximized
{
hud_configure_active_panel = HUD_PANEL_ENGINEINFO;
HUD_Panel_UpdateCvars(engineinfo);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
hud_configure_active_panel = HUD_PANEL_INFOMESSAGES;
HUD_Panel_UpdateCvars(infomessages);
+ HUD_Panel_ApplyFadeAlpha();
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
hud_configure_active_panel = HUD_PANEL_PHYSICS;
HUD_Panel_UpdateCvars(physics);
+ HUD_Panel_ApplyFadeAlpha();
HUD_Panel_DrawBg(1);
if(panel_bg_padding)
HUD_Panel_UpdateCvars(centerprint);
+ // this panel doesn't fade when showing the scoreboard
+ if(autocvar__menu_alpha)
+ HUD_Panel_ApplyFadeAlpha();
+
+ if(scoreboard_fade_alpha)
+ {
+ // 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);
+ panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
+ panel_size_y = min(panel_size_y, vid_conheight - scoreboard_bottom);
+ }
+
HUD_Panel_DrawBg(1);
if(panel_bg_padding)
{
pos_y += panel_size_y - fontsize_y;
fade = min(autocvar_hud_panel_centerprint_time/8, 0.25);
align = bound(0, autocvar_hud_panel_centerprint_align, 1);
+ float alpha_factor;
+ alpha_factor = panel_fg_alpha;
+ if (autocvar__menu_alpha)
+ alpha_factor *= hud_fade_alpha;
for (i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
{
if (j == CENTERPRINT_MAX_MSGS)
continue;
else if (centerprint_time[j] + autocvar_hud_panel_centerprint_time - fade > time)
{
- a = 1;
+ a = 1 * alpha_factor;
sz = 1;
}
else if (centerprint_time[j] + autocvar_hud_panel_centerprint_time > time)
{
- a = (centerprint_time[j] + autocvar_hud_panel_centerprint_time - time) / fade;
+ a = (centerprint_time[j] + autocvar_hud_panel_centerprint_time - time) / fade * alpha_factor;
sz = 0.8 + a * (1 - 0.8);
}
else if(autocvar__menu_alpha == 0 && scoreboard_fade_alpha == 0)
hud_fade_alpha = 1;
+ // panels that we want to be active together with the scoreboard
+ // they must call HUD_Panel_ApplyFadeAlpha(); only when showing the menu
+ if(scoreboard_fade_alpha == 1)
+ {
+ HUD_CenterPrint();
+ return;
+ }
+
if(!autocvar__hud_configure && !hud_fade_alpha)
return;
panel_bg_color_team = stof(panel_bg_color_team_str);\
}
+// the check doesn't allow to fade this panel when showing the panel-specific menu dialog
+#define HUD_Panel_ApplyFadeAlpha()\
+if(!(menu_enabled == 2 && highlightedPanel == hud_configure_active_panel))\
+{\
+ panel_bg_alpha *= hud_fade_alpha;\
+ panel_fg_alpha *= hud_fade_alpha;\
+} ENDS_WITH_CURLY_BRACE
+
// Get value for panel_bg_alpha: if "" fetch default, else use panel_bg_alpha. Also do various menu dialog fadeout/in checks, and minalpha checks
// comment on line 3 of macro: // do not set a minalpha cap when showing the config dialog for this panel
#define HUD_Panel_GetBgAlpha()\
panel_bg_alpha = (1 - autocvar__menu_alpha) * max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha;\
else\
panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha);\
-} if(!(menu_enabled == 2 && highlightedPanel == hud_configure_active_panel)) {\
- panel_bg_alpha *= hud_fade_alpha;\
}
// Get value for panel_fg_alpha. Also do various minalpha checks
// comment on line 2 of macro: // ALWAYS show disabled panels at 0.25 alpha when in config mode
-// comment on line 4 of macro: // don't fade this panel when showing the panel-specific menu dialog
#define HUD_Panel_GetFgAlpha()\
panel_fg_alpha = autocvar_hud_panel_fg_alpha;\
if(autocvar__hud_configure && !panel_enabled)\
panel_fg_alpha = 0.25;\
-if(!(menu_enabled == 2 && highlightedPanel == hud_configure_active_panel))\
- panel_fg_alpha *= hud_fade_alpha;
// Get border. See comments above, it's similar.
#define HUD_Panel_GetBorder()\