]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/minigames/cl_minigames.qh
Merge branch 'master' into terencehill/dynamic_hud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / minigames / cl_minigames.qh
index a073af89757a3562c63a20e7b97196e3a07dd1cc..4359dba22630ae9e5ec93236ace5a31645962401 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef CL_MINIGAMES_H
 #define CL_MINIGAMES_H
 
-#include "../../dpdefs/keycodes.qh"
-
 // Get a square in the center of the avaliable area
 // \note macro to pass by reference pos and mySize
 #define minigame_hud_fitsqare(pos, mySize) \
@@ -97,15 +95,12 @@ float minigame_isactive()
 #define minigame_cmd(...) minigame_cmd_workaround(0,__VA_ARGS__)
 void minigame_cmd_workaround(float dummy, string...cmdargc);
 
-// Read a minigame entity from the server
-void ent_read_minigame();
-
 // Prompt the player to play in the current minigame
 // (ie: it's their turn and they should get back to the minigame)
 void minigame_prompt();
 
 float HUD_MinigameMenu_IsOpened();
-void HUD_MinigameMenu_Close();
+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);
@@ -116,21 +111,22 @@ void HUD_MinigameMenu_CustomEntry(entity parent, string message, string event_ar
        while( (entityvar = findentity(entityvar,owner,active_minigame)) )
 
 
-REGISTRY(Minigames, BIT(3))
-REGISTER_REGISTRY(RegisterMinigames)
+REGISTRY(Minigames, BITS(4))
+#define Minigames_from(i) _Minigames_from(i, NULL)
+REGISTER_REGISTRY(Minigames)
+REGISTRY_CHECK(Minigames)
 #define REGISTER_MINIGAME(name,nicename) \
-    REGISTER(RegisterMinigames, MINIGAME, Minigames, name, m_id, spawn()); \
+    REGISTER(Minigames, MINIGAME_##name, m_id, new_pure(minigame_descriptor)); \
     void name##_hud_board(vector, vector); \
     void name##_hud_status(vector, vector); \
     int name##_client_event(entity, string, ...); \
-    REGISTER_INIT_POST(MINIGAME, name) { \
-        this.classname = "minigame_descriptor"; \
+    REGISTER_INIT(MINIGAME_##name) { \
         this.netname = strzone(strtolower(#name)); \
         this.message = nicename; \
         this.minigame_hud_board = name##_hud_board; \
                this.minigame_hud_status = name##_hud_status; \
                this.minigame_event = name##_client_event; \
     } \
-    REGISTER_INIT(MINIGAMEname)
+    REGISTER_INIT(MINIGAME_##name)
 
 #endif