Editing while playing: play runs on a runtime copy, new Game tab (Scene | Game | Graph)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Fable 5.1 committed 2026-09-07 16:34:26 +02:00
1 parent cb8885359f
commit c3a533c4e5
14 files changed
+408 -118

No files matched your search

+4 -3
View File
@@ -3,8 +3,9 @@ import type { EditorState } from './state';
/**
* Debounced autosave: every model change schedules a save ~1 s later. Saves never run
* during Play (the model does not change then anyway) and never overlap; a change that
* arrives while a save is in flight triggers another save afterwards.
* during Play (`state.project` is the runtime copy then; a pending save resumes on Stop)
* and never overlap; a change that arrives while a save is in flight triggers another save
* afterwards.
*/
export function attachAutosave(state: EditorState, store: ProjectStore, delayMs = 1000): { flush: () => Promise<void> } {
let timer = 0;
@@ -16,7 +17,7 @@ export function attachAutosave(state: EditorState, store: ProjectStore, delayMs
pending = true;
return saving;
}
if (state.saveStatus !== 'dirty' || !state.project.id) return;
if (state.saveStatus !== 'dirty' || !state.project.id || state.mode === 'play') return;
state.setSaveStatus('saving');
saving = (async () => {
try {