diff options
Diffstat (limited to 'resources/js/memory.js')
-rw-r--r-- | resources/js/memory.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/resources/js/memory.js b/resources/js/memory.js index 709a084..b403037 100644 --- a/resources/js/memory.js +++ b/resources/js/memory.js @@ -181,6 +181,7 @@ const Memory = { */ const loadedState = saveData; + Memory.state.Settings.name = loadedState.Settings.name; Memory.state.Settings.language = loadedState.Settings.language; await fetchTranslation(Memory.state.Settings.language); applyTranslation(); @@ -197,6 +198,8 @@ const Memory = { } Memory.state.currentArea = await loadArea(loadedState.currentArea); Memory.state.lastVisitedTown = loadedState.lastVisitedTown; + Memory.state.storyProgress = loadedState.storyProgress; + Memory.state.currentStory = loadedState.currentStory; Memory.state.turn = loadedState.turn; Memory.state.money = loadedState.money; @@ -227,6 +230,8 @@ const Memory = { UI.drawArea(); UI.drawStatus(); UI.closeAllPopups(); + + Story.progress(Memory.state.currentStory); }, /** @@ -240,3 +245,10 @@ const Memory = { Memory.loadFromString(localStorage.getItem('state')); }, }; + +async function initializeState () { + Memory.state.currentArea = await fetchArea('paper-town'); + Memory.state.player = new Trainer({ monsters: [] }); + Memory.state.opponent = new Trainer({ monsters: [] }); + Memory.state.activeTechnique = await fetchTechnique('all_in'); +} |