Show Resource type name in Array editor

Follow-up to #60409

Example: @export var gradient_array: Array[Gradient]
Before: Array[Object]
After: Array[Gradient]
This commit is contained in:
FireForge 2022-07-13 12:07:01 -05:00
parent 98d5b37a4c
commit 0df23111b3

View File

@ -211,7 +211,14 @@ void EditorPropertyArray::update_property() {
String array_type_name = Variant::get_type_name(array_type);
if (array_type == Variant::ARRAY && subtype != Variant::NIL) {
array_type_name = vformat("%s[%s]", array_type_name, Variant::get_type_name(subtype));
String type_name;
if (subtype == Variant::OBJECT && subtype_hint == PROPERTY_HINT_RESOURCE_TYPE) {
type_name = subtype_hint_string;
} else {
type_name = Variant::get_type_name(subtype);
}
array_type_name = vformat("%s[%s]", array_type_name, type_name);
}
if (array.get_type() == Variant::NIL) {