You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be worked around (sort of): Edit: I partially take that back. It's dangerous to do it this way. The content of the script editor is replaced, and if, for whatever reason, the wrong script is open in the editor, the wrong content is displayed.
And setting the text_editor/behavior/files/auto_reload_scripts_on_external_change setting to true, to prevent the "newer on disk" popup from appearing.
I imagine code generation plugins are not a total exotic thing. A bit of research reveals that:
Searching for "Godot plugin reload scripts" leads people to this Q&A post (Godot version 3.4.4) pointing to _reload_scripts.
There is one other plugin on GitHub currently using .reload_scripts().
I think using the above script as a workaround is fine, but because it is not a full replacement, I would love to see the reload_scripts() method being exposed again or something to hide the "newer on disk" popup. This is because the mentioned setting will hide the popup for all external code changes, and the user will have to set the setting.
Is there a reason why this should be core and not an add-on in the asset library?
There seems to be no way to hide the "newer on disk" popup via script, so it cannot be achieved through an add-on.
The text was updated successfully, but these errors were encountered:
Expose the reload_scripts method to match the current state of the 3.x branch.
Bind it as `reload_open_files` in contrast to `reload_scripts` in 3.x to more accurately reflect its function.
closesgodotengine/godot-proposals#8111
clarifies the description of the method's internals
Co-authored-by: Chris Cranford <[email protected]>
Describe the project you are working on
I'm working on a plugin that assists with mod development. Part of that involves generating code that is added to a specific script file.
Describe the problem or limitation you are having in your project
After porting from 3.5 to 4.1.2, I am missing the
ScriptEditor.reload_scripts()
method, which we used to reload the script editor after adding code.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Expose the
ScriptEditor.reload_scripts()
method again, to match the state of 3.5Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
EditorInterface.get_script_editor().reload_scripts()
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be worked around (sort of):
Edit: I partially take that back. It's dangerous to do it this way. The content of the script editor is replaced, and if, for whatever reason, the wrong script is open in the editor, the wrong content is displayed.
And setting the
text_editor/behavior/files/auto_reload_scripts_on_external_change
setting totrue
, to prevent the "newer on disk" popup from appearing.I imagine code generation plugins are not a total exotic thing. A bit of research reveals that:
_reload_scripts
..reload_scripts()
.I think using the above script as a workaround is fine, but because it is not a full replacement, I would love to see the
reload_scripts()
method being exposed again or something to hide the "newer on disk" popup. This is because the mentioned setting will hide the popup for all external code changes, and the user will have to set the setting.Is there a reason why this should be core and not an add-on in the asset library?
There seems to be no way to hide the "newer on disk" popup via script, so it cannot be achieved through an add-on.
The text was updated successfully, but these errors were encountered: