From fd8eb47ee52b05d516bbf98f5ecdb874ba1e666e Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 24 Nov 2021 13:05:18 +0100 Subject: [PATCH] Show scene when showing built-in script file (cherry picked from commit 512e260af485aae5bdabfbaca11d9997c040fa00) --- editor/plugins/script_editor_plugin.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 4dd87b6fc01..8b15f728489 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1173,8 +1173,12 @@ void ScriptEditor::_menu_option(int p_option) { } break; case SHOW_IN_FILE_SYSTEM: { const RES script = current->get_edited_resource(); - const String path = script->get_path(); + String path = script->get_path(); if (!path.empty()) { + if (path.find("::") != -1) { // Built-in. + path = path.get_slice("::", 0); // Show the scene instead. + } + FileSystemDock *file_system_dock = EditorNode::get_singleton()->get_filesystem_dock(); file_system_dock->navigate_to_path(path); // Ensure that the FileSystem dock is visible.