ajskateboarder/scratch-git

Costume and sound diffing

ajskateboarder opened this issue · 1 comments

This will be a big one

Costume diffing is supported on the backend, but isn't recognized by the frontend, so while adding/removing costumes will work on commit, you can't see any changes using diff indicators (e.g before and after change)

Sound diffing isn't supported by either side right now, so I'll probably do that first

Showing changed sprites based on asset changes is already supported so the get_changed_sprites handler can be made to factor in asset changes, but showing diffs would require some more messing around. It'll probably have to store copies of the previous files somewhere, optimally in memory

Scratch stores cache (?) of all loaded assets in vm.runtime.storage.builtinHelper.assets, and since the project.json contains md5 hashes of those assets, I can load data from there for these diff previews, no file copying needed, yay

I was wrong, the builtinHelper only stores the assets needed for the default project. I also just realized the backend will save all revisions of assets up until commit, so I can use these and delete them when the project commits, because right now it doesn't do it correctly