From 0e545d9e8842caaa18d1f05029d85d12425ccb79 Mon Sep 17 00:00:00 2001 From: Saracen Date: Fri, 27 Oct 2023 13:39:08 +0100 Subject: [PATCH] Unpress buttons in AnimationTree when switching to read-only mode. --- editor/plugins/animation_state_machine_editor.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 746a901a0a1..904f4ad590e 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -76,6 +76,11 @@ void AnimationNodeStateMachineEditor::edit(const Ref &p_node) { _update_graph(); } + if (read_only) { + tool_create->set_pressed(false); + tool_connect->set_pressed(false); + } + tool_create->set_disabled(read_only); tool_connect->set_disabled(read_only); } @@ -1591,6 +1596,11 @@ void AnimationNodeStateMachineEditor::_update_mode() { selection_tools_hb->hide(); } + if (read_only) { + tool_create->set_pressed(false); + tool_connect->set_pressed(false); + } + if (tool_connect->is_pressed()) { transition_tools_hb->show(); } else {