]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Display more panels (engineinfo, modicons and timer) while showing the scoreboard
authorterencehill <piuntn@gmail.com>
Tue, 16 Aug 2016 09:54:46 +0000 (11:54 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 16 Aug 2016 09:54:46 +0000 (11:54 +0200)
32 files changed:
qcsrc/client/hud/hud.qc
qcsrc/client/hud/hud.qh
qcsrc/client/hud/panel/ammo.qc
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/hud/panel/chat.qc
qcsrc/client/hud/panel/engineinfo.qc
qcsrc/client/hud/panel/healtharmor.qc
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/notify.qc
qcsrc/client/hud/panel/physics.qc
qcsrc/client/hud/panel/powerups.qc
qcsrc/client/hud/panel/pressedkeys.qc
qcsrc/client/hud/panel/quickmenu.qc
qcsrc/client/hud/panel/racetimer.qc
qcsrc/client/hud/panel/radar.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/timer.qc
qcsrc/client/hud/panel/vote.qc
qcsrc/client/hud/panel/weapons.qc
qcsrc/client/mapvoting.qc
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/minigames/minigame/bd.qc
qcsrc/common/minigames/minigame/c4.qc
qcsrc/common/minigames/minigame/nmm.qc
qcsrc/common/minigames/minigame/pong.qc
qcsrc/common/minigames/minigame/pp.qc
qcsrc/common/minigames/minigame/ps.qc
qcsrc/common/minigames/minigame/snake.qc
qcsrc/common/minigames/minigame/ttt.qc
qcsrc/common/mutators/mutator/itemstime.qc

index c87e733e1d4e633dc2bd28e815d8c885c89ab22e..acd94ad8683a0c1e728e634674cacc98ff3cb888 100644 (file)
@@ -492,11 +492,8 @@ void Hud_Dynamic_Frame()
 void HUD_Main()
 {
        int i;
-       // global hud alpha fade (scoreboard-related panels behave differently and override it temporarly)
        if(hud_configure_menu_open == 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;
 
@@ -504,27 +501,9 @@ void HUD_Main()
 
        Hud_Dynamic_Frame();
 
-       // panels that we want to be active together with the scoreboard
-       // they must fade only when the menu does
        if(scoreboard_fade_alpha == 1)
-       {
                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)
-       {
-               hud_fade_alpha = 1;
-               HUD_Panel_Draw(HUD_PANEL(VOTE));
-               hud_fade_alpha = 0;
-               return;
-       }
 
        // Drawing stuff
        if (hud_skin_prev != autocvar_hud_skin)
index b269312d8871ceb2212ea6fd8beba1f15d28779d..5171cb79e27e1e7898bc347347537ae6d68b654b 100644 (file)
@@ -22,14 +22,13 @@ REGISTER_REGISTRY(hud_panels)
 #define HUD_PANEL(NAME) HUD_PANEL_##NAME
 
 // draw the background/borders
-#define HUD_Panel_DrawBg(theAlpha) MACRO_BEGIN { \
+#define HUD_Panel_DrawBg() MACRO_BEGIN { \
        if(panel.current_panel_bg != "0" && panel.current_panel_bg != "") \
                draw_BorderPicture( \
                        HUD_Shift(panel_pos - '1 1 0' * panel_bg_border), \
                        panel.current_panel_bg, \
                        HUD_Scale(panel_size + '1 1 0' * 2 * panel_bg_border), \
-                       panel_bg_color, \
-                       panel_bg_alpha * theAlpha, \
+                       panel_bg_color, panel_bg_alpha, \
                        HUD_Scale('1 1 0' * (panel_bg_border/BORDER_MULTIPLIER)) \
                ); \
 } MACRO_END
@@ -366,7 +365,11 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CO
 } MACRO_END
 
 // NOTE: in hud_configure mode cvars must be reloaded every frame
-#define HUD_Panel_UpdateCvars() MACRO_BEGIN {                                                                       \
+float _panel_fade_alpha;
+#define HUD_Panel_UpdateCvars(theAlpha) MACRO_BEGIN {                                                                       \
+       _panel_fade_alpha = theAlpha; \
+       if(autocvar__hud_configure) \
+               _panel_fade_alpha = 1; \
        if (panel.update_time <= time) {                                                                                \
                if (autocvar__hud_configure) panel_enabled = cvar(strcat("hud_panel_", panel.panel_name));                  \
                panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos")));                              \
@@ -392,8 +395,8 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CO
                if (hud_configure_menu_open == 2 && panel == highlightedPanel) {                                                       \
                        HUD_Panel_UpdatePosSize_ForMenu();                                                                      \
                } else {                                                                                                    \
-                       panel_bg_alpha *= hud_fade_alpha;                                                                       \
-                       panel_fg_alpha *= hud_fade_alpha;                                                                       \
+                       panel_bg_alpha *= hud_fade_alpha * _panel_fade_alpha;                                                                       \
+                       panel_fg_alpha *= hud_fade_alpha * _panel_fade_alpha;                                                                       \
                }                                                                                                           \
                panel.current_panel_pos = panel_pos;                                                                        \
                panel.current_panel_size = panel_size;                                                                      \
@@ -405,12 +408,12 @@ REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CO
        } else {                                                                                                        \
                panel_pos = panel.current_panel_pos;                                                                        \
                panel_size = panel.current_panel_size;                                                                      \
-               panel_bg_alpha = panel.current_panel_bg_alpha * hud_fade_alpha;                                             \
+               panel_bg_alpha = panel.current_panel_bg_alpha * hud_fade_alpha * _panel_fade_alpha;                                             \
                panel_bg_border = panel.current_panel_bg_border;                                                            \
                panel_bg_color = panel.current_panel_bg_color;                                                              \
                panel_bg_color_team = panel.current_panel_bg_color_team;                                                    \
                panel_bg_padding = panel.current_panel_bg_padding;                                                          \
-               panel_fg_alpha = panel.current_panel_fg_alpha * hud_fade_alpha;                                             \
+               panel_fg_alpha = panel.current_panel_fg_alpha * hud_fade_alpha * _panel_fade_alpha;                                             \
        }                                                                                                               \
 } MACRO_END
 
