Right now, when you accidentally reload you lose undo/redo state. Ideally undo/redo state is stored in an encoded form (MapData.toJSON
) in localStorage
and is therefore persisted after a reload, ensuring that players do not accidentally lose a map in progress. See the MapEditor
component. It's also worth checking out the updateUndoStack
function.
I suggest storing the undo state by mapObject?.id
(or a fallback id if no mapObject
is provided) so the undo stack can be per-map which will be on a different route in the game.
Additionally, when loading the map editor it has the ability to "restore" previous state, like from the last playtest. It should no longer be necessary to keep that feature separate, and instead the code should be cleaned up so that restorePreviousState
just restores from the undo stack. This might need a fallback behavior so that it doesn't keep restoring the same previous map β or alternatively the "Restore Map" button in the MapEditorControlPanel
should just be an "Undo" button after the first click (or after undo/redo is executed once). Open to ideas to ensure a good user experience.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too