From: terencehill Date: Fri, 14 May 2021 14:31:18 +0000 (+0200) Subject: Keep the notify panel visible while dead; if it may overlap the scoreboard make it... X-Git-Tag: xonotic-v0.8.5~405^2~31^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5ec7642deba9d72eefb5424dc7c252334cee3f3e;p=xonotic%2Fxonotic-data.pk3dir.git Keep the notify panel visible while dead; if it may overlap the scoreboard make it more transparent, if the game is over halve message duration. --- diff --git a/qcsrc/client/hud/hud.qh b/qcsrc/client/hud/hud.qh index 14e1af0a0..44539f416 100644 --- a/qcsrc/client/hud/hud.qh +++ b/qcsrc/client/hud/hud.qh @@ -252,7 +252,7 @@ REGISTER_HUD_PANEL(WEAPONS, HUD_Weapons, PANEL_CONFIG_MAIN | PANE REGISTER_HUD_PANEL(AMMO, HUD_Ammo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // AMMO REGISTER_HUD_PANEL(POWERUPS, HUD_Powerups, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // POWERUPS REGISTER_HUD_PANEL(HEALTHARMOR, HUD_HealthArmor, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // HEALTHARMOR -REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // NOTIFY +REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // NOTIFY REGISTER_HUD_PANEL(TIMER, HUD_Timer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // TIMER REGISTER_HUD_PANEL(RADAR, HUD_Radar, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RADAR REGISTER_HUD_PANEL(SCORE, HUD_Score, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // SCORE diff --git a/qcsrc/client/hud/panel/notify.qc b/qcsrc/client/hud/panel/notify.qc index c2692da08..1ea81f69d 100644 --- a/qcsrc/client/hud/panel/notify.qc +++ b/qcsrc/client/hud/panel/notify.qc @@ -1,6 +1,8 @@ #include "notify.qh" #include +#include +#include // Notifications (#4) @@ -62,6 +64,20 @@ void HUD_Notify() HUD_Panel_LoadCvars(); + if (scoreboard_fade_alpha) + { + float minalpha = 1; + if (notify_count == 0) + minalpha = 0; // hide if empty + else if(panel_pos.y < scoreboard_bottom) + minalpha = 0.5; // transparent if it may overlap the scoreboard + float f = max(minalpha, (1 - scoreboard_fade_alpha)); + if (f <= 0) + return; + panel_bg_alpha *= f; + panel_fg_alpha *= f; + } + if (autocvar_hud_panel_notify_dynamichud) HUD_Scale_Enable(); else @@ -83,6 +99,8 @@ void HUD_Notify() } float fade_start = max(0, autocvar_hud_panel_notify_time); + if (intermission) // fade out in half the time + fade_start -= (time - intermission_time); float fade_time = max(0, autocvar_hud_panel_notify_fadetime); float icon_aspect = max(1, autocvar_hud_panel_notify_icon_aspect);