]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/main.qc
Merge branch 'master' into Melanosuchus/minigames
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qc
index 36ec4f7b8c2525c2712566410ae80be9977ab50f..b21166f81e289ea8db4b3581dc5187df89b27651 100644 (file)
@@ -115,6 +115,8 @@ void CSQC_Init(void)
        CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels);
        CALL_ACCUMULATED_FUNCTION(RegisterBuffs);
 
+       initialize_minigames();
+
        WaypointSprite_Load();
 
        // precaches
@@ -190,6 +192,9 @@ void Shutdown(void)
                if (!(calledhooks & HOOK_END))
                        localcmd("\ncl_hook_gameend\n");
        }
+
+       deactivate_minigame();
+       HUD_MinigameMenu_Close();
 }
 
 .float has_team;
@@ -336,6 +341,9 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
        if (MapVote_InputEvent(bInputType, nPrimary, nSecondary))
                return true;
 
+       if (HUD_Minigame_InputEvent(bInputType, nPrimary, nSecondary))
+               return true;
+
        if(menu_visible && menu_action)
                if(menu_action(bInputType, nPrimary, nSecondary))
                        return true;
@@ -840,6 +848,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
                case ENT_CLIENT_SPAWNEVENT: Ent_ReadSpawnEvent(bIsNewEntity); break;
                case ENT_CLIENT_NOTIFICATION: Read_Notification(bIsNewEntity); break;
                case ENT_CLIENT_HEALING_ORB: ent_healer(); break;
+               case ENT_CLIENT_MINIGAME: ent_read_minigame(); break;
 
                default:
                        //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));