diff options
Diffstat (limited to 'editor/connections_dialog.cpp')
-rw-r--r-- | editor/connections_dialog.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index f57e9cb5f8..cb775a67e7 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -282,7 +282,7 @@ List<MethodInfo> ConnectDialog::_filter_method_list(const List<MethodInfo> &p_me List<MethodInfo> ret; for (const MethodInfo &mi : p_methods) { - if (!p_search_string.is_empty() && !mi.name.contains(p_search_string)) { + if (!p_search_string.is_empty() && !mi.name.containsn(p_search_string)) { continue; } @@ -529,12 +529,13 @@ String ConnectDialog::get_signature(const MethodInfo &p_method, PackedStringArra signature.append(p_method.name); signature.append("("); - for (int i = 0; i < p_method.arguments.size(); i++) { - if (i > 0) { + int i = 0; + for (List<PropertyInfo>::ConstIterator itr = p_method.arguments.begin(); itr != p_method.arguments.end(); ++itr, ++i) { + if (itr != p_method.arguments.begin()) { signature.append(", "); } - const PropertyInfo &pi = p_method.arguments[i]; + const PropertyInfo &pi = *itr; String type_name; switch (pi.type) { case Variant::NIL: @@ -720,7 +721,7 @@ ConnectDialog::ConnectDialog() { Button *focus_current = memnew(Button); hbc_filter->add_child(focus_current); focus_current->set_text(TTR("Go to Source")); - focus_current->connect("pressed", callable_mp(this, &ConnectDialog::_focus_currently_connected)); + focus_current->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_focus_currently_connected)); Node *mc = vbc_left->add_margin_child(TTR("Connect to Script:"), hbc_filter, false); connect_to_label = Object::cast_to<Label>(vbc_left->get_child(mc->get_index() - 1)); @@ -767,13 +768,13 @@ ConnectDialog::ConnectDialog() { method_vbc->add_child(script_methods_only); script_methods_only->set_h_size_flags(Control::SIZE_SHRINK_END); script_methods_only->set_pressed(EditorSettings::get_singleton()->get_project_metadata("editor_metadata", "show_script_methods_only", true)); - script_methods_only->connect("pressed", callable_mp(this, &ConnectDialog::_method_check_button_pressed).bind(script_methods_only)); + script_methods_only->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_method_check_button_pressed).bind(script_methods_only)); compatible_methods_only = memnew(CheckButton(TTR("Compatible Methods Only"))); method_vbc->add_child(compatible_methods_only); compatible_methods_only->set_h_size_flags(Control::SIZE_SHRINK_END); compatible_methods_only->set_pressed(EditorSettings::get_singleton()->get_project_metadata("editor_metadata", "show_compatible_methods_only", true)); - compatible_methods_only->connect("pressed", callable_mp(this, &ConnectDialog::_method_check_button_pressed).bind(compatible_methods_only)); + compatible_methods_only->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_method_check_button_pressed).bind(compatible_methods_only)); vbc_right = memnew(VBoxContainer); main_hb->add_child(vbc_right); @@ -799,13 +800,13 @@ ConnectDialog::ConnectDialog() { Button *add_bind = memnew(Button); add_bind->set_text(TTR("Add")); add_bind_hb->add_child(add_bind); - add_bind->connect("pressed", callable_mp(this, &ConnectDialog::_add_bind)); + add_bind->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_add_bind)); bind_controls.push_back(add_bind); Button *del_bind = memnew(Button); del_bind->set_text(TTR("Remove")); add_bind_hb->add_child(del_bind); - del_bind->connect("pressed", callable_mp(this, &ConnectDialog::_remove_bind)); + del_bind->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_remove_bind)); bind_controls.push_back(del_bind); vbc_right->add_margin_child(TTR("Add Extra Call Argument:"), add_bind_hb); @@ -833,13 +834,13 @@ ConnectDialog::ConnectDialog() { open_method_tree = memnew(Button); hbc_method->add_child(open_method_tree); open_method_tree->set_text("Pick"); - open_method_tree->connect("pressed", callable_mp(this, &ConnectDialog::_open_method_popup)); + open_method_tree->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_open_method_popup)); advanced = memnew(CheckButton(TTR("Advanced"))); vbc_left->add_child(advanced); advanced->set_h_size_flags(Control::SIZE_SHRINK_BEGIN | Control::SIZE_EXPAND); advanced->set_pressed(EditorSettings::get_singleton()->get_project_metadata("editor_metadata", "use_advanced_connections", false)); - advanced->connect("pressed", callable_mp(this, &ConnectDialog::_advanced_pressed)); + advanced->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_advanced_pressed)); HBoxContainer *hbox = memnew(HBoxContainer); vbc_right->add_child(hbox); @@ -1582,7 +1583,7 @@ ConnectionsDock::ConnectionsDock() { vbc->add_child(hb); hb->add_spacer(); hb->add_child(connect_button); - connect_button->connect("pressed", callable_mp(this, &ConnectionsDock::_connect_pressed)); + connect_button->connect(SceneStringName(pressed), callable_mp(this, &ConnectionsDock::_connect_pressed)); connect_dialog = memnew(ConnectDialog); connect_dialog->connect("connected", callable_mp(NodeDock::get_singleton(), &NodeDock::restore_last_valid_node), CONNECT_DEFERRED); @@ -1621,7 +1622,7 @@ ConnectionsDock::ConnectionsDock() { connect_dialog->connect("connected", callable_mp(this, &ConnectionsDock::_make_or_edit_connection)); tree->connect("item_selected", callable_mp(this, &ConnectionsDock::_tree_item_selected)); tree->connect("item_activated", callable_mp(this, &ConnectionsDock::_tree_item_activated)); - tree->connect("gui_input", callable_mp(this, &ConnectionsDock::_tree_gui_input)); + tree->connect(SceneStringName(gui_input), callable_mp(this, &ConnectionsDock::_tree_gui_input)); add_theme_constant_override("separation", 3 * EDSCALE); } |