Make resource editor fallback to Object icon if none is found

This commit is contained in:
Michael Alexsander 2019-10-14 15:54:59 -03:00
parent 1fed266bf5
commit 22b9510558
1 changed files with 4 additions and 12 deletions

View File

@ -2399,19 +2399,11 @@ void EditorPropertyResource::_update_menu_items() {
inheritors_array.push_back(t); inheritors_array.push_back(t);
if (!icon.is_valid())
icon = get_icon(has_icon(t, "EditorIcons") ? t : "Object", "EditorIcons");
int id = TYPE_BASE_ID + idx; int id = TYPE_BASE_ID + idx;
menu->add_icon_item(icon, vformat(TTR("New %s"), t), id);
if (!icon.is_valid() && has_icon(t, "EditorIcons")) {
icon = get_icon(t, "EditorIcons");
}
if (icon.is_valid()) {
menu->add_icon_item(icon, vformat(TTR("New %s"), t), id);
} else {
menu->add_item(vformat(TTR("New %s"), t), id);
}
idx++; idx++;
} }