From a20934c8e40e258e8372cbb2b7c689cc315b7e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Tue, 28 Jan 2025 10:27:56 +0100 Subject: [PATCH] Optimize enumeration of global classes in create dialog and autocomplete --- editor/connections_dialog.cpp | 2 +- editor/create_dialog.cpp | 15 +++---- editor/editor_data.cpp | 84 +++++++++++++++++------------------ editor/editor_data.h | 7 ++- editor/editor_node.cpp | 27 +++++------ editor/editor_node.h | 2 +- 6 files changed, 67 insertions(+), 70 deletions(-) diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 429467d3403..dca43411e10 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -1446,7 +1446,7 @@ void ConnectionsDock::update_tree() { doc_class_name = String(); } - class_icon = editor_data.get_script_icon(script_base); + class_icon = editor_data.get_script_icon(script_base->get_path()); if (class_icon.is_null() && has_theme_icon(native_base, EditorStringName(EditorIcons))) { class_icon = get_editor_theme_icon(native_base); } diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index f0b2ed6e469..5eebb1c492e 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -257,14 +257,9 @@ void CreateDialog::_add_type(const StringName &p_type, TypeCategory p_type_categ inherits = ClassDB::get_parent_class(p_type); inherited_type = TypeCategory::CPP_TYPE; } else { - if (p_type_category == TypeCategory::PATH_TYPE || ScriptServer::is_global_class(p_type)) { - Ref