zenzoa / mosi

A tiny game editor
https://zenzoa.github.io/mosi/
MIT License
96 stars 12 forks source link

Sprites duplicated upon room import #20

Closed Godatplay closed 5 years ago

Godatplay commented 5 years ago

Currently I'm cloning a room using export and then import. After importing, I can see duplicates of all the used sprites from my now-cloned room.

Maybe upon import, you're not checking if a given sprite already exists?

THANK YOU for an awesome tool by the way! This is seriously great

[edit: originally thought deleting the dupes didn't break anything, but it certainly does haha]

zenzoa commented 5 years ago

That's a great way to clone rooms! In the current version, rooms reference sprites by their id rather than by their name, so deleting the duplicate sprites should delete them from the cloned rooms. I'm working on refactoring things so it uses the sprite names instead, which should let you do exactly this. (It won't be backwards compatible, but it will update any new worlds to the new format.)

Godatplay commented 5 years ago

You are correct, I remembered wrong, sorry about that. I'm porting my first Bitsy game to môsi and trying to recreate a camera effect via swapping palettes on a cloned room, so I've got lots of cloning happening haha.

zenzoa commented 5 years ago

It's also on my todo list at some point to add an action that lets you change the palette of a room, which could reduce room duplication for that sort of thing in the future! Might be a little bit until I can get to that though.

zenzoa commented 5 years ago

Ok, this should be resolved with the new version on github.