X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fminigames%2Fcl_minigames.qh;h=5b4b8a3bd3300f37b976bce5a4102d9dfab485bb;hb=9f4a93b3133cf8f500531074694cac94b050923c;hp=4359dba22630ae9e5ec93236ace5a31645962401;hpb=a823548db666d01ecf1ef8b8e559caa61334ce26;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/minigames/cl_minigames.qh b/qcsrc/common/minigames/cl_minigames.qh index 4359dba22..5b4b8a3bd 100644 --- a/qcsrc/common/minigames/cl_minigames.qh +++ b/qcsrc/common/minigames/cl_minigames.qh @@ -1,5 +1,6 @@ -#ifndef CL_MINIGAMES_H -#define CL_MINIGAMES_H +#pragma once + +#include "cl_minigames_hud.qh" // Get a square in the center of the avaliable area // \note macro to pass by reference pos and mySize @@ -85,12 +86,6 @@ entity active_minigame; // minigame_player representing this client entity minigame_self; -// Whethere there's an active minigame -float minigame_isactive() -{ - return active_minigame != world; -} - // Execute a minigame command #define minigame_cmd(...) minigame_cmd_workaround(0,__VA_ARGS__) void minigame_cmd_workaround(float dummy, string...cmdargc); @@ -99,22 +94,17 @@ void minigame_cmd_workaround(float dummy, string...cmdargc); // (ie: it's their turn and they should get back to the minigame) void minigame_prompt(); -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); - #define FOREACH_MINIGAME_ENTITY(entityvar) \ - entityvar=world; \ + entityvar=NULL; \ while( (entityvar = findentity(entityvar,owner,active_minigame)) ) REGISTRY(Minigames, BITS(4)) -#define Minigames_from(i) _Minigames_from(i, NULL) REGISTER_REGISTRY(Minigames) REGISTRY_CHECK(Minigames) + +REGISTRY_DEFINE_GET(Minigames, NULL) #define REGISTER_MINIGAME(name,nicename) \ REGISTER(Minigames, MINIGAME_##name, m_id, new_pure(minigame_descriptor)); \ void name##_hud_board(vector, vector); \ @@ -128,5 +118,3 @@ REGISTRY_CHECK(Minigames) this.minigame_event = name##_client_event; \ } \ REGISTER_INIT(MINIGAME_##name) - -#endif