summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-04 21:23:12 +0200
committerGitHub <noreply@github.com>2019-09-04 21:23:12 +0200
commite205cbbd06deb02eff579469fa420ac25dc0688f (patch)
treedac99ff238523aa433ae130dde3912d326f5e327
parentc8e92b802c16f8f9d120bf01bc5923c702a3c3ff (diff)
parentad499f234fbbf00c27a842729c0b832bc216a168 (diff)
Merge pull request #31967 from nekomatata/fix-builtin-script-scene
Load scene if needed when editing recent built-in script
-rw-r--r--editor/plugins/script_editor_plugin.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 413843d536..8b6bab374c 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -538,6 +538,10 @@ void ScriptEditor::_open_recent_script(int p_idx) {
// if it's a path then it's most likely a deleted file not help
} else if (path.find("::") != -1) {
// built-in script
+ String scene_path = path.get_slice("::", 0);
+ if (!EditorNode::get_singleton()->is_scene_open(scene_path)) {
+ EditorNode::get_singleton()->load_scene(scene_path);
+ }
Ref<Script> script = ResourceLoader::load(path);
if (script.is_valid()) {
edit(script, true);