diff options
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.h | 1 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 226a54b966..bd90fa82f2 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -942,7 +942,10 @@ void ScriptEditor::_res_saved_callback(const Ref<Resource> &p_res) { } _update_script_names(); + _trigger_live_script_reload(); +} +void ScriptEditor::_trigger_live_script_reload() { if (!pending_auto_reload && auto_reload_running_scripts) { call_deferred(SNAME("_live_auto_reload_running_scripts")); pending_auto_reload = true; diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 72a649ffbf..e322828b6c 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -344,6 +344,7 @@ class ScriptEditor : public PanelContainer { bool pending_auto_reload; bool auto_reload_running_scripts; + void _trigger_live_script_reload(); void _live_auto_reload_running_scripts(); void _update_selected_editor_menu(); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 4491c13b4c..d3f07ab39a 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -666,6 +666,8 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo script->set_source_code(rel_script->get_source_code()); script->set_last_modified_time(rel_script->get_last_modified_time()); script->update_exports(); + + _trigger_live_script_reload(); } } } |