From e4cf4fcb2f272f27742ea47c758feb60591a55a0 Mon Sep 17 00:00:00 2001 From: SaNeOr Date: Wed, 25 Sep 2024 02:33:41 +0800 Subject: [PATCH] fix GDExtension classes inheriting from Resource are not using icons in FileSystem --- editor/editor_file_system.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index b1b64b5d606..fc9e9e0f4f3 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1872,6 +1872,10 @@ void EditorFileSystem::_update_file_icon_path(EditorFileSystemDirectory::FileInf } } + if (icon_path.is_empty() && !file_info->type.is_empty()) { + icon_path = EditorNode::get_singleton()->get_class_icon(file_info->type)->get_path(); + } + file_info->icon_path = icon_path; } @@ -2191,7 +2195,7 @@ void EditorFileSystem::update_files(const Vector &p_script_paths) { _queue_update_scene_groups(file); } - if (fs->files[cpos]->type == SNAME("Resource")) { + if (ClassDB::is_parent_class(fs->files[cpos]->type, SNAME("Resource"))) { files_to_update_icon_path.push_back(fs->files[cpos]); } else if (old_script_class_icon_path != fs->files[cpos]->script_class_icon_path) { update_files_icon_cache = true;