Fix error when editing multifield values inside arrays and dictionaries

This commit is contained in:
Michael Alexsander 2025-10-13 13:29:32 -03:00
parent 4219ce91f2
commit 31efc7eefa
No known key found for this signature in database
GPG key ID: A9C91EE110F4EABA
2 changed files with 14 additions and 2 deletions

View file

@ -96,8 +96,14 @@ void EditorDebuggerRemoteObjects::_get_property_list(List<PropertyInfo> *p_list)
}
void EditorDebuggerRemoteObjects::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) {
// Ignore the field with arrays and dictionaries, as they are passed whole when edited.
Variant::Type type = p_value.get_type();
if (type == Variant::ARRAY || type == Variant::DICTIONARY) {
_set_impl(p_property, p_value, "");
} else {
_set_impl(p_property, p_value, p_field);
}
}
String EditorDebuggerRemoteObjects::get_title() {
if (!remote_object_ids.is_empty() && ObjectID(remote_object_ids[0].operator uint64_t()).is_valid()) {

View file

@ -310,8 +310,14 @@ StringName MultiNodeEdit::get_edited_class_name() const {
}
void MultiNodeEdit::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) {
// Ignore the field with arrays and dictionaries, as they are passed whole when edited.
Variant::Type type = p_value.get_type();
if (type == Variant::ARRAY || type == Variant::DICTIONARY) {
_set_impl(p_property, p_value, "");
} else {
_set_impl(p_property, p_value, p_field);
}
}
void MultiNodeEdit::_bind_methods() {
ClassDB::bind_method("_hide_script_from_inspector", &MultiNodeEdit::_hide_script_from_inspector);