]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Keep the notify panel visible while dead; if it may overlap the scoreboard make it...
authorterencehill <piuntn@gmail.com>
Fri, 14 May 2021 14:31:18 +0000 (16:31 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 16 May 2021 13:48:36 +0000 (15:48 +0200)
qcsrc/client/hud/hud.qh
qcsrc/client/hud/panel/notify.qc

index 14e1af0a0df3f0ba27f6a43ce5cc53f063da8394..44539f4161b02819058b73032dadf226000fe91c 100644 (file)
@@ -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
index c2692da081143524442a671fe3d880aa37c0eda7..1ea81f69de3b5f855c05979f9a6502ca80471a9e 100644 (file)
@@ -1,6 +1,8 @@
 #include "notify.qh"
 
 #include <client/draw.qh>
+#include <client/hud/panel/scoreboard.qh>
+#include <client/view.qh>
 
 // 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);