1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Readd close button for nodes in AnimationNodeBlendTree editor

This commit is contained in:
Haoyu Qiu
2023-10-17 23:04:19 +08:00
parent 8c25a98fdf
commit 920e53cacb
2 changed files with 13 additions and 4 deletions

View File

@@ -170,7 +170,15 @@ void AnimationNodeBlendTreeEditor::update_graph() {
name->connect("text_changed", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_rename_lineedit_changed), CONNECT_DEFERRED);
base = 1;
agnode->set_closable(true);
node->connect("delete_request", callable_mp(this, &AnimationNodeBlendTreeEditor::_delete_node_request).bind(E), CONNECT_DEFERRED);
if (!read_only) {
Button *delete_button = memnew(Button);
delete_button->set_flat(true);
delete_button->set_focus_mode(FOCUS_NONE);
delete_button->set_icon(get_editor_theme_icon(SNAME("Close")));
delete_button->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_delete_node_request).bind(E), CONNECT_DEFERRED);
node->get_titlebar_hbox()->add_child(delete_button);
}
}
for (int i = 0; i < agnode->get_input_count(); i++) {