Merge pull request #32836 from YeldhamDev/resource_editor_icon_fallback

Make resource editor fallback to Object icon if none is found
This commit is contained in:
Rémi Verschelde 2019-10-21 15:24:04 +02:00 committed by GitHub
commit 8fc423034b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2399,19 +2399,11 @@ void EditorPropertyResource::_update_menu_items() {
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;
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++;
}