diff options
Diffstat (limited to 'editor/array_property_edit.cpp')
-rw-r--r-- | editor/array_property_edit.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp index 7a3edfde50..f2471e80d4 100644 --- a/editor/array_property_edit.cpp +++ b/editor/array_property_edit.cpp @@ -93,7 +93,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { if (newsize == size) return true; - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); + UndoRedo *ur = EditorNode::get_undo_redo(); ur->create_action(TTR("Resize Array")); ur->add_do_method(this, "_set_size", newsize); ur->add_undo_method(this, "_set_size", size); @@ -141,7 +141,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { if (value.get_type() != type && type >= 0 && type < Variant::VARIANT_MAX) { Variant::CallError ce; Variant new_value = Variant::construct(Variant::Type(type), NULL, 0, ce); - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); + UndoRedo *ur = EditorNode::get_undo_redo(); ur->create_action(TTR("Change Array Value Type")); ur->add_do_method(this, "_set_value", idx, new_value); @@ -157,7 +157,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { Variant arr = get_array(); Variant value = arr.get(idx); - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); + UndoRedo *ur = EditorNode::get_undo_redo(); ur->create_action(TTR("Change Array Value")); ur->add_do_method(this, "_set_value", idx, p_value); @@ -288,12 +288,17 @@ Node *ArrayPropertyEdit::get_node() { return Object::cast_to<Node>(ObjectDB::get_instance(obj)); } +bool ArrayPropertyEdit::_dont_undo_redo() { + return true; +} + void ArrayPropertyEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_size"), &ArrayPropertyEdit::_set_size); ClassDB::bind_method(D_METHOD("_set_value"), &ArrayPropertyEdit::_set_value); ClassDB::bind_method(D_METHOD("_notif_change"), &ArrayPropertyEdit::_notif_change); ClassDB::bind_method(D_METHOD("_notif_changev"), &ArrayPropertyEdit::_notif_changev); + ClassDB::bind_method(D_METHOD("_dont_undo_redo"), &ArrayPropertyEdit::_dont_undo_redo); } ArrayPropertyEdit::ArrayPropertyEdit() { |