Skip to content

Feat/add save and load#87

Merged
ggbb0711 merged 14 commits intomainfrom
feat/add-save-and-load
Dec 26, 2025
Merged

Feat/add save and load#87
ggbb0711 merged 14 commits intomainfrom
feat/add-save-and-load

Conversation

@ggbb0711
Copy link
Copy Markdown
Contributor

Will probably change globalSaveStory and globalLoadStory later, and the image is still a WIP

Demo.save.and.load.mp4

Comment thread src/stores/system.store.js Outdated
Comment thread src/stores/system.store.js Outdated
Comment thread src/stores/system.store.js Outdated
Comment thread vt/specs/save/basic.yaml
@@ -0,0 +1,452 @@
---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

saveSlots:
"1":
slotKey: "1"
date: __ignore__
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be actual value?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is only undefined but not ignore

Comment thread src/stores/system.store.js Outdated

state.global.saveSlots[slotKey] = saveData;

localStorage.setItem("saveSlots", JSON.stringify(state.global.saveSlots));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also need to be moved to effect

Comment thread src/stores/system.store.js Outdated

const currentState = {
projectData: state.projectData,
contexts: [...state.contexts]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to store these

viewedRegistry
contexts

@ggbb0711
Copy link
Copy Markdown
Contributor Author

demo-screenshot.mp4

Comment thread src/stores/system.store.js Outdated
contexts: [...state.contexts]
};

// const url = await captureElement("story");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has to be a 2 step thing:

// saveSaveSlot step 1
  state.global.pendingEffects.push(
    { name: 'saveScreeshot', payload: { slotKey } },
  );
// in effectsHandler 
const saveScreenshot = async () => {
   const base64Img = await routeGraphics.captureElement('story')
   engine.handleAction('saveSaveSlot', { slotKey, image: base64Img })
}

saveSlots:
"2":
slotKey: "2"
date: __ignore__
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these __ignore__ otherwise seems good.

@ggbb0711 ggbb0711 merged commit 4b7f50b into main Dec 26, 2025
1 check passed
@han4wluc han4wluc deleted the feat/add-save-and-load branch February 2, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants