diff options
author | Michael Alexsander <michaelalexsander@protonmail.com> | 2019-10-14 15:54:59 -0300 |
---|---|---|
committer | Michael Alexsander <michaelalexsander@protonmail.com> | 2019-10-14 16:36:00 -0300 |
commit | 22b951055866236d9f73e2e6a97bdaa38aab64ee (patch) | |
tree | 89ce078659f2826a77ba876d94819c592f8ddaf6 /editor/editor_properties.cpp | |
parent | 1fed266bf5452b30376db62495f4985f6975f2c1 (diff) |
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++; } |