summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFireForge <67974470+fire-forge@users.noreply.github.com>2022-07-13 12:07:01 -0500
committerFireForge <67974470+fire-forge@users.noreply.github.com>2022-07-13 12:07:01 -0500
commit0df23111b3596c17e1116df702245aac6269e807 (patch)
tree78b75463241cd4844226d7f824c0fd0708dbc745
parent98d5b37a4cf3c5dd008022752514109ff621d268 (diff)
Show Resource type name in Array editor
Follow-up to #60409 Example: @export var gradient_array: Array[Gradient] Before: Array[Object] After: Array[Gradient]
-rw-r--r--editor/editor_properties_array_dict.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index f1a3fe0c57..0b9004bbc4 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) {