From 140f9dc3e76c0f99f9d921042ab9362f609429ea Mon Sep 17 00:00:00 2001 From: Ian McCleary Date: Sat, 27 Jul 2024 18:58:12 -0500 Subject: [PATCH] Fix custom resources using incorrect icons --- editor/editor_file_system.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index e776291b2d3..1f3225a28e3 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1779,7 +1779,9 @@ String EditorFileSystem::_get_global_script_class(const String &p_type, const St void EditorFileSystem::_update_file_icon_path(EditorFileSystemDirectory::FileInfo *file_info) { String icon_path; - if (file_info->script_class_icon_path.is_empty() && !file_info->deps.is_empty()) { + if (file_info->resource_script_class != StringName()) { + icon_path = EditorNode::get_editor_data().script_class_get_icon_path(file_info->resource_script_class); + } else if (file_info->script_class_icon_path.is_empty() && !file_info->deps.is_empty()) { const String &script_dep = file_info->deps[0]; // Assuming the first dependency is a script. const String &script_path = script_dep.contains("::") ? script_dep.get_slice("::", 2) : script_dep; if (!script_path.is_empty()) {