diff --git a/ai_animation/src/main.ts b/ai_animation/src/main.ts index f472151..7c97f6b 100644 --- a/ai_animation/src/main.ts +++ b/ai_animation/src/main.ts @@ -17,6 +17,7 @@ import { config } from "./config"; //const isDebugMode = process.env.NODE_ENV === 'development' || localStorage.getItem('debug') === 'true'; const isDebugMode = config.isDebugMode; +const isStreamingMode = import.meta.env.VITE_STREAMING_MODE // --- CORE VARIABLES --- @@ -40,11 +41,16 @@ function initScene() { initMap(gameState.scene).then(() => { // Update info panel with initial power information logger.updateInfoPanel(); - + // Load default game file if in debug mode - if (isDebugMode) { + if (isDebugMode || isStreamingMode) { loadDefaultGameFile(); } + if (isStreamingMode) { + setTimeout(() => { + togglePlayback() + }, 2000) + } }) }).catch(err => { console.error("Error loading coordinates:", err); @@ -86,7 +92,7 @@ function animate() { gameState.unitAnimations.length === 0 && gameState.isPlaying) { console.log("Animation check: messages done, not speaking, no animations running"); - + if (gameState.gameData && gameState.gameData.phases) { // Get previous phase index const prevIndex = gameState.phaseIndex > 0 ? @@ -174,7 +180,7 @@ function loadDefaultGameFile() { console.log("Loading default game file for debug mode..."); // Path to the default game file - const defaultGameFilePath = './test-game.json'; + const defaultGameFilePath = './default_game.json'; fetch(defaultGameFilePath) .then(response => { diff --git a/docker-compose.yaml b/docker-compose.yaml index 8361f26..933c8f8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,3 +14,11 @@ services: ports: - "4173:4173" - "5173:5173" + diplomacy-dev: + build: ai_animation + ports: + - "4173:4173" + - "5173:5173" + command: ["npm", "run", "dev-all"] + volumes: + - "./ai_animation/:/app/"