summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-01-15 13:22:43 +0100
committerGitHub <noreply@github.com>2019-01-15 13:22:43 +0100
commitfadaeb06c0286c777adccc372730d8790c159cde (patch)
treefc6c52e71b96a824a657fcf70331d285c9893455
parent96899b7ee1cb442ce9625232d558670fe7011c2c (diff)
parentf9788f75e59b9e7d9d056faaa13f399736830381 (diff)
Merge pull request #24909 from xDGameStudios/array_static_types
Disallow changing array element types, when using hint (inspector fix)
-rw-r--r--editor/editor_properties_array_dict.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index dd802bc72e..20cb6ab534 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -360,10 +360,14 @@ void EditorPropertyArray::update_property() {
vbox->add_child(hb);
hb->add_child(prop);
prop->set_h_size_flags(SIZE_EXPAND_FILL);
- Button *edit = memnew(Button);
- edit->set_icon(get_icon("Edit", "EditorIcons"));
- hb->add_child(edit);
- edit->connect("pressed", this, "_change_type", varray(edit, i + offset));
+
+ if (subtype == Variant::NIL) {
+ Button *edit = memnew(Button);
+ edit->set_icon(get_icon("Edit", "EditorIcons"));
+ hb->add_child(edit);
+ edit->connect("pressed", this, "_change_type", varray(edit, i + offset));
+ }
+
} else {
vbox->add_child(prop);
}