Update TTS providers and story markup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user