Open carolhmj opened 1 year ago
Some forum requests for this: https://forum.babylonjs.com/t/add-shortcuts-to-undo-and-redo-in-the-gui-editor/42326 https://forum.babylonjs.com/t/nme-improvements/35266 https://forum.babylonjs.com/t/gui-editor-improvements-suggestion-feedback-parts-1-to-6/32704 https://forum.babylonjs.com/t/nodematerial-add-undo/30672/2
I have a generic script for "Commands" that you could wrap all the existing functionality in pretty easy.
https://github.com/Pryme8/Doomish/blob/main/src/Editor/Commands/Command.ts
Not sure if this would do it for you, but it has worked in every project that I have made that needs undo redo.
You can see how its used by the editor here: https://github.com/Pryme8/Doomish/blob/main/src/Editor/Editor.ts#L295
and then a simple example command would be like this: https://github.com/Pryme8/Doomish/blob/main/src/Editor/Commands/Common/DeleteRoomCommand.ts Normally you just define them inline and not on a separate file like this, here is an example of that: https://github.com/Pryme8/Doomish/blob/main/src/Editor/Gizmos/Gizmos.ts#L91
This can also be tied into a notification system that stacks little popups to the user notifying them when they have ran/undone a command etc.
If you are interested let me know, if not no worries!
Hi, I'm curious if there are any updates on this feature? It would really improve the ux of the editor :)
This is still on our agenda. It is simply not that trivial with our current architecture. If we want to deliver something, we want to deliver it the best we can. We have no timeline on this, sadly.
I understand, thanks for the reply!
https://github.com/Pryme8/Doomish/blob/main/src/Editor/Commands/Command.ts
The link you provided cannot be opened, I would like to refer to it
Since NME etc. are mainly based on JSON it might be very simple to use immer and Json patches? Immer can generate changes and inverseChanges
Immer however produces immutable data structures. And every change on the json would need to be wrapped by immer then. But it is pretty convenient.
This issue has been automatically staled because it has been inactive for more than 14 days. Please update to "unstale".
Are you making progress
This would improve user experience on NME, GUI Editor, etc... And a generic solution can be used in future tools.