diff options
author | Nông Văn Tình <vannongtinh@gmail.com> | 2023-11-01 12:49:51 +0700 |
---|---|---|
committer | Nông Văn Tình <vannongtinh@gmail.com> | 2024-01-26 21:05:36 +0700 |
commit | c051c44df999f48bacea4cac9237c418e4d31d09 (patch) | |
tree | 41215ff42bcd465c09d37bbd5917be5912b5b1c8 /editor/editor_node.cpp | |
parent | 9144457484f9d2f53990a0aac37caff1c9012e6d (diff) | |
download | redot-engine-c051c44df999f48bacea4cac9237c418e4d31d09.tar.gz |
Allow Editor to reload external changes of scripts
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f73eb81473..4ed4856705 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -872,7 +872,11 @@ void EditorNode::_resources_changed(const Vector<String> &p_resources) { } if (!res->editor_can_reload_from_file()) { - continue; + Ref<Script> scr = res; + // Scripts are reloaded via the script editor. + if (scr.is_null() || ScriptEditor::get_singleton()->get_open_scripts().has(scr)) { + continue; + } } if (!res->get_path().is_resource_file() && !res->get_path().is_absolute_path()) { continue; |