diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-09-05 13:34:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-05 13:34:42 +0200 |
commit | 545dc27096ace0e46730adab9f53729032dff4e5 (patch) | |
tree | 01509767fed8c96a8140c1c1d5d5b8191c38cce0 /editor/plugins | |
parent | 6c818da55ef1f45eaed06e1413220af1d23a9c41 (diff) | |
parent | dae05fd249ec4ae1cc08fe20a8268ab7a0951acf (diff) |
Merge pull request #65356 from V-Sekai/state_machine_undo_redo_fix
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/animation_state_machine_editor.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 2809eb01cd..1a6106b4fb 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1023,11 +1023,9 @@ void AnimationNodeStateMachineEditor::_add_menu_type(int p_index) { } updating = true; - undo_redo->create_action(TTR("Add Node")); + undo_redo->create_action(TTR("Add Node and Transition")); undo_redo->add_do_method(state_machine.ptr(), "add_node", name, node, add_node_pos); undo_redo->add_undo_method(state_machine.ptr(), "remove_node", name); - undo_redo->add_do_method(this, "_update_graph"); - undo_redo->add_undo_method(this, "_update_graph"); connecting_to_node = name; _add_transition(true); undo_redo->commit_action(); @@ -1051,11 +1049,9 @@ void AnimationNodeStateMachineEditor::_add_animation_type(int p_index) { } updating = true; - undo_redo->create_action(TTR("Add Node")); + undo_redo->create_action(TTR("Add Node and Transition")); undo_redo->add_do_method(state_machine.ptr(), "add_node", name, anim, add_node_pos); undo_redo->add_undo_method(state_machine.ptr(), "remove_node", name); - undo_redo->add_do_method(this, "_update_graph"); - undo_redo->add_undo_method(this, "_update_graph"); connecting_to_node = name; _add_transition(true); undo_redo->commit_action(); @@ -1083,16 +1079,16 @@ void AnimationNodeStateMachineEditor::_add_transition(const bool p_nested_action if (!p_nested_action) { updating = true; + undo_redo->create_action(TTR("Add Transition")); } - undo_redo->create_action(TTR("Add Transition")); undo_redo->add_do_method(state_machine.ptr(), "add_transition", connecting_from, connecting_to_node, tr); undo_redo->add_undo_method(state_machine.ptr(), "remove_transition", connecting_from, connecting_to_node); undo_redo->add_do_method(this, "_update_graph"); undo_redo->add_undo_method(this, "_update_graph"); - undo_redo->commit_action(); if (!p_nested_action) { + undo_redo->commit_action(); updating = false; } |