Merge pull request #116946 from vaner-org/statemachine-undo-redo
Add undo/redo to adding/removing StateMachine nodes
This commit is contained in:
commit
dcbdac00f6
1 changed files with 4 additions and 0 deletions
|
|
@ -971,6 +971,8 @@ void AnimationNodeStateMachineEditor::_add_menu_type(int p_index) {
|
|||
undo_redo->add_undo_method(state_machine.ptr(), "remove_node", name);
|
||||
connecting_to_node = name;
|
||||
_add_transition(true);
|
||||
undo_redo->add_do_method(this, "_update_graph");
|
||||
undo_redo->add_undo_method(this, "_update_graph");
|
||||
undo_redo->commit_action();
|
||||
updating = false;
|
||||
|
||||
|
|
@ -998,6 +1000,8 @@ void AnimationNodeStateMachineEditor::_add_animation_type(int p_index) {
|
|||
undo_redo->add_undo_method(state_machine.ptr(), "remove_node", name);
|
||||
connecting_to_node = name;
|
||||
_add_transition(true);
|
||||
undo_redo->add_do_method(this, "_update_graph");
|
||||
undo_redo->add_undo_method(this, "_update_graph");
|
||||
undo_redo->commit_action();
|
||||
updating = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue