mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Better deselection handling in AnimationTree editors
This commit is contained in:
parent
825ef2387f
commit
f6a6aad6eb
5 changed files with 77 additions and 0 deletions
|
|
@ -284,6 +284,11 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
|
|||
}
|
||||
}
|
||||
|
||||
// If no state or transition was selected, select host StateMachine node.
|
||||
if (selected_node.is_empty() && selected_transition_index == -1) {
|
||||
EditorNode::get_singleton()->push_item(state_machine.ptr(), "", true);
|
||||
}
|
||||
|
||||
state_machine_draw->queue_redraw();
|
||||
_update_mode();
|
||||
}
|
||||
|
|
@ -1648,6 +1653,10 @@ void AnimationNodeStateMachineEditor::_erase_selected(const bool p_nested_action
|
|||
|
||||
connected_nodes.clear();
|
||||
selected_nodes.clear();
|
||||
selected_node = StringName();
|
||||
|
||||
// Return selection to host StateMachine node.
|
||||
EditorNode::get_singleton()->push_item(state_machine.ptr(), "", true);
|
||||
}
|
||||
|
||||
if (selected_transition_to != StringName() && selected_transition_from != StringName() && state_machine->has_transition(selected_transition_from, selected_transition_to)) {
|
||||
|
|
@ -1668,8 +1677,12 @@ void AnimationNodeStateMachineEditor::_erase_selected(const bool p_nested_action
|
|||
selected_transition_from = StringName();
|
||||
selected_transition_to = StringName();
|
||||
selected_transition_index = -1;
|
||||
|
||||
// Return selection to host StateMachine node.
|
||||
EditorNode::get_singleton()->push_item(state_machine.ptr(), "", true);
|
||||
}
|
||||
|
||||
_update_mode();
|
||||
state_machine_draw->queue_redraw();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue