Fix map timer not being displayed if scoreboard is enabled during map vote; don't...
authorterencehill <piuntn@gmail.com>
Tue, 23 Apr 2019 13:08:16 +0000 (15:08 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 23 Apr 2019 13:08:16 +0000 (15:08 +0200)
qcsrc/client/hud/hud.qc
qcsrc/client/hud/hud.qh
qcsrc/common/minigames/cl_minigames_hud.qc

index 87ed2c4..9da25eb 100644 (file)
@@ -425,7 +425,11 @@ void HUD_Panel_Draw(entity panent)
        }
 
        bool draw_allowed = false;
-       if (active_minigame && HUD_MinigameMenu_IsOpened())
+       if (scoreboard_fade_alpha && panel.panel_showflags & PANEL_SHOW_WITH_SB)
+       {
+               draw_allowed = true;
+       }
+       else if (active_minigame && HUD_MinigameMenu_IsOpened())
        {
                if (panel.panel_showflags & PANEL_SHOW_MINIGAME)
                        draw_allowed = true;
@@ -441,7 +445,12 @@ void HUD_Panel_Draw(entity panent)
        if (draw_allowed)
        {
                if (panel.panel_showflags & PANEL_SHOW_WITH_SB)
-                       panel_fade_alpha = 1;
+               {
+                       if (scoreboard_fade_alpha && intermission == 2 && !(panel.panel_showflags & PANEL_SHOW_MAPVOTE))
+                               panel_fade_alpha = scoreboard_fade_alpha;
+                       else
+                               panel_fade_alpha = 1;
+               }
                else
                {
                        panel_fade_alpha = 1 - scoreboard_fade_alpha;
index b4596fb..d05b040 100644 (file)
@@ -178,12 +178,10 @@ vector hud_scale_center;
 void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag);
 
 .int panel_showflags;
-const int PANEL_SHOW_NEVER    = 0x00;
-const int PANEL_SHOW_MAINGAME = 0x01;
-const int PANEL_SHOW_MINIGAME = 0x02;
-const int PANEL_SHOW_MAPVOTE  = 0x04;
-const int PANEL_SHOW_WITH_SB  = 0x08;
-const int PANEL_SHOW_ALWAYS   = 0xff;
+const int PANEL_SHOW_MAINGAME = BIT(0); // show in the main HUD
+const int PANEL_SHOW_MINIGAME = BIT(1); // show when minigames panels are shown
+const int PANEL_SHOW_MAPVOTE  = BIT(2); // show during map vote
+const int PANEL_SHOW_WITH_SB  = BIT(3); // show when scoreboard is on
 
 .int panel_configflags;
 const int PANEL_CONFIG_NO        = 0x00;
@@ -225,7 +223,7 @@ REGISTER_HUD_PANEL(CENTERPRINT,     HUD_CenterPrint,    PANEL_CONFIG_MAIN | PANE
 REGISTER_HUD_PANEL(MINIGAMEBOARD,   HUD_MinigameBoard,  PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAMEBOARD
 REGISTER_HUD_PANEL(MINIGAMESTATUS,  HUD_MinigameStatus, PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAMESTATUS
 REGISTER_HUD_PANEL(MINIGAMEHELP,    HUD_MinigameHelp,   PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAMEHELP
-REGISTER_HUD_PANEL(MINIGAMEMENU,    HUD_MinigameMenu,   PANEL_CONFIG_NO                          , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // MINIGAMEMENU
+REGISTER_HUD_PANEL(MINIGAMEMENU,    HUD_MinigameMenu,   PANEL_CONFIG_NO                          , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAMEMENU
 REGISTER_HUD_PANEL(MAPVOTE,         MapVote_Draw,       PANEL_CONFIG_NO                          ,                                             PANEL_SHOW_MAPVOTE                     ) // MAPVOTE
 REGISTER_HUD_PANEL(ITEMSTIME,       HUD_ItemsTime,      PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // ITEMSTIME
 REGISTER_HUD_PANEL(QUICKMENU,       HUD_QuickMenu,      PANEL_CONFIG_MAIN                        , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                                          ) // QUICKMENU
index fba0bb1..8cfe69c 100644 (file)
@@ -26,6 +26,9 @@ bool HUD_mouse_over(entity somepanel)
 // Draws the minigame game board
 void HUD_MinigameBoard ()
 {
+       if (!HUD_MinigameMenu_IsOpened())
+               return;
+
        entity hud_minigame = NULL;
 
        if(!autocvar__hud_configure)
@@ -56,6 +59,9 @@ void HUD_MinigameBoard ()
 // Draws the minigame status panel
 void HUD_MinigameStatus ()
 {
+       if (!HUD_MinigameMenu_IsOpened())
+               return;
+
        entity hud_minigame = NULL;
 
        if(!autocvar__hud_configure)
@@ -415,7 +421,7 @@ void HUD_MinigameMenu_CurrentButton()
 // Open the minigame menu panel
 void HUD_MinigameMenu_Open()
 {
-       if ( !HUD_MinigameMenu_IsOpened() )
+       if ( !mv_active && !HUD_MinigameMenu_IsOpened() )
        {
                HUD_MinigameMenu_InsertEntry( HUD_MinigameMenu_SpawnEntry(
                        _("Create"), '0 0 0', hud_fontsize*1.5,'0.7 0.84 1', HUD_MinigameMenu_ClickCreate),
@@ -476,6 +482,13 @@ void HUD_MinigameMenu_DrawColoredEntry(vector pos, string s, vector fontsize)
 // Minigame menu panel UI
 void HUD_MinigameMenu ()
 {
+       if (mv_active)
+       {
+               if (HUD_MinigameMenu_IsOpened())
+                       HUD_MinigameMenu_Close(NULL, NULL, NULL);
+               return;
+       }
+
        if ( !HUD_MinigameMenu_IsOpened() )
                return;
 
@@ -539,6 +552,9 @@ void HUD_MinigameMenu ()
 
 void HUD_MinigameHelp()
 {
+       if (!HUD_MinigameMenu_IsOpened())
+               return;
+
        string help_message;
 
        if(!autocvar__hud_configure)