From c25a2d832b3d706f6a1ba6cd5135c8213afe172d Mon Sep 17 00:00:00 2001 From: Omar Shehata Date: Sat, 7 Oct 2023 22:14:54 -0400 Subject: [PATCH] Fix external editor hot reload --- editor/plugins/script_editor_plugin.cpp | 4 ++-- editor/plugins/script_editor_plugin.h | 3 ++- editor/plugins/script_text_editor.cpp | 2 +- modules/gdscript/language_server/gdscript_text_document.cpp | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index c540004d3fc1..ec927f6c5d4b 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -987,7 +987,7 @@ void ScriptEditor::_res_saved_callback(const Ref &p_res) { } _update_script_names(); - _trigger_live_script_reload(); + trigger_live_script_reload(); } void ScriptEditor::_scene_saved_callback(const String &p_path) { @@ -1015,7 +1015,7 @@ void ScriptEditor::_scene_saved_callback(const String &p_path) { } } -void ScriptEditor::_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 0241ca0e3ef5..cf071d182b6e 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -378,7 +378,6 @@ 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(); @@ -538,6 +537,8 @@ public: void clear_docs_from_script(const Ref