From ddde73cc62f10c254eee1502ea085eed197863bc Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 14 Jan 2020 21:03:09 +0800 Subject: [PATCH] Makes adding port in Visual Script nodes deferred --- modules/visual_script/visual_script_editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 4bfd4f48ce3..ec20698ae8a 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -575,7 +575,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Button *btn = memnew(Button); btn->set_text(TTR("Add Input Port")); hbnc->add_child(btn); - btn->connect("pressed", this, "_add_input_port", varray(E->get())); + btn->connect("pressed", this, "_add_input_port", varray(E->get()), CONNECT_DEFERRED); } if (nd_list->is_output_port_editable()) { if (nd_list->is_input_port_editable()) @@ -584,7 +584,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Button *btn = memnew(Button); btn->set_text(TTR("Add Output Port")); hbnc->add_child(btn); - btn->connect("pressed", this, "_add_output_port", varray(E->get())); + btn->connect("pressed", this, "_add_output_port", varray(E->get()), CONNECT_DEFERRED); } gnode->add_child(hbnc); } else if (Object::cast_to(node.ptr())) {