From ae6410b6224b9c14702f7d9166acab20841ce28c Mon Sep 17 00:00:00 2001 From: Per Melin Date: Mon, 18 Mar 2024 12:58:05 +0100 Subject: [PATCH] Resource file not found error when loading Favorite icon --- editor/filesystem_dock.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 0f83e109fa9b..e7de037bfa32 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -453,7 +453,7 @@ void FileSystemDock::_update_tree(const Vector &p_uncollapsed_paths, boo int index; EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->find_file(favorite, &index); if (dir) { - icon = _get_tree_item_icon(dir->get_file_import_is_valid(index), dir->get_file_path(index), dir->get_file_type(index)); + icon = _get_tree_item_icon(dir->get_file_import_is_valid(index), dir->get_file_type(index), _get_entry_script_icon(dir, index)); } else { icon = get_editor_theme_icon(SNAME("File")); } @@ -1009,6 +1009,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { fi.path = favorite; if (efd) { fi.type = efd->get_file_type(index); + fi.icon_path = _get_entry_script_icon(efd, index); fi.import_broken = !efd->get_file_import_is_valid(index); fi.modified_time = efd->get_file_modified_time(index); } else { @@ -1101,6 +1102,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { fi.name = efd->get_file(i); fi.path = directory.path_join(fi.name); fi.type = efd->get_file_type(i); + fi.icon_path = _get_entry_script_icon(efd, i); fi.import_broken = !efd->get_file_import_is_valid(i); fi.modified_time = efd->get_file_modified_time(i); @@ -1118,7 +1120,6 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { FileInfo *finfo = &(E); String fname = finfo->name; String fpath = finfo->path; - String ftype = finfo->type; Ref type_icon; Ref big_icon; @@ -1126,11 +1127,10 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { String tooltip = fpath; // Select the icons. + type_icon = _get_tree_item_icon(!finfo->import_broken, finfo->type, finfo->icon_path); if (!finfo->import_broken) { - type_icon = (has_theme_icon(ftype, EditorStringName(EditorIcons))) ? get_editor_theme_icon(ftype) : get_editor_theme_icon(SNAME("Object")); big_icon = file_thumbnail; } else { - type_icon = get_editor_theme_icon(SNAME("ImportFail")); big_icon = file_thumbnail_broken; tooltip += "\n" + TTR("Status: Import of file failed. Please fix file and reimport manually."); }