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(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 ) // QUICKMENU
+REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, PANEL_CONFIG_MAIN , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // QUICKMENU
REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD
// always add new panels to the end of list
#include <client/defs.qh>
#include <client/miscfunctions.qh>
#include <common/ent_cs.qh>
+#include <common/minigames/cl_minigames.qh>
#include <client/hud/_mod.qh>
#include <client/mapvoting.qh>
QuickMenu_Page_Command_Type[i] = 0;
}
+bool HUD_QuickMenu_Forbidden()
+{
+ return (mv_active
+ || (hud_configure_prev && hud_configure_prev != -1)
+ || HUD_MinigameMenu_IsOpened()
+ || (QuickMenu_TimeOut && time > QuickMenu_TimeOut));
+}
+
+// returns true if succeded, false otherwise
bool QuickMenu_Open(string mode, string submenu, string file)
{
+ QuickMenu_TimeOut = 0;
+ if (HUD_QuickMenu_Forbidden())
+ return false;
+
int fh = -1;
string s;
{
if(!autocvar__hud_configure)
{
- if (hud_configure_prev && hud_configure_prev != -1)
- QuickMenu_Close();
-
- if(!hud_draw_maximized) return;
- if(mv_active) return;
- if (!QuickMenu_IsOpened()) return;
+ if (!hud_draw_maximized || !QuickMenu_IsOpened())
+ return;
- if(QuickMenu_TimeOut)
- if(time > QuickMenu_TimeOut)
+ if (HUD_QuickMenu_Forbidden())
{
QuickMenu_Close();
return;