Add Ink session recovery and Coolify Docker support
This commit is contained in:
Vendored
+2
@@ -16,7 +16,9 @@ export declare class InkEngine {
|
||||
newGame(): TurnResult;
|
||||
chooseChoice(choiceIndex: number): TurnResult;
|
||||
saveGame(): string;
|
||||
resumeGame(savedState: string): void;
|
||||
loadGame(savedState: string): TurnResult;
|
||||
private restoreState;
|
||||
private loadStory;
|
||||
private continueStory;
|
||||
private getChoiceTags;
|
||||
|
||||
Vendored
+7
-1
@@ -90,7 +90,14 @@ class InkEngine {
|
||||
nextTurnId: this.nextTurnId,
|
||||
});
|
||||
}
|
||||
resumeGame(savedState) {
|
||||
this.restoreState(savedState);
|
||||
}
|
||||
loadGame(savedState) {
|
||||
this.restoreState(savedState);
|
||||
return this.continueStory();
|
||||
}
|
||||
restoreState(savedState) {
|
||||
this.story = this.loadStory();
|
||||
let inkState = savedState;
|
||||
try {
|
||||
@@ -106,7 +113,6 @@ class InkEngine {
|
||||
// Backward compatibility with raw Ink state JSON.
|
||||
}
|
||||
this.story.state.LoadJson(inkState);
|
||||
return this.continueStory();
|
||||
}
|
||||
loadStory() {
|
||||
const resolvedPath = path_1.default.resolve(this.storyPath);
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user