ArnoldSmith86 / virtualtabletop

a virtual surface in the browser on which you can play board, dice and card games
https://virtualtabletop.io
GNU General Public License v3.0
173 stars 31 forks source link

added smart cloning to editor #2258

Open ArnoldSmith86 opened 3 months ago

ArnoldSmith86 commented 3 months ago

The goal is basically to be able to clone a grid of widget groups first (like the current clone tool already does) and then all changes to the original should immediately apply to the clones. All automation and relations between widgets should be fixed automatically.

This was already my goal when adding the duplicate feature in the JSON editor and when I added inheritFrom. But while those are already super useful, I always thought it could be a lot smarter...

This uses a property editorSmartClone that is exclusively recognized in the editor. It won't have any effect while playing. There was already a property editorGroup so the editor can recognize a group it created earlier.

In time, I will probably introduce more editor* properties that basically tell the editor and the user that the editor is in charge of parts of the widget definition. So if the user wants to regain full control, they have to remove those properties (can be done through editor UI of course).

Other use-cases for editor* properties would be generated decks so the editor knows that it generated the deck itself and can show simplified UI to edit it. Or in a automation editor where it could show simplified versions of groups of routine operations it created itself.


Options for editorSmartClone:

Still very much WIP but at this point it is fun to play around with.

Things I want to do:

ArnoldSmith86 commented 3 months ago

PR-SERVER-BOT: You can play around with it here: https://test.virtualtabletop.io/PR-2258/pr-test (or any other room on that server)