mirror of
https://github.com/GoodStartLabs/AI_Diplomacy.git
synced 2026-04-19 12:58:09 +00:00
Adding automatic start to playing if we set an env variable.
Also added a dev container that will hot load your code, so we can make sure out environments are identical.
This commit is contained in:
parent
f00a037aed
commit
40851c572e
2 changed files with 18 additions and 4 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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/"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue