-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Fix how scripts reload outside of ScriptEditor #89261
Fix how scripts reload outside of ScriptEditor #89261
Conversation
5d9d291
to
9200277
Compare
CC @nongvantinh |
Hi @paulloz, When godot/core/object/script_language.h Line 114 in 0ace0a1
However, If the file is edited outside the editor and we don't use the internal editor, there's no way to get the latest changes. Consequently, whenever we use data of that file from This problem stems from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't reproduce the issue with GDScript, but the code looks fine.
9200277
to
6367464
Compare
…ide-script-editor Fix how scripts reload outside of ScriptEditor
06abc86
Thanks! |
#82113 made script being reloaded from outside
ScriptEditor
. The currentResource::reload_from_file()
implementation indirectly callsObject::set_edited(true)
on the script resource, so any script reloaded that way ends up being overwritten by the engine when a scene they are in is saved.This is simply making sure we apply the same logic in
Script::reload_from_file()
as inScriptEditor::reload_scripts()
. Although, it feels quite weird that we purposefully call that method whenScript::editor_can_reload_from_file()
returnsfalse
.