-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Auto-reload scripts with external editor #51729
Conversation
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.
NOTIFICATION_WM_WINDOW_FOCUS_IN
not triggering is a bug see also #47176. Not sure it's worth adding workarounds for it.
@@ -668,6 +668,10 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo | |||
script->update_exports(); | |||
} | |||
} | |||
|
|||
if (auto_reload_running_scripts) { | |||
_live_auto_reload_running_scripts(); |
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.
Should only call this if a script has been reloaded and pending_auto_reload == false
af78e0a
to
d5e4004
Compare
@Paulb23 I tried to address the issue you mentioned. Unfortunately I'm not good at naming, so please feel free to suggest another name :) |
Looks good. No worries :) as far as naming goes perhaps |
d5e4004
to
c5c4a23
Compare
c5c4a23
to
1c61245
Compare
Thanks for your suggestion, I changed the name. |
Thanks! |
Very pleased to see this fixed!
Do I understand that this separate patch is needed to fix the error messages? Will this also get applied? Those errors are annoying and distracting. |
@rversteegen The error message problem was already fixed on master branch, and I fixed the error message issue while back-porting this patch to 3.x branch, which is already merged. See also: #51828 |
The PR allows auto-reload with external editors.
_live_auto_reload_running_scripts
when appropriates.NOTIFICATION_APPLICATION_FOCUS_IN
events to trigger reload asNOTIFICATION_WM_WINDOW_FOCUS_IN
is never called onmaster
branch. I'm not sure why, probably a bug?Here's another patch for
3.x
branch. It also fixes error messages when script changed on external editor. (Another resource is loaded from path
thing). I could create another PR if you prefer: https://gist.github.com/yjh0502/e2cb62f9216c953c8e54541199d7be09related: #10946
Bugsquad edit: Fix #10946