summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNông Văn Tình <vannongtinh@gmail.com>2023-11-01 12:49:51 +0700
committerNông Văn Tình <vannongtinh@gmail.com>2024-01-26 21:05:36 +0700
commitc051c44df999f48bacea4cac9237c418e4d31d09 (patch)
tree41215ff42bcd465c09d37bbd5917be5912b5b1c8
parent9144457484f9d2f53990a0aac37caff1c9012e6d (diff)
downloadredot-engine-c051c44df999f48bacea4cac9237c418e4d31d09.tar.gz
Allow Editor to reload external changes of scripts
-rw-r--r--editor/editor_node.cpp6
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;