From 0df23111b3596c17e1116df702245aac6269e807 Mon Sep 17 00:00:00 2001 From: FireForge <67974470+fire-forge@users.noreply.github.com> Date: Wed, 13 Jul 2022 12:07:01 -0500 Subject: [PATCH] Show Resource type name in Array editor Follow-up to #60409 Example: @export var gradient_array: Array[Gradient] Before: Array[Object] After: Array[Gradient] --- editor/editor_properties_array_dict.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index f1a3fe0c57e..0b9004bbc4e 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -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) {