Update TTS providers and story markup

This commit is contained in:
2026-05-20 22:13:31 +02:00
parent b911c40d89
commit 8258ea2321
36 changed files with 1482 additions and 197 deletions
+30 -1
View File
@@ -210,9 +210,21 @@ class GameLoopModule extends BaseModule {
return false;
}
await this.resetClientPlaybackAndDisplay();
this.currentChoices = [];
this.currentInputMode = 'none';
document.dispatchEvent(new CustomEvent('story:choices', { detail: [] }));
document.dispatchEvent(new CustomEvent('story:input-mode', { detail: 'none' }));
document.dispatchEvent(new CustomEvent('story:history-restoring', {
detail: { active: true, reason: 'autosave-reconnect-prepare' }
}));
const response = await socketClient.resumeGame(browserSave.inkState);
if (!response?.success) {
console.warn('GameLoop: autosave resume failed', response);
document.dispatchEvent(new CustomEvent('story:history-restoring', {
detail: { active: false, reason: 'autosave-reconnect-failed' }
}));
return false;
}
@@ -222,7 +234,7 @@ class GameLoopModule extends BaseModule {
this.gameState.canSave = this.gameState.started;
this.gameState.canLoad = true;
this.updateUIState();
await this.restoreBrowserSave(browserSave, 'autosave-resume', { resetDisplay: true });
await this.restoreBrowserSave(browserSave, 'autosave-resume', { resetDisplay: false });
this.restoreInputStateFromSave(browserSave, 'autosave-resume');
return true;
}
@@ -281,6 +293,14 @@ class GameLoopModule extends BaseModule {
const storyHistory = this.getModule('story-history');
if (storyHistory && typeof storyHistory.startNewGame === 'function') {
await storyHistory.startNewGame();
if (typeof storyHistory.saveSlot === 'function') {
await storyHistory.saveSlot(this.autoSaveSlot, {
inkState: null,
choices: [],
inputMode: 'none',
running: false
});
}
}
const response = await socketClient.newGame();
if (!response?.success) {
@@ -296,6 +316,15 @@ class GameLoopModule extends BaseModule {
this.gameState.canSave = true;
this.gameState.canLoad = Boolean(response.canLoad);
this.updateUIState();
if (response.savedState && storyHistory && typeof storyHistory.saveSlot === 'function') {
await storyHistory.saveSlot(this.autoSaveSlot, {
inkState: response.savedState,
choices: [],
inputMode: 'none',
running: true
});
this.lastInkState = response.savedState;
}
}
/**