diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index bc3db3f7fac..6ff0520ab6f 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -552,8 +552,8 @@ ActionMapEditor::ActionMapEditor() { Button *clear_all_search = memnew(Button); clear_all_search->set_text(TTR("Clear All")); - clear_all_search->connect("pressed", callable_mp(action_list_search_by_event, &EventListenerLineEdit::clear_event)); - clear_all_search->connect("pressed", callable_mp(action_list_search, &LineEdit::clear)); + clear_all_search->connect(SceneStringName(pressed), callable_mp(action_list_search_by_event, &EventListenerLineEdit::clear_event)); + clear_all_search->connect(SceneStringName(pressed), callable_mp(action_list_search, &LineEdit::clear)); top_hbox->add_child(clear_all_search); // Adding Action line edit + button @@ -570,7 +570,7 @@ ActionMapEditor::ActionMapEditor() { add_button = memnew(Button); add_button->set_text(TTR("Add")); - add_button->connect("pressed", callable_mp(this, &ActionMapEditor::_add_action_pressed)); + add_button->connect(SceneStringName(pressed), callable_mp(this, &ActionMapEditor::_add_action_pressed)); add_hbox->add_child(add_button); // Disable the button and set its tooltip. _add_edit_text_changed(add_edit->get_text()); diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index e6de641d3c4..ebb63dd57c1 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1924,7 +1924,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() { loop = memnew(Button); loop->set_flat(true); loop->set_tooltip_text(TTR("Animation Looping")); - loop->connect("pressed", callable_mp(this, &AnimationTimelineEdit::_anim_loop_pressed)); + loop->connect(SceneStringName(pressed), callable_mp(this, &AnimationTimelineEdit::_anim_loop_pressed)); loop->set_toggle_mode(true); len_hb->add_child(loop); add_child(len_hb); @@ -7226,21 +7226,21 @@ AnimationTrackEditor::AnimationTrackEditor() { imported_anim_warning->hide(); imported_anim_warning->set_text(TTR("Imported Scene")); imported_anim_warning->set_tooltip_text(TTR("Warning: Editing imported animation")); - imported_anim_warning->connect("pressed", callable_mp(this, &AnimationTrackEditor::_show_imported_anim_warning)); + imported_anim_warning->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_show_imported_anim_warning)); bottom_hb->add_child(imported_anim_warning); dummy_player_warning = memnew(Button); dummy_player_warning->hide(); dummy_player_warning->set_text(TTR("Dummy Player")); dummy_player_warning->set_tooltip_text(TTR("Warning: Editing dummy AnimationPlayer")); - dummy_player_warning->connect("pressed", callable_mp(this, &AnimationTrackEditor::_show_dummy_player_warning)); + dummy_player_warning->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_show_dummy_player_warning)); bottom_hb->add_child(dummy_player_warning); inactive_player_warning = memnew(Button); inactive_player_warning->hide(); inactive_player_warning->set_text(TTR("Inactive Player")); inactive_player_warning->set_tooltip_text(TTR("Warning: AnimationPlayer is inactive")); - inactive_player_warning->connect("pressed", callable_mp(this, &AnimationTrackEditor::_show_inactive_player_warning)); + inactive_player_warning->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_show_inactive_player_warning)); bottom_hb->add_child(inactive_player_warning); bottom_hb->add_spacer(); @@ -7249,14 +7249,14 @@ AnimationTrackEditor::AnimationTrackEditor() { bezier_edit_icon->set_flat(true); bezier_edit_icon->set_disabled(true); bezier_edit_icon->set_toggle_mode(true); - bezier_edit_icon->connect("pressed", callable_mp(this, &AnimationTrackEditor::_toggle_bezier_edit)); + bezier_edit_icon->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_toggle_bezier_edit)); bezier_edit_icon->set_tooltip_text(TTR("Toggle between the bezier curve editor and track editor.")); bottom_hb->add_child(bezier_edit_icon); selected_filter = memnew(Button); selected_filter->set_flat(true); - selected_filter->connect("pressed", callable_mp(this, &AnimationTrackEditor::_view_group_toggle)); // Same function works the same. + selected_filter->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_view_group_toggle)); // Same function works the same. selected_filter->set_toggle_mode(true); selected_filter->set_tooltip_text(TTR("Only show tracks from nodes selected in tree.")); @@ -7264,7 +7264,7 @@ AnimationTrackEditor::AnimationTrackEditor() { view_group = memnew(Button); view_group->set_flat(true); - view_group->connect("pressed", callable_mp(this, &AnimationTrackEditor::_view_group_toggle)); + view_group->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_view_group_toggle)); view_group->set_toggle_mode(true); view_group->set_tooltip_text(TTR("Group tracks by node or display them as plain list.")); @@ -7314,14 +7314,14 @@ AnimationTrackEditor::AnimationTrackEditor() { auto_fit = memnew(Button); auto_fit->set_flat(true); - auto_fit->connect("pressed", callable_mp(this, &AnimationTrackEditor::_auto_fit)); + auto_fit->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_auto_fit)); auto_fit->set_shortcut(ED_SHORTCUT("animation_editor/auto_fit", TTR("Fit to panel"), KeyModifierMask::ALT | Key::F)); bottom_hb->add_child(auto_fit); auto_fit_bezier = memnew(Button); auto_fit_bezier->set_flat(true); auto_fit_bezier->set_visible(false); - auto_fit_bezier->connect("pressed", callable_mp(this, &AnimationTrackEditor::_auto_fit_bezier)); + auto_fit_bezier->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_auto_fit_bezier)); auto_fit_bezier->set_shortcut(ED_SHORTCUT("animation_editor/auto_fit", TTR("Fit to panel"), KeyModifierMask::ALT | Key::F)); bottom_hb->add_child(auto_fit_bezier); @@ -7572,7 +7572,7 @@ AnimationTrackEditor::AnimationTrackEditor() { Button *select_all_button = memnew(Button); select_all_button->set_text(TTR("Select All/None")); - select_all_button->connect("pressed", callable_mp(this, &AnimationTrackEditor::_select_all_tracks_for_copy)); + select_all_button->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_select_all_tracks_for_copy)); track_copy_vbox->add_child(select_all_button); track_copy_select = memnew(Tree); diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 2a398c65d85..ee0108df8ec 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -721,14 +721,14 @@ FindReplaceBar::FindReplaceBar() { find_prev->set_tooltip_text(TTR("Previous Match")); hbc_button_search->add_child(find_prev); find_prev->set_focus_mode(FOCUS_NONE); - find_prev->connect("pressed", callable_mp(this, &FindReplaceBar::search_prev)); + find_prev->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::search_prev)); find_next = memnew(Button); find_next->set_flat(true); find_next->set_tooltip_text(TTR("Next Match")); hbc_button_search->add_child(find_next); find_next->set_focus_mode(FOCUS_NONE); - find_next->connect("pressed", callable_mp(this, &FindReplaceBar::search_next)); + find_next->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::search_next)); case_sensitive = memnew(CheckBox); hbc_option_search->add_child(case_sensitive); @@ -754,12 +754,12 @@ FindReplaceBar::FindReplaceBar() { replace = memnew(Button); hbc_button_replace->add_child(replace); replace->set_text(TTR("Replace")); - replace->connect("pressed", callable_mp(this, &FindReplaceBar::_replace)); + replace->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_replace)); replace_all = memnew(Button); hbc_button_replace->add_child(replace_all); replace_all->set_text(TTR("Replace All")); - replace_all->connect("pressed", callable_mp(this, &FindReplaceBar::_replace_all)); + replace_all->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_replace_all)); selection_only = memnew(CheckBox); hbc_option_replace->add_child(selection_only); @@ -771,7 +771,7 @@ FindReplaceBar::FindReplaceBar() { add_child(hide_button); hide_button->set_tooltip_text(TTR("Hide")); hide_button->set_focus_mode(FOCUS_NONE); - hide_button->connect("pressed", callable_mp(this, &FindReplaceBar::_hide_bar).bind(false)); + hide_button->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_hide_bar).bind(false)); hide_button->set_v_size_flags(SIZE_SHRINK_CENTER); } @@ -1713,7 +1713,7 @@ CodeTextEditor::CodeTextEditor() { toggle_scripts_button = memnew(Button); toggle_scripts_button->set_flat(true); toggle_scripts_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER); - toggle_scripts_button->connect("pressed", callable_mp(this, &CodeTextEditor::_toggle_scripts_pressed)); + toggle_scripts_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_toggle_scripts_pressed)); status_bar->add_child(toggle_scripts_button); toggle_scripts_button->hide(); @@ -1736,7 +1736,7 @@ CodeTextEditor::CodeTextEditor() { status_bar->add_child(error_button); error_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER); error_button->set_default_cursor_shape(CURSOR_POINTING_HAND); - error_button->connect("pressed", callable_mp(this, &CodeTextEditor::_error_button_pressed)); + error_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_error_button_pressed)); error_button->set_tooltip_text(TTR("Errors")); set_error_count(0); @@ -1746,7 +1746,7 @@ CodeTextEditor::CodeTextEditor() { status_bar->add_child(warning_button); warning_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER); warning_button->set_default_cursor_shape(CURSOR_POINTING_HAND); - warning_button->connect("pressed", callable_mp(this, &CodeTextEditor::_warning_button_pressed)); + warning_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_warning_button_pressed)); warning_button->set_tooltip_text(TTR("Warnings")); set_warning_count(0); diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 187e6b7298c..cb775a67e7f 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -721,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