mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Merge pull request #88636 from ajreckof/Keep-the-type-of-the-last-added-item
Dictionary Editor: Keep the type of the last added item.
This commit is contained in:
commit
b82bd22592
@ -780,9 +780,19 @@ void EditorPropertyDictionary::_add_key_value() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Dictionary dict = object->get_dict().duplicate();
|
Dictionary dict = object->get_dict().duplicate();
|
||||||
dict[object->get_new_item_key()] = object->get_new_item_value();
|
Variant new_key = object->get_new_item_key();
|
||||||
object->set_new_item_key(Variant());
|
Variant new_value = object->get_new_item_value();
|
||||||
object->set_new_item_value(Variant());
|
dict[new_key] = new_value;
|
||||||
|
|
||||||
|
Variant::Type type = new_key.get_type();
|
||||||
|
new_key.zero();
|
||||||
|
VariantInternal::initialize(&new_key, type);
|
||||||
|
object->set_new_item_key(new_key);
|
||||||
|
|
||||||
|
type = new_value.get_type();
|
||||||
|
new_value.zero();
|
||||||
|
VariantInternal::initialize(&new_value, type);
|
||||||
|
object->set_new_item_value(new_value);
|
||||||
|
|
||||||
emit_changed(get_edited_property(), dict, "", false);
|
emit_changed(get_edited_property(), dict, "", false);
|
||||||
update_property();
|
update_property();
|
||||||
|
Loading…
Reference in New Issue
Block a user