Open jtwine opened 1 year ago
I don't think it's necessary, as there is no loss from this action. We can simply undo the action or reattach the script since it hasn't been deleted. @Calinou could you please confirm if this is required?
I don't think it's necessary, as there is no loss from this action. We can simply undo the action or reattach the script since it hasn't been deleted. @Calinou could you please confirm if this is required?
I agree with this comment. If something doesn't make you lose any data and is reversible with Ctrl + Z, there's no need to have a confirmation dialog.
This is like how modern operating systems don't ask for confirmation when moving a file to trash, as you can still recover the file (including with Ctrl + Z). They however ask for confirmation when you empty the trash, bypass the trash dialog by holding Shift or have the system trash disabled.
If some things aren't being correctly restored when using Ctrl + Z, then this is a bug and should be reported separately with a minimal reproduction project attached.
The script will get silently detached from the selected node without any warning or confirmation.
The History dock will display a list of recent operations, along with the Output panel if editor-level messages are enabled.
Just remember that there are other actions in Godot that result in confirmation dialogs (e.g. deletion of a Node, deletion of an Animation) and they too are reversible via Undo actions -- but they still have confirmation dialogs. Simply being able to Undo an action should not by itself be a good enough reason, IMHO. Otherwise it would be a good enough reason to go and remove the existing confirmation dialogs for those other actions, simply because they are Undoable, right?
Remember that consistent behavior goes a long way when dealing with UI/UX issues.
The other thing to remember is that this particular action is a "silent" one. If the user accidently disconnects a script, they may have no idea that they did it, and may be confused as to why something suddenly stopped working correctly in their game later on. (Although that might just warrant a confirmation dialog.)
-=- James.
I agree. I thought that there would be no data loss by this action. But, when we export some variables or an array of variables and then disconnect the script, all the data gets lost. Even after undoing, we get the default value we set in the script. So, I think it's a good reason to do it.
...if only there was a way to reopen the issue... :)
Just remember that there are other actions in Godot that result in confirmation dialogs (e.g. deletion of a Node, deletion of an Animation) and they too are reversible via Undo actions
I'd argue these shouldn't have a confirmation either :slightly_smiling_face:
Toasts are preferred nowadays for this kind of "possibly unintended" action with no risk of data loss. Godot's editor UI supports toasts since 4.0, so it should be done this way too. (Toasts in Godot support an "informational" level which would be perfect for this kind of message.)
I agree. I thought that there would be no data loss by this action. But, when we export some variables or an array of variables and then disconnect the script, all the data gets lost. Even after undoing, we get the default value we set in the script. So, I think it's a good reason to do it.
In this case, it makes sense to display a confirmation dialog if the script has exported properties with non-default values – or better, attempt to restore the custom property values that were previously set.
Godot version
v4.1.1.stable.official [bd6af8e0e]
System information
Godot v4.1.1.stable - Windows 10.0.22621 - Vulkan (Compatibility) - NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.14.7311) - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 Threads)
Issue description
Many destructive actions provide you with a confirmation dialog. However, the "detach script" function does not seem to be one of them. The script will get silently detached from the selected node without any warning or confirmation.
Suggest that either a warning or a confirmation of the action be provided. This is because an errant click can cause detachment and you might not notice it quickly enough to easily perform an Undo to resolve the issue.
Steps to reproduce
Simply press [Detach the script from the selected node.] on a node with a script attached.
Minimal reproduction project
N/A