#include "hud_config.qh"
#include "../mapvoting.qh"
#include "../teamradar.qh"
+#include <common/minigames/cl_minigames.qh>
#include <common/t_items.qh>
#include <common/deathtypes/all.qh>
#include <common/items/_mod.qh>
}
}
-bool HUD_Minigame_Showpanels();
-
void HUD_Panel_Draw(entity panent)
{
panel = panent;
}
bool draw_allowed = false;
- if (HUD_Minigame_Showpanels())
+ if (active_minigame && HUD_MinigameMenu_IsOpened())
{
if (panel.panel_showflags & PANEL_SHOW_MINIGAME)
draw_allowed = true;
if(autocvar__hud_configure)
HUD_Panel_Mouse();
- else if ( HUD_MinigameMenu_IsOpened() || minigame_isactive() )
+ else if (HUD_MinigameMenu_IsOpened() || active_minigame)
HUD_Minigame_Mouse();
else if(QuickMenu_IsOpened())
QuickMenu_Mouse();
// minigame_player representing this client
entity minigame_self;
-// Whethere there's an active minigame
-float minigame_isactive()
-{
- return active_minigame != NULL;
-}
-
// Execute a minigame command
#define minigame_cmd(...) minigame_cmd_workaround(0,__VA_ARGS__)
void minigame_cmd_workaround(float dummy, string...cmdargc);
float HUD_MinigameMenu_IsOpened();
void HUD_MinigameMenu_Close(entity this, entity actor, entity trigger);
-float HUD_Minigame_Showpanels();
+
// Adds a game-specific entry to the menu
void HUD_MinigameMenu_CustomEntry(entity parent, string message, string event_arg);
{
mousepos_x = nPrimary;
mousepos_y = nSecondary;
- if ( minigame_isactive() && HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) )
+ if ( active_minigame && HUD_mouse_over(HUD_PANEL(MINIGAME_BOARD)) )
active_minigame.minigame_event(active_minigame,"mouse_moved",mousepos);
return true;
return false;
}
- if ( minigame_isactive() && ( bInputType == 0 || bInputType == 1 ) )
+ if ( active_minigame && ( bInputType == 0 || bInputType == 1 ) )
{
string device = "";
string action = bInputType == 0 ? "pressed" : "released";
draw_cursor_normal(mousepos, '1 1 1', panel_fg_alpha);
}
-
-bool HUD_Minigame_Showpanels()
-{
- return (HUD_MinigameMenu_IsOpened() && minigame_isactive());
-}