diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-29 18:10:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-29 18:10:39 +0200 |
commit | 7199314eb39408da4f9f7286452c980a3d3da1c9 (patch) | |
tree | bde2b775cfcc20c77c8424b4c038a7553b344226 /modules/openxr | |
parent | 5352cf8e2fafb0c974e3ba68ff8e3c2ce80d449e (diff) | |
parent | d4433ae6d3a525683ef37ea521d30b6b97a44024 (diff) |
Merge pull request #63595 from reduz/remove-signal-connect-binds
Remove Signal connect binds
Diffstat (limited to 'modules/openxr')
3 files changed, 4 insertions, 13 deletions
diff --git a/modules/openxr/editor/openxr_interaction_profile_editor.cpp b/modules/openxr/editor/openxr_interaction_profile_editor.cpp index 24ac5494dd..e2dc2d1b74 100644 --- a/modules/openxr/editor/openxr_interaction_profile_editor.cpp +++ b/modules/openxr/editor/openxr_interaction_profile_editor.cpp @@ -169,9 +169,7 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co Button *path_add = memnew(Button); path_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); path_add->set_flat(true); - Vector<Variant> add_binds; - add_binds.push_back(String(p_io_path->openxr_path)); - path_add->connect("pressed", callable_mp(this, &OpenXRInteractionProfileEditor::select_action_for), add_binds); + path_add->connect("pressed", callable_mp(this, &OpenXRInteractionProfileEditor::select_action_for).bind(String(p_io_path->openxr_path))); path_hb->add_child(path_add); if (interaction_profile.is_valid()) { @@ -198,10 +196,7 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co Button *action_rem = memnew(Button); action_rem->set_flat(true); action_rem->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"))); - Vector<Variant> remove_binds; - remove_binds.push_back(action->get_name_with_set()); - remove_binds.push_back(String(p_io_path->openxr_path)); - action_rem->connect("pressed", callable_mp((OpenXRInteractionProfileEditorBase *)this, &OpenXRInteractionProfileEditorBase::_remove_binding), remove_binds); + action_rem->connect("pressed", callable_mp((OpenXRInteractionProfileEditorBase *)this, &OpenXRInteractionProfileEditorBase::_remove_binding).bind(action->get_name_with_set(), String(p_io_path->openxr_path))); action_hb->add_child(action_rem); } } diff --git a/modules/openxr/editor/openxr_select_action_dialog.cpp b/modules/openxr/editor/openxr_select_action_dialog.cpp index c2a2965200..80e58044d5 100644 --- a/modules/openxr/editor/openxr_select_action_dialog.cpp +++ b/modules/openxr/editor/openxr_select_action_dialog.cpp @@ -96,11 +96,9 @@ void OpenXRSelectActionDialog::open() { Button *action_button = memnew(Button); String action_name = action->get_name_with_set(); - Vector<Variant> binds; - binds.push_back(action_name); action_button->set_flat(true); action_button->set_text(action->get_name() + ": " + action->get_localized_name()); - action_button->connect("pressed", callable_mp(this, &OpenXRSelectActionDialog::_on_select_action), binds); + action_button->connect("pressed", callable_mp(this, &OpenXRSelectActionDialog::_on_select_action).bind(action_name)); action_hb->add_child(action_button); action_buttons[action_name] = action_button->get_path(); diff --git a/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp b/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp index 12b110f146..23b025db08 100644 --- a/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp +++ b/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp @@ -80,11 +80,9 @@ void OpenXRSelectInteractionProfileDialog::open(PackedStringArray p_do_not_inclu String path = interaction_profiles[i]; if (!p_do_not_include.has(path)) { Button *ip_button = memnew(Button); - Vector<Variant> binds; - binds.push_back(path); ip_button->set_flat(true); ip_button->set_text(OpenXRDefs::get_profile(path)->display_name); - ip_button->connect("pressed", callable_mp(this, &OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile), binds); + ip_button->connect("pressed", callable_mp(this, &OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile).bind(path)); main_vb->add_child(ip_button); ip_buttons[path] = ip_button->get_path(); |