From cc5a736c0b92eb66d754d4a423921129e78524cb Mon Sep 17 00:00:00 2001 From: willnationsdev Date: Sat, 25 Jun 2022 19:07:01 -0500 Subject: Enable QuickOpen to see scripted resources. --- editor/editor_quick_open.cpp | 21 +++++++++++++++++---- editor/editor_quick_open.h | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/editor/editor_quick_open.cpp b/editor/editor_quick_open.cpp index 539cb7cd8a..b4ec3bca15 100644 --- a/editor/editor_quick_open.cpp +++ b/editor/editor_quick_open.cpp @@ -31,6 +31,7 @@ #include "editor_quick_open.h" #include "core/os/keyboard.h" +#include "editor/editor_node.h" void EditorQuickOpen::popup_dialog(const StringName &p_base, bool p_enable_multi, bool p_dontclear) { base_type = p_base; @@ -57,17 +58,29 @@ void EditorQuickOpen::_build_search_cache(EditorFileSystemDirectory *p_efsd) { Vector base_types = String(base_type).split(String(",")); for (int i = 0; i < p_efsd->get_file_count(); i++) { - String file_type = p_efsd->get_file_type(i); + String file = p_efsd->get_file_path(i); + String engine_type = p_efsd->get_file_type(i); + // TODO: Fix lack of caching for resource's script's global class name (if applicable). + String script_type; + if (_load_resources) { + Ref res = ResourceLoader::load(file); + if (res.is_valid()) { + Ref