Operating system or device - Godot version:
Ubuntu Linux 16.04 - Godot 3.0 master branch (cloned 4 hours ago)
Issue description:
Trying to save scripts with the save shortcut (CTRL+S) does not work until an existing scene is
opened or a valid scene with root node is saved.
Message: "This operation can't be done without a tree root"
Steps to reproduce:
Open an empty or existing project and close all open scenes. Open an empty or existing script in
the script editor and press (CTRL+S).
This is not a bug, Ctrl+S saves the scene, which can't be done if there's no scene to save. The shortcut to save script is Ctrl+Alt+S.
Okay but Ctrl+S also saves the currently open script in the script editor, if there is a scene open in the background (that is already saved). So by that logic Ctrl+S is also kind of for saving scripts. I think that this is a mild inconsistency from the user's perspective.
If the editor allows the user to save scripts with Ctrl+S anyway most of the time, why not allow the user to save scripts with Ctrl+S without needing to open a scene first?
Reopening as there seems to be interest for discussion. (and discussing on closed issues is a mess)
Ctrl+S to save only the script sounds sensible, but this has been discussed a few times and I don't know if something changed since them.
I think context based shortcuts (current focused scene/script/resource) should be the shorter ones and global shortcuts be the more complex combinations (to make it harder to do a global mess).
First of all thank you for your report and sorry for the delay.
We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.
We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about its current status here?
For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.
Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.
Thanks in advance.
Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.
I am still able to reproduce this in Godot 3.0.2.stable.official on Mac:
Reproducible with the “Kinematic Collision” project:
project.godot
.player.gd
script.I agree with this proposal above:
I think context based shortcuts (current focused scene/script/resource) should be the shorter ones and global shortcuts be the more complex combinations (to make it harder to do a global mess).
Still happens in 3.0.3. I also agree with @eon-s who formulated it better than my earlier issue about the save shortcut.
It has been a long lasting one. See also:
People are confused by both not being able to save a script with no scene opened, and the fact that Ctrl+S is not contextual.
I have found even more "usability problems" with this. If I'm editing a script embedded in a scene, a shortcut to "Save script" opens a dialog for saving this script in a separate file. What's more, the extensions are different:
I understand that this might be "technically correct" at least from some standpoint. But I would have expected the "Save" command to save my script _where it currently is_, and "Save As" to open a dialog. This may be confusing, especially if you don't remember where this script is stored, especially for the new users.
By the way, I remap Ctrl+S to act as both "Save scene" and "Save script", too. And I agree that it really should save what you're currently editing. Unless you are editing a script that's embedded in a scene - then it should understand this and save the scene instead. (Or maybe save the script into the scene, but don't save any other changes in that scene, for consistent behavior?..)
Shouldn't the tabs switch to being scripts instead of scenes when using the script editor?
EDIT: This would alleviate problems with ctrl-tab switching, saving, and so one. Atm, being able to select scenes while editing a script only switches the last used script with that scene, which both makes sense and is kind of confusing. (Since all recenlty open scripts are all open anyway)
Most helpful comment
I think context based shortcuts (current focused scene/script/resource) should be the shorter ones and global shortcuts be the more complex combinations (to make it harder to do a global mess).