Skip to content

Commit

Permalink
Merge pull request #84052 from SaracenOne/animtree_readonly_context
Browse files Browse the repository at this point in the history
Unpress buttons in AnimationTree when switching to read-only mode.
  • Loading branch information
akien-mga committed Nov 11, 2023
2 parents 8179ad5 + 0e545d9 commit 97a102c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions editor/plugins/animation_state_machine_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ void AnimationNodeStateMachineEditor::edit(const Ref<AnimationNode> &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);
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 97a102c

Please sign in to comment.