From 1f52782bbb417e559be9317cd56acb37b6d15a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Tue, 27 Oct 2020 01:44:30 +0100 Subject: Extend UndoRedo handling of Resource to every Reference --- core/object/undo_redo.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'core/object/undo_redo.cpp') diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp index 1dcbb0cd6b..c5b66cda8c 100644 --- a/core/object/undo_redo.cpp +++ b/core/object/undo_redo.cpp @@ -31,6 +31,7 @@ #include "undo_redo.h" #include "core/os/os.h" +#include "core/resource.h" void UndoRedo::_discard_redo() { if (current_action == actions.size() - 1) { @@ -104,8 +105,8 @@ void UndoRedo::add_do_method(Object *p_object, const StringName &p_method, VARIA ERR_FAIL_COND((current_action + 1) >= actions.size()); Operation do_op; do_op.object = p_object->get_instance_id(); - if (Object::cast_to(p_object)) { - do_op.resref = Ref(Object::cast_to(p_object)); + if (Object::cast_to(p_object)) { + do_op.ref = Ref(Object::cast_to(p_object)); } do_op.type = Operation::TYPE_METHOD; @@ -130,8 +131,8 @@ void UndoRedo::add_undo_method(Object *p_object, const StringName &p_method, VAR Operation undo_op; undo_op.object = p_object->get_instance_id(); - if (Object::cast_to(p_object)) { - undo_op.resref = Ref(Object::cast_to(p_object)); + if (Object::cast_to(p_object)) { + undo_op.ref = Ref(Object::cast_to(p_object)); } undo_op.type = Operation::TYPE_METHOD; @@ -149,8 +150,8 @@ void UndoRedo::add_do_property(Object *p_object, const StringName &p_property, c ERR_FAIL_COND((current_action + 1) >= actions.size()); Operation do_op; do_op.object = p_object->get_instance_id(); - if (Object::cast_to(p_object)) { - do_op.resref = Ref(Object::cast_to(p_object)); + if (Object::cast_to(p_object)) { + do_op.ref = Ref(Object::cast_to(p_object)); } do_op.type = Operation::TYPE_PROPERTY; @@ -171,8 +172,8 @@ void UndoRedo::add_undo_property(Object *p_object, const StringName &p_property, Operation undo_op; undo_op.object = p_object->get_instance_id(); - if (Object::cast_to(p_object)) { - undo_op.resref = Ref(Object::cast_to(p_object)); + if (Object::cast_to(p_object)) { + undo_op.ref = Ref(Object::cast_to(p_object)); } undo_op.type = Operation::TYPE_PROPERTY; @@ -187,8 +188,8 @@ void UndoRedo::add_do_reference(Object *p_object) { ERR_FAIL_COND((current_action + 1) >= actions.size()); Operation do_op; do_op.object = p_object->get_instance_id(); - if (Object::cast_to(p_object)) { - do_op.resref = Ref(Object::cast_to(p_object)); + if (Object::cast_to(p_object)) { + do_op.ref = Ref(Object::cast_to(p_object)); } do_op.type = Operation::TYPE_REFERENCE; @@ -207,8 +208,8 @@ void UndoRedo::add_undo_reference(Object *p_object) { Operation undo_op; undo_op.object = p_object->get_instance_id(); - if (Object::cast_to(p_object)) { - undo_op.resref = Ref(Object::cast_to(p_object)); + if (Object::cast_to(p_object)) { + undo_op.ref = Ref(Object::cast_to(p_object)); } undo_op.type = Operation::TYPE_REFERENCE; -- cgit v1.2.3 From b7367ac426659e02facc7c828e57aa687cce957c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Sun, 20 Dec 2020 11:46:44 +0100 Subject: Add animation reset track feature As a bonus, to have consistency between use Beziers and create insert tracks, use Beziers also gets a default via editor settings that is used when the confirmation dialog is disabled, instead of just falling back to creating non-Bezier tracks. --- core/object/undo_redo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/object/undo_redo.cpp') diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp index c5b66cda8c..65bae6f6e8 100644 --- a/core/object/undo_redo.cpp +++ b/core/object/undo_redo.cpp @@ -30,8 +30,8 @@ #include "undo_redo.h" +#include "core/io/resource.h" #include "core/os/os.h" -#include "core/resource.h" void UndoRedo::_discard_redo() { if (current_action == actions.size() - 1) { -- cgit v1.2.3