Autosave edited spritesheets beside their files

With document autosave, spritesheets with unsaved pixel edits are written
to a hidden .<name>.png.autosave beside their PNG (only when changed since
their last autosave; a spritesheet edit alone also triggers the document
autosave). Restoring a document's autosave brings them back as unsaved
edits without touching the PNGs. The copies are removed when the
spritesheet is saved or reloaded, or the document's autosave is discarded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-03 21:28:02 -04:00
1 parent ded95f436a
commit ce3b544392
4 files changed
+66 -3

No files matched your search

+2
View File
@@ -206,6 +206,7 @@ namespace anm2ed
auto autosavePath = document->autosave_path_get();
autosaveFiles.erase(std::remove(autosaveFiles.begin(), autosaveFiles.end(), autosavePath), autosaveFiles.end());
autosave_file_remove(autosavePath);
document->spritesheets_autosave_clear();
autosave_files_write();
}
@@ -343,6 +344,7 @@ namespace anm2ed
{
document->isForceDirty = true;
document->path = document->path_from_autosave_get(path);
document->spritesheets_autosave_restore();
document->change();
}
}