mirror of
https://github.com/godotengine/godot.git
synced 2025-10-25 18:54:43 +00:00
Add node list param to GraphEdit::delete_nodes_request signal
This commit is contained in:
parent
e86d840d4f
commit
32b9818965
6 changed files with 43 additions and 19 deletions
|
|
@ -1950,17 +1950,23 @@ void VisualShaderEditor::_paste_nodes() {
|
|||
_dup_update_excluded(type, copy_nodes_excluded_buffer); // to prevent selection of previous copies at new paste
|
||||
}
|
||||
|
||||
void VisualShaderEditor::_on_nodes_delete() {
|
||||
void VisualShaderEditor::_on_nodes_delete(const Array &p_nodes) {
|
||||
VisualShader::Type type = VisualShader::Type(edit_type->get_selected());
|
||||
List<int> to_erase;
|
||||
|
||||
for (int i = 0; i < graph->get_child_count(); i++) {
|
||||
GraphNode *gn = Object::cast_to<GraphNode>(graph->get_child(i));
|
||||
if (gn) {
|
||||
if (gn->is_selected() && gn->is_close_button_visible()) {
|
||||
to_erase.push_back(gn->get_name().operator String().to_int());
|
||||
if (p_nodes.empty()) {
|
||||
for (int i = 0; i < graph->get_child_count(); i++) {
|
||||
GraphNode *gn = Object::cast_to<GraphNode>(graph->get_child(i));
|
||||
if (gn) {
|
||||
if (gn->is_selected() && gn->is_close_button_visible()) {
|
||||
to_erase.push_back(gn->get_name().operator String().to_int());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < p_nodes.size(); i++) {
|
||||
to_erase.push_back(p_nodes[i].operator String().to_int());
|
||||
}
|
||||
}
|
||||
|
||||
if (to_erase.empty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue