Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling the Godot script editor does not automatically disable the loading of dominant scripts on scene change. #91659

Open
PowerfulBacon opened this issue May 7, 2024 · 4 comments

Comments

@PowerfulBacon
Copy link

PowerfulBacon commented May 7, 2024

Tested versions

  • Tested and reproducible in v4.2.1.stable.mono.official

System information

Godot v4.2.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 3GB (NVIDIA; 31.0.15.3623) - Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (4 Threads)

Issue description

When disabling the godot engine's script editor through Editor > Manage Editor Features, the editor continues to open up files automatically. This is particularly annoying if you are working with an external IDE, as you will continue to get popups from script files asking if they should reload.

When switching between scenes, the script editor will randomly open code files. This is annoying in of itself, but when the script editor is disabled this makes it impossible to go and close those scripts.

I should note that this only appears to happen if the script is in the root node of a scene, but it is incredibly annoying and is driving me nuts.

Steps to reproduce

  • Create a script file
  • Create 2 scenes
  • Add the new script to the root of the first scene.
  • Close the script in the script editor if it is open.
  • Switch between different scene tabs and the file will re-open itself.
  • Close the file in the script editor
  • Go to editor > manage editor features
  • Disable the script editor
  • Switch between scenes
  • Edit the script in an external editor
  • A popup will appear asking what action you would like to take.

Workaround

Disable open_dominant_script_on_scene_change
OR
Enable use_external_editor

These will completely fix the issue, however I am leaving this issue open since if the script editor is disabled then all functionality of the script editor should be disabled regardless of if you have the setting to open dominant scripts or not. If you have disabled the script editor, then you would never want the Godot script editor to open up files in the background as you can never close them again.

Minimal reproduction project (MRP)

Reproduction.zip

@PowerfulBacon PowerfulBacon changed the title Disabling godot script editor as an engine feature doesn't disable it from opening files automatically. Scripts automatically open when switching between scenes, causing unnecessary popups when working with external IDEs May 7, 2024
@AThousandShips
Copy link
Member

Do you have distraction free mode active? If so this would be a duplicate of:

And should be fixed in 4.3 by:

@PowerfulBacon
Copy link
Author

Do you have distraction free mode active?

No, this happens with distraction free mode is enabled or disabled. This happens because when you switch to another scene, if the root node has a script attached to it then it will automatically open in the script editor. This is really annoying if you are using an external IDE for editing scripts as it will constantly ask you if you want to reload or overwrite the changes, and causes loss of data ocassionally even if you reload.

@kitbdev
Copy link
Contributor

kitbdev commented May 8, 2024

Can reproduce in Godot v4.2.1.stable and master v4.3.dev.custom_build [2042420] - Windows 10.0.22631
I don't think #90654 is related.

It looks like the Script Editor opens it and keeps working even if it is disabled.

What external editor are you using?
I can only get it to happen with certain ones like notepad but not VSCode.

Try turning off this Editor Setting that opens the root node's script: text_editor/behavior/files/open_dominant_script_on_scene_change

Also, there is an external editor setting that doesn't have this issue: text_editor/external/use_external_editor
But this requires the Script Editor EditorFeature to be enabled to work.

@PowerfulBacon
Copy link
Author

PowerfulBacon commented May 10, 2024

With open_dominant_script_on_scene_change disabled, the issue no longer happens as scripts are not opened in the background anymore.

I am using visual studio 2022, however I believe this will work with all editors since the message pops up whenever the file is edited while it is open in the Godot script editor. The issue is that even if the script editor is disabled, it will continue to open up the dominant script on scene change and while files are open in Godot's script editor, the file change message will continue to appear when you modify those files.

If you disable the script editor, then all functionality of the script editor should be disabled, including the checking for files being changed in an external editor (of course, you would always want to reload since those files shouldn't be open in Godot at all if you disable script editing functionality).

@PowerfulBacon PowerfulBacon changed the title Scripts automatically open when switching between scenes, causing unnecessary popups when working with external IDEs Disabling the Godot script editor does not automatically disable the loading of dominant scripts on scene change. May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants