diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-21 15:24:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-21 15:24:04 +0200 |
commit | 8fc423034b84d5200bbfb3ddf4658ae20b3d49fb (patch) | |
tree | c92653b49bef203b76236b78eb514bc8abb2b244 /editor/editor_properties.cpp | |
parent | 6f18c3c6cf7cffc1a9b98c7cffd334b7c5c5ab67 (diff) | |
parent | 22b951055866236d9f73e2e6a97bdaa38aab64ee (diff) |
Merge pull request #32836 from YeldhamDev/resource_editor_icon_fallback
Make resource editor fallback to Object icon if none is found
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r-- | editor/editor_properties.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index e978713c34..9ec9df2ee9 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2399,19 +2399,11 @@ void EditorPropertyResource::_update_menu_items() { inheritors_array.push_back(t); - int id = TYPE_BASE_ID + idx; - - if (!icon.is_valid() && has_icon(t, "EditorIcons")) { - icon = get_icon(t, "EditorIcons"); - } - - if (icon.is_valid()) { + if (!icon.is_valid()) + icon = get_icon(has_icon(t, "EditorIcons") ? t : "Object", "EditorIcons"); - menu->add_icon_item(icon, vformat(TTR("New %s"), t), id); - } else { - - menu->add_item(vformat(TTR("New %s"), t), id); - } + int id = TYPE_BASE_ID + idx; + menu->add_icon_item(icon, vformat(TTR("New %s"), t), id); idx++; } |