In some cases, when something goes wrong, the plugin breaks and everything goes back to default, and all the changes that the plugin applied to the content will be reverted. So now how can we have this “reversion” process through the API? To be more clear, suppose we want to have a “Reset to default” button.
There might be something already in the API that I am missing, any advice is appreciated.
Hi @stevekwak,
Yes, something like “undo”, but not on the previous plugin runs, on the current live changes applied by the plugin, while the dialog is still open. So let’s say that we have changed the size and position of a few elements through some controls, then we decide to “reset the changes”, now we can have a button, for example says “reset to default”, that clicking on it reverts the changes, while we are still using the plugin.
@kerrishotts
Hi Kerri,
That is exactly what I have in mind. It would be very helpful to have this feature when the live changes are too complex to revert.
It can, but you’d no longer be able to make any other changes to the scenegraph, since you’d have to reject the promise returned to the menu handler. So once you trigger reset, your plugin can’t do anything else.