skybaks/tm-editor-helpers

Ability to create a copy of map file every save

Closed this issue · 3 comments

Requested by bmx22c on discord:

A plugin that would:
Create its own subfolder in the "My maps" folder if not already in it (prob have to check to not override or something, I haven't thought about all of that yet)
Increase a number each time you save in the file name ({name}_{001})

Thus allowing to revert back any change, in a way.

Hoping to get openplanet-nl/issues#341 to simplify implementation

Not sure if it might help, but I found there was a maniascript event emitted for when the map was saved. Might be useful. Though I guess you could just monitor the UID, too (which is probably a lot simpler)

Hm, thats interesting.
I have some code here https://github.com/skybaks/tm-editor-helpers/blob/master/src/EditorFunction/EventSignals.as#L80 that monitors changes in UID+Fid size in bytes. I figure thats probably going to cover my base in 99% of cases.
The file size changes every save even if you dont add or remove blocks due to what i think is the thumbnail getting reshot.

Anyway, i was just going to tie to that logic and make a unique copy of the map file whenever that fires.