X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fnotify.qc;h=2f1b254b23fe9712df41297104e02fd69fdecb28;hb=69265650c1b6f1193cf02c99baccb28c0db913ed;hp=0dfb11db766bf0865ab7fd999e9b9d4cbd2e4ba5;hpb=90d9f7c775306324957323d53d5a4ad995d999e3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/notify.qc b/qcsrc/client/hud/panel/notify.qc index 0dfb11db7..2f1b254b2 100644 --- a/qcsrc/client/hud/panel/notify.qc +++ b/qcsrc/client/hud/panel/notify.qc @@ -1,7 +1,8 @@ #include "notify.qh" -#include -#include +#include +#include +#include // Notifications (#4) @@ -57,21 +58,36 @@ void HUD_Notify_Push(string icon, string attacker, string victim) void HUD_Notify() { - if (!autocvar__hud_configure) - if (!autocvar_hud_panel_notify) - return; + if (!autocvar__hud_configure && !autocvar_hud_panel_notify) + return; HUD_Panel_LoadCvars(); + if (scoreboard_fade_alpha) + { + float minalpha = 1; + if (notify_count == 0) + minalpha = 0; // hide if empty + else if (boxesoverlap(panel_pos, panel_pos + panel_size, + eX * scoreboard_left + eY * scoreboard_top, eX * scoreboard_right + eY * 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 HUD_Scale_Disable(); HUD_Panel_DrawBg(); - if (!autocvar__hud_configure) - if (notify_count == 0) - return; + if (!autocvar__hud_configure && notify_count == 0) + return; vector pos, size; pos = panel_pos; @@ -84,6 +100,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);