diff options
author | kobewi <kobewi4e@gmail.com> | 2022-03-25 18:06:46 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-08-22 18:05:10 +0200 |
commit | ece3df39386af85b069cbb67ae1893b4365f1bd3 (patch) | |
tree | 6d815d51c6e043470a08ad1eab993e4b288da8c9 /editor/array_property_edit.cpp | |
parent | 99548e521dc049b609347cd1fe38262d59d1b0d6 (diff) | |
download | redot-engine-ece3df39386af85b069cbb67ae1893b4365f1bd3.tar.gz |
Add per-scene UndoRedo
Diffstat (limited to 'editor/array_property_edit.cpp')
-rw-r--r-- | editor/array_property_edit.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp index 58527ee4d1..ab0e801c88 100644 --- a/editor/array_property_edit.cpp +++ b/editor/array_property_edit.cpp @@ -32,6 +32,7 @@ #include "core/io/marshalls.h" #include "editor/editor_node.h" +#include "editor/editor_undo_redo_manager.h" #define ITEMS_PER_PAGE 100 @@ -87,7 +88,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { return true; } - UndoRedo *ur = EditorNode::get_undo_redo(); + Ref<EditorUndoRedoManager> &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); @@ -134,7 +135,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { Callable::CallError ce; Variant new_value; Variant::construct(Variant::Type(type), new_value, nullptr, 0, ce); - UndoRedo *ur = EditorNode::get_undo_redo(); + Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo(); ur->create_action(TTR("Change Array Value Type")); ur->add_do_method(this, "_set_value", idx, new_value); @@ -150,7 +151,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_undo_redo(); + Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo(); ur->create_action(TTR("Change Array Value")); ur->add_do_method(this, "_set_value", idx, p_value); |