index bd3ccd068160d9130db8f308fe28548a4c092dad..27ba900f05a41292e3ed5b1153378e8ded089422 100644 (file)
@@ -104,7 +104,9 @@ void HUD_Ammo()
                        return;
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
        draw_beginBoldFont();
 
@@ -116,7 +118,7 @@ void HUD_Ammo()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
index 9dd5f05ff57d6152ba66c05ebdd154a1c2beb79c..decbe8f2d7947a14a509ca881fd4eb3b7deb18f1 100644 (file)
@@ -154,14 +154,7 @@ void HUD_CenterPrint ()
        }
 
        // this panel fades only when the menu does
-       float hud_fade_alpha_save = hud_fade_alpha;
-       if(hud_configure_menu_open == 1)
-               hud_fade_alpha = 1;
-       else
-               hud_fade_alpha = 1 - autocvar__menu_alpha;
-
-       HUD_Panel_UpdateCvars();
-       hud_fade_alpha = hud_fade_alpha_save;
+       HUD_Panel_UpdateCvars(1); // keep with the scoreboard
 
        if ( HUD_Radar_Clickable() )
        {
@@ -189,7 +182,7 @@ void HUD_CenterPrint ()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
 
        if (!centerprint_showing)
                return;
index 5817142ae609d79ab7359fb5b91a7f4354fa1faa..270eeb87f5bae5648fd50de28bd21cfc89e4e50b 100644 (file)
@@ -21,7 +21,7 @@ void HUD_Chat()
                }
        }
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_UpdateCvars(1); // can't be forced to fade with the scoreboard anyway
 
        if(intermission == 2)
        {
@@ -56,7 +56,7 @@ void HUD_Chat()
 
        // chat messages don't scale properly since they are displayed directly by the engine
        HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
 
        if(panel_bg_padding)
        {
index 773c751d82680fd826b00ece67514a3891134935..be5863a4c4a5fbeb72803a6db28f8e9c83962557 100644 (file)
@@ -18,7 +18,7 @@ void HUD_EngineInfo()
                if(!autocvar_hud_panel_engineinfo) return;
        }
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_UpdateCvars(1);
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@ -27,7 +27,7 @@ void HUD_EngineInfo()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
index b56e390b35824802dc07db5bbe60c5f22541ae66..54685aa14e2d87004c3c2912aa515f296b852116 100644 (file)
@@ -56,7 +56,9 @@ void HUD_HealthArmor()
                fuel = 20;
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
        draw_beginBoldFont();
 
@@ -68,7 +70,7 @@ void HUD_HealthArmor()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
index d341b6492efdecf606dffde7229e770113b5f1fe..ebca95d17a8b6974feb84c3421d82fcff491215f 100644 (file)
@@ -60,7 +60,9 @@ void HUD_InfoMessages()
                if(!autocvar_hud_panel_infomessages) return;
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@ -69,7 +71,7 @@ void HUD_InfoMessages()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
index 2c99485731ebbf1acef68f063a4c4867bb5bb8b5..95009d2ed07d771ba82d3f45fd9df28240b6c1e7 100644 (file)
@@ -758,9 +758,6 @@ void HUD_ModIcons()
                if(!HUD_ModIcons_GameType) return;
        }
 
-       HUD_Panel_UpdateCvars();
-
-       draw_beginBoldFont();
 
        if(mod_active != mod_prev) {
                mod_change = time;
@@ -772,12 +769,18 @@ void HUD_ModIcons()
        else
                mod_alpha = bound(0, 1 - (time - mod_change) * 2, 1);
 
+       //if(mod_alpha <= 0)
+       //      return;
+       HUD_Panel_UpdateCvars(mod_alpha);
+
+       draw_beginBoldFont();
+
        if (autocvar_hud_panel_modicons_dynamichud)
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       if(mod_alpha)
-               HUD_Panel_DrawBg(mod_alpha);
+
+       HUD_Panel_DrawBg();
 
        if(panel_bg_padding)
        {
index a5e923825a989fc13e9b76b9c077de5b4ce97c31..479800f9061e6018f5febf8e6cc1572a4933f134 100644 (file)
@@ -47,12 +47,14 @@ void HUD_Notify()
                if (!autocvar_hud_panel_notify)
                        return;
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
        if (autocvar_hud_panel_notify_dynamichud)
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
 
        if (!autocvar__hud_configure)
                if (notify_count == 0)
index 5fc8c1ca9018cba6b656bf6628d4c59a9edd59bc..c28fd78a43e5e82b0e1ebbba0841d7696be33053 100644 (file)
@@ -18,7 +18,9 @@ void HUD_Physics()
                if(autocvar_hud_panel_physics == 3 && !(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
        draw_beginBoldFont();
 
@@ -26,7 +28,7 @@ void HUD_Physics()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                panel_pos += '1 1 0' * panel_bg_padding;
index 7528c2ba2b1a6f89353b6e4cf83116f5ee4a6473..dd4c0597ebb643ea10e20e42310caa9df9d8e035 100644 (file)
@@ -109,12 +109,14 @@ void HUD_Powerups()
                return;
 
        // Draw panel background
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
        if (autocvar_hud_panel_powerups_dynamichud)
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
 
        // Set drawing area
        vector pos = panel_pos;
index d0a4f39fdfd8fc956ce202376af7f5b55f90ac17..e1fb8b4746cae42fb4782226e5d2d1ae187b32d4 100644 (file)
@@ -8,7 +8,9 @@ void HUD_PressedKeys()
                if(spectatee_status <= 0 && autocvar_hud_panel_pressedkeys < 2) return;
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@ -17,7 +19,7 @@ void HUD_PressedKeys()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
index b2d3588844a00a6044e1cf338e3c1f4257a53c0e..ef08fdc6030e4c8da883b21c82b895f71129013f 100644 (file)
@@ -503,7 +503,9 @@ void QuickMenu_Mouse()
                mousepos.y = bound(0, mousepos.y, vid_conheight);
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
        if(panel_bg_padding)
        {
@@ -617,10 +619,12 @@ void HUD_QuickMenu()
                }
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
        HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
 
        if(panel_bg_padding)
        {
index dd8bbdfec9375597df95e0f755309b21454af9e7..f22f19846f50f7ea090ff430688292312687880a 100644 (file)
@@ -83,7 +83,9 @@ void HUD_RaceTimer ()
                if(spectatee_status == -1) return;
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
        vector pos, mySize;
        pos = panel_pos;
@@ -93,7 +95,7 @@ void HUD_RaceTimer ()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
index e935d0cb2b27eba1b395593ca192b412afc13c2e..9704f81c6af0dfaec059f674b1d7b22d3520175e 100644 (file)
@@ -145,7 +145,9 @@ void HUD_Radar_Mouse()
                mousepos_y = bound(0, mousepos_y, vid_conheight);
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
 
        panel_size = autocvar_hud_panel_radar_maximized_size;
@@ -197,7 +199,9 @@ void HUD_Radar()
        if ( hud_panel_radar_temp_hidden )
                return;
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
        float f = 0;
 
@@ -284,7 +288,7 @@ void HUD_Radar()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
index cd0d6fa32a887e6448fe25350ff896e1b185275b..2843b86f30d382844faf7a1beca0b6d88577c23e 100644 (file)
@@ -140,7 +140,9 @@ void HUD_Score()
                if(spectatee_status == -1 && (gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
        }
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@ -149,7 +151,7 @@ void HUD_Score()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
index 9e2acb09ca95042691dfd6b17a37212cb70fcc73..1357dfee560561c25790a7177e2bc5fe44d5d11d 100644 (file)
@@ -935,7 +935,7 @@ vector Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size)
        panel_pos = pos;
        panel_size.y = 1.25 * hud_fontsize.y * (1 + max(1, tm.team_size));
        panel_size.y += panel_bg_padding * 2;
-       HUD_Panel_DrawBg(scoreboard_fade_alpha);
+       HUD_Panel_DrawBg();
 
        vector end_pos = panel_pos + eY * (panel_size.y + hud_fontsize.y);
        if(panel.current_panel_bg != "0")
@@ -1040,7 +1040,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size)
        panel_pos = pos;
        panel_size.y = height * rows;
        panel_size.y += panel_bg_padding * 2;
-       HUD_Panel_DrawBg(scoreboard_fade_alpha);
+       HUD_Panel_DrawBg();
 
        vector end_pos = panel_pos + eY * (panel_size.y + hud_fontsize.y);
        if(panel.current_panel_bg != "0")
@@ -1181,7 +1181,7 @@ vector Scoreboard_MapStats_Draw(vector pos, vector rgb, vector bg_size) {
        panel_pos = pos;
        panel_size.y = hud_fontsize.y * rows;
        panel_size.y += panel_bg_padding * 2;
-       HUD_Panel_DrawBg(scoreboard_fade_alpha);
+       HUD_Panel_DrawBg();
 
        vector end_pos = panel_pos + eY * (panel_size.y + hud_fontsize.y);
        if(panel.current_panel_bg != "0")
@@ -1240,7 +1240,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz
        panel_pos = pos;
        panel_size.y = 1.25 * hud_fontsize.y * RANKINGS_RECEIVED_CNT;
        panel_size.y += panel_bg_padding * 2;
-       HUD_Panel_DrawBg(scoreboard_fade_alpha);
+       HUD_Panel_DrawBg();
 
        vector end_pos = panel_pos + eY * (panel_size.y + hud_fontsize.y);
        if(panel.current_panel_bg != "0")
@@ -1315,12 +1315,9 @@ void Scoreboard_Draw()
        else
                HUD_Scale_Disable();
 
-       float hud_fade_alpha_save = hud_fade_alpha;
-       if(hud_configure_menu_open == 1)
-               hud_fade_alpha = 1;
-       else
-               hud_fade_alpha = scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
-       HUD_Panel_UpdateCvars();
+       if(scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(scoreboard_fade_alpha);
 
        sbt_bg_alpha = autocvar_hud_panel_scoreboard_table_bg_alpha * panel_fg_alpha;
        sbt_highlight = autocvar_hud_panel_scoreboard_table_highlight;
@@ -1329,8 +1326,6 @@ void Scoreboard_Draw()
        sbt_fg_alpha = autocvar_hud_panel_scoreboard_table_fg_alpha * panel_fg_alpha;
        sbt_fg_alpha_self = autocvar_hud_panel_scoreboard_table_fg_alpha_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);
index 5a7194a45849ee7967f97e2a9694fccaf3b97c0c..436a947e8c91da1e4ce5b0e4208e4f9499a10d2d 100644 (file)
@@ -6,7 +6,7 @@ void HUD_Timer()
                if(!autocvar_hud_panel_timer) return;
        }
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_UpdateCvars(1);
 
        draw_beginBoldFont();
 
@@ -18,7 +18,7 @@ void HUD_Timer()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
index a732b0c5ee7a2073c8a32e00ca054633fcb2c320..e78cd2806d07d16c8cd0cc35f333ea3f96d43a90 100644 (file)
@@ -61,10 +61,10 @@ void HUD_Vote()
        else
                vote_alpha = bound(0, 1 - (time - vote_change) * 2, 1);
 
-       if(!vote_alpha)
+       a = vote_alpha * (vote_highlighted ? autocvar_hud_panel_vote_alreadyvoted_alpha : 1);
+       if(a <= 0)
                return;
-
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_UpdateCvars(a);
 
        if(uid2name_dialog)
        {
@@ -76,13 +76,11 @@ void HUD_Vote()
        pos = panel_pos;
        mySize = panel_size;
 
-       a = vote_alpha * (vote_highlighted ? autocvar_hud_panel_vote_alreadyvoted_alpha : 1);
        if (autocvar_hud_panel_vote_dynamichud)
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(a);
-       a = panel_fg_alpha * a;
+       HUD_Panel_DrawBg();
 
        if(panel_bg_padding)
        {
index fe2aefc60d1c3fe5f123c49386a235ccb3cc2b8b..c4481ad0c333158bcf474b01cd2e1421da7d61a5 100644 (file)
@@ -81,7 +81,9 @@ void HUD_Weapons()
        }
 
        // update generic hud functions
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
        // figure out weapon order (how the weapons are sorted) // TODO make this configurable
        if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
@@ -152,7 +154,7 @@ void HUD_Weapons()
                if(autocvar__hud_configure)
                {
                        if(hud_configure_menu_open != 2)
-                               HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
+                               HUD_Panel_DrawBg(); // also draw the bg of the entire panel
                }
 
                // do we own this weapon?
@@ -314,7 +316,7 @@ void HUD_Weapons()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
 
        if(center.x == -1)
                return; // panel has gone off screen
index 19c128a7da6db459c14e59c4b3737dd6cb965a36..141cb7ced13d57eea99077ebbcc54b2a18e06654 100644 (file)
@@ -385,7 +385,9 @@ void MapVote_Draw()
        pos.y += hud_fontsize.y * 1.5;
        pos.y += hud_fontsize.y * 0.5;
 
-       HUD_Panel_UpdateCvars();
+       if(1 - scoreboard_fade_alpha <= 0)
+               return;
+       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
        // base for multi-column stuff...
        pos.y += hud_fontsize.y;
@@ -440,7 +442,7 @@ void MapVote_Draw()
        panel_pos.y = pos.y;
        panel_size.x = xmax - xmin;
        panel_size.y = ymax - ymin;
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
 
        if(panel_bg_padding)
        {
index 90f1b2252ec2c816bea0c566a63725be73424891..f0d51d8d0280ac2caef78313e716240ed8b69feb 100644 (file)
@@ -35,7 +35,7 @@ void HUD_MinigameBoard ()
        if ( !hud_minigame )
                return;
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_UpdateCvars(1);
 
 
        vector pos, mySize;
@@ -61,7 +61,7 @@ void HUD_MinigameStatus ()
        if ( !hud_minigame )
                return;
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_UpdateCvars(1);
 
 
        vector pos, mySize;
@@ -429,7 +429,7 @@ void HUD_MinigameMenu_MouseInput()
 {
        panel = HUD_PANEL(MINIGAME_MENU);
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_UpdateCvars(1);
 
        if(panel_bg_padding)
        {
@@ -475,10 +475,10 @@ void HUD_MinigameMenu ()
        if ( !HUD_MinigameMenu_IsOpened() )
                return;
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_UpdateCvars(1);
 
        HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
 
        if(panel_bg_padding)
        {
@@ -545,7 +545,7 @@ void HUD_MinigameHelp()
        if ( !help_message )
                return;
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_UpdateCvars(1);
 
 
        vector pos, mySize;
index 041e56339c3039be7f7207c642510a7638202951..e674a3705c76606939f2ab435cf59d0c39e7bb63 100644 (file)
@@ -854,7 +854,7 @@ void bd_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void bd_hud_status(vector pos, vector mySize)
 {
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
                hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
index 497ef2afc394d24bbe2a46ee0292a94ff0941e11..e2ee86b13bc7fa969e15b879a30c83e9faa3bb22 100644 (file)
@@ -322,7 +322,7 @@ void c4_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void c4_hud_status(vector pos, vector mySize)
 {
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
                hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
index 78fb30f1df65b4bfc40cf6921d33a25316b97d89..7ed5fe22f1348bf66245d080d9e7dd1856d9fe40 100644 (file)
@@ -496,9 +496,8 @@ void nmm_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void nmm_hud_status(vector pos, vector mySize)
 {
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        vector ts;
-
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
                hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
        pos_y += ts_y;
index d535b8c85dca031a59c460d118aee7838f001c66..fd12439d3a856f9a7f5dbaca8f9f7d389cf9fcb5 100644 (file)
@@ -542,7 +542,7 @@ void pong_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void pong_hud_status(vector pos, vector mySize)
 {
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
                hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
index f9e0f79b9a92c29459333113448238a826764404..d1cf447e472733cc34d0c16f027ce458cb8c5a86 100644 (file)
@@ -374,7 +374,7 @@ void pp_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void pp_hud_status(vector pos, vector mySize)
 {
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
                hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
index c9ef8bd67a4ae9fad1bed23776646f2485b1bad1..1912aabd6b42dc0ca5e7a735373a14f34218906a 100644 (file)
@@ -429,7 +429,7 @@ void ps_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void ps_hud_status(vector pos, vector mySize)
 {
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
                hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
index 4248d589a13391c0f6218d518a155f0cf5727556..2c4cb74f562597b2f38f06699264cf4c8527f9e6 100644 (file)
@@ -673,7 +673,7 @@ void snake_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void snake_hud_status(vector pos, vector mySize)
 {
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
                hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
index 9c0ece163343e840075cb463f79086113ba90e49..cac11744000155e987161b0a8197c4e121048395 100644 (file)
@@ -272,7 +272,7 @@ void ttt_hud_board(vector pos, vector mySize)
 // Required function, draw the game status panel
 void ttt_hud_status(vector pos, vector mySize)
 {
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        vector ts;
        ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
                hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
index f47923d4efcc5c3b1e16f2e439655b9e9f1bd30a..1ec116f0360dd9188a63f30d64cca5c472857873 100644 (file)
@@ -306,7 +306,9 @@ void HUD_ItemsTime()
     if (count == 0)
         return;
 
-    HUD_Panel_UpdateCvars();
+    if(1 - scoreboard_fade_alpha <= 0)
+        return;
+    HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
 
     vector pos, mySize;
     pos = panel_pos;
@@ -331,7 +333,7 @@ void HUD_ItemsTime()
     {
         if (autocvar__hud_configure)
         if (hud_configure_menu_open != 2)
-            HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
+            HUD_Panel_DrawBg(); // also draw the bg of the entire panel
 
         // reduce panel to avoid spacing items
         if (itemstime_size.x / itemstime_size.y < ar)
@@ -370,7 +372,7 @@ void HUD_ItemsTime()
     }
 
     HUD_Scale_Enable();
-    HUD_Panel_DrawBg(1);
+    HUD_Panel_DrawBg();
 
     float row = 0, column = 0;
     bool item_available;