Merge pull request #69384 from asalazar516/3.x_delete_nodes_request_param

[3.x] Add missing argument to `AnimationNodeBlendTreeEditor::_delete_nodes_request`
This commit is contained in:
Rémi Verschelde 2022-12-05 00:13:31 +01:00
commit bf7f93d236
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 13 additions and 7 deletions

View File

@ -456,9 +456,10 @@ void AnimationNodeBlendTreeEditor::_delete_request(const String &p_which) {
undo_redo->commit_action(); undo_redo->commit_action();
} }
void AnimationNodeBlendTreeEditor::_delete_nodes_request() { void AnimationNodeBlendTreeEditor::_delete_nodes_request(const Array &p_nodes) {
List<StringName> to_erase; List<StringName> to_erase;
if (p_nodes.empty()) {
for (int i = 0; i < graph->get_child_count(); i++) { for (int i = 0; i < graph->get_child_count(); i++) {
GraphNode *gn = Object::cast_to<GraphNode>(graph->get_child(i)); GraphNode *gn = Object::cast_to<GraphNode>(graph->get_child(i));
if (gn) { if (gn) {
@ -467,6 +468,11 @@ void AnimationNodeBlendTreeEditor::_delete_nodes_request() {
} }
} }
} }
} else {
for (int i = 0; i < p_nodes.size(); i++) {
to_erase.push_back(p_nodes[i]);
}
}
if (to_erase.empty()) { if (to_erase.empty()) {
return; return;

View File

@ -103,7 +103,7 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin {
void _open_in_editor(const String &p_which); void _open_in_editor(const String &p_which);
void _anim_selected(int p_index, Array p_options, const String &p_node); void _anim_selected(int p_index, Array p_options, const String &p_node);
void _delete_request(const String &p_which); void _delete_request(const String &p_which);
void _delete_nodes_request(); void _delete_nodes_request(const Array &p_nodes);
bool _update_filters(const Ref<AnimationNode> &anode); bool _update_filters(const Ref<AnimationNode> &anode);
void _edit_filters(const String &p_which); void _edit_filters(const String &p_which);