diff options
147 files changed, 727 insertions, 722 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index bc3db3f7fa..6ff0520ab6 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 e6de641d3c..ebb63dd57c 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 2a398c65d8..ee0108df8e 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 187e6b7298..cb775a67e7 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<Label>(vbc_left->get_child(mc->get_index() - 1)); @@ -768,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); @@ -800,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); @@ -834,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); @@ -1583,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); diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 2980054413..d3174ed215 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -815,7 +815,7 @@ CreateDialog::CreateDialog() { favorite = memnew(Button); favorite->set_toggle_mode(true); favorite->set_tooltip_text(TTR("(Un)favorite selected item.")); - favorite->connect("pressed", callable_mp(this, &CreateDialog::_favorite_toggled)); + favorite->connect(SceneStringName(pressed), callable_mp(this, &CreateDialog::_favorite_toggled)); search_hb->add_child(favorite); vbc->add_margin_child(TTR("Search:"), search_hb); diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp index 56cb3b6c73..4febb8bf04 100644 --- a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp +++ b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp @@ -1043,7 +1043,7 @@ DebugAdapterProtocol::DebugAdapterProtocol() { reset_ids(); - EditorRunBar::get_singleton()->get_pause_button()->connect("pressed", callable_mp(this, &DebugAdapterProtocol::on_debug_paused)); + EditorRunBar::get_singleton()->get_pause_button()->connect(SceneStringName(pressed), callable_mp(this, &DebugAdapterProtocol::on_debug_paused)); EditorDebuggerNode *debugger_node = EditorDebuggerNode::get_singleton(); debugger_node->connect("breakpoint_toggled", callable_mp(this, &DebugAdapterProtocol::on_debug_breakpoint_toggled)); diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 931e360a34..1d3c7aec3f 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -91,7 +91,7 @@ EditorDebuggerNode::EditorDebuggerNode() { remote_scene_tree_timeout = EDITOR_GET("debugger/remote_scene_tree_refresh_interval"); inspect_edited_object_timeout = EDITOR_GET("debugger/remote_inspect_refresh_interval"); - EditorRunBar::get_singleton()->get_pause_button()->connect("pressed", callable_mp(this, &EditorDebuggerNode::_paused)); + EditorRunBar::get_singleton()->get_pause_button()->connect(SceneStringName(pressed), callable_mp(this, &EditorDebuggerNode::_paused)); } ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() { diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index 290b7f5405..69cf13ea0b 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -614,12 +614,12 @@ EditorProfiler::EditorProfiler() { activate->set_toggle_mode(true); activate->set_disabled(true); activate->set_text(TTR("Start")); - activate->connect("pressed", callable_mp(this, &EditorProfiler::_activate_pressed)); + activate->connect(SceneStringName(pressed), callable_mp(this, &EditorProfiler::_activate_pressed)); hb->add_child(activate); clear_button = memnew(Button); clear_button->set_text(TTR("Clear")); - clear_button->connect("pressed", callable_mp(this, &EditorProfiler::_clear_pressed)); + clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorProfiler::_clear_pressed)); clear_button->set_disabled(true); hb->add_child(clear_button); @@ -649,7 +649,7 @@ EditorProfiler::EditorProfiler() { display_internal_profiles = memnew(CheckButton(TTR("Display internal functions"))); display_internal_profiles->set_visible(EDITOR_GET("debugger/profile_native_calls")); display_internal_profiles->set_pressed(false); - display_internal_profiles->connect("pressed", callable_mp(this, &EditorProfiler::_internal_profiles_pressed)); + display_internal_profiles->connect(SceneStringName(pressed), callable_mp(this, &EditorProfiler::_internal_profiles_pressed)); hb->add_child(display_internal_profiles); hb->add_spacer(); diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index d54ea2d433..38f1061a72 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -736,13 +736,13 @@ EditorVisualProfiler::EditorVisualProfiler() { activate->set_toggle_mode(true); activate->set_disabled(true); activate->set_text(TTR("Start")); - activate->connect("pressed", callable_mp(this, &EditorVisualProfiler::_activate_pressed)); + activate->connect(SceneStringName(pressed), callable_mp(this, &EditorVisualProfiler::_activate_pressed)); hb->add_child(activate); clear_button = memnew(Button); clear_button->set_text(TTR("Clear")); clear_button->set_disabled(true); - clear_button->connect("pressed", callable_mp(this, &EditorVisualProfiler::_clear_pressed)); + clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorVisualProfiler::_clear_pressed)); hb->add_child(clear_button); hb->add_child(memnew(Label(TTR("Measure:")))); @@ -757,11 +757,11 @@ EditorVisualProfiler::EditorVisualProfiler() { frame_relative = memnew(CheckBox(TTR("Fit to Frame"))); frame_relative->set_pressed(true); hb->add_child(frame_relative); - frame_relative->connect("pressed", callable_mp(this, &EditorVisualProfiler::_update_plot)); + frame_relative->connect(SceneStringName(pressed), callable_mp(this, &EditorVisualProfiler::_update_plot)); linked = memnew(CheckBox(TTR("Linked"))); linked->set_pressed(true); hb->add_child(linked); - linked->connect("pressed", callable_mp(this, &EditorVisualProfiler::_update_plot)); + linked->connect(SceneStringName(pressed), callable_mp(this, &EditorVisualProfiler::_update_plot)); hb->add_spacer(); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index d5cf887a4e..156e740509 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -849,8 +849,8 @@ void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType void ScriptEditorDebugger::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - le_set->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_live_edit_set)); - le_clear->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_live_edit_clear)); + le_set->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_live_edit_set)); + le_clear->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_live_edit_clear)); error_tree->connect("item_selected", callable_mp(this, &ScriptEditorDebugger::_error_selected)); error_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_error_activated)); breakpoints_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_breakpoint_tree_clicked)); @@ -1826,7 +1826,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() { skip_breakpoints->set_theme_type_variation("FlatButton"); hbc->add_child(skip_breakpoints); skip_breakpoints->set_tooltip_text(TTR("Skip Breakpoints")); - skip_breakpoints->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_skip_breakpoints)); + skip_breakpoints->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_skip_breakpoints)); hbc->add_child(memnew(VSeparator)); @@ -1834,7 +1834,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() { copy->set_theme_type_variation("FlatButton"); hbc->add_child(copy); copy->set_tooltip_text(TTR("Copy Error")); - copy->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_copy)); + copy->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_copy)); hbc->add_child(memnew(VSeparator)); @@ -1843,14 +1843,14 @@ ScriptEditorDebugger::ScriptEditorDebugger() { hbc->add_child(step); step->set_tooltip_text(TTR("Step Into")); step->set_shortcut(ED_GET_SHORTCUT("debugger/step_into")); - step->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_step)); + step->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_step)); next = memnew(Button); next->set_theme_type_variation("FlatButton"); hbc->add_child(next); next->set_tooltip_text(TTR("Step Over")); next->set_shortcut(ED_GET_SHORTCUT("debugger/step_over")); - next->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_next)); + next->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_next)); hbc->add_child(memnew(VSeparator)); @@ -1859,14 +1859,14 @@ ScriptEditorDebugger::ScriptEditorDebugger() { hbc->add_child(dobreak); dobreak->set_tooltip_text(TTR("Break")); dobreak->set_shortcut(ED_GET_SHORTCUT("debugger/break")); - dobreak->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_break)); + dobreak->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_break)); docontinue = memnew(Button); docontinue->set_theme_type_variation("FlatButton"); hbc->add_child(docontinue); docontinue->set_tooltip_text(TTR("Continue")); docontinue->set_shortcut(ED_GET_SHORTCUT("debugger/continue")); - docontinue->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_continue)); + docontinue->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_continue)); HSplitContainer *parent_sc = memnew(HSplitContainer); vbc->add_child(parent_sc); @@ -1952,13 +1952,13 @@ ScriptEditorDebugger::ScriptEditorDebugger() { expand_all_button = memnew(Button); expand_all_button->set_text(TTR("Expand All")); expand_all_button->set_disabled(true); - expand_all_button->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_expand_errors_list)); + expand_all_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_expand_errors_list)); error_hbox->add_child(expand_all_button); collapse_all_button = memnew(Button); collapse_all_button->set_text(TTR("Collapse All")); collapse_all_button->set_disabled(true); - collapse_all_button->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_collapse_errors_list)); + collapse_all_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_collapse_errors_list)); error_hbox->add_child(collapse_all_button); Control *space = memnew(Control); @@ -1969,7 +1969,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() { clear_button->set_text(TTR("Clear")); clear_button->set_h_size_flags(0); clear_button->set_disabled(true); - clear_button->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_clear_errors_list)); + clear_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_clear_errors_list)); error_hbox->add_child(clear_button); error_tree = memnew(Tree); @@ -2044,8 +2044,8 @@ ScriptEditorDebugger::ScriptEditorDebugger() { vmem_export->set_tooltip_text(TTR("Export list to a CSV file")); vmem_hb->add_child(vmem_export); vmem_vb->add_child(vmem_hb); - vmem_refresh->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_video_mem_request)); - vmem_export->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_video_mem_export)); + vmem_refresh->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_video_mem_request)); + vmem_export->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_video_mem_export)); VBoxContainer *vmmc = memnew(VBoxContainer); vmem_tree = memnew(Tree); @@ -2114,7 +2114,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() { HBoxContainer *buttons = memnew(HBoxContainer); export_csv = memnew(Button(TTR("Export measures as CSV"))); - export_csv->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_export_csv)); + export_csv->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_export_csv)); buttons->add_child(export_csv); misc->add_child(buttons); diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 84d6cb67d8..4c21f51e9c 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -266,7 +266,7 @@ DependencyEditor::DependencyEditor() { hbc->add_spacer(); fixdeps = memnew(Button(TTR("Fix Broken"))); hbc->add_child(fixdeps); - fixdeps->connect("pressed", callable_mp(this, &DependencyEditor::_fix_all)); + fixdeps->connect(SceneStringName(pressed), callable_mp(this, &DependencyEditor::_fix_all)); vb->add_child(hbc); diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index f97b2f790f..6893b2878b 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -215,7 +215,7 @@ EditorAbout::EditorAbout() { } version_btn->set_tooltip_text(vformat(TTR("Git commit date: %s\nClick to copy the version number."), build_date)); - version_btn->connect("pressed", callable_mp(this, &EditorAbout::_version_button_pressed)); + version_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorAbout::_version_button_pressed)); version_info_vbc->add_child(version_btn); Label *about_text = memnew(Label); diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 742dec8d69..8f675cf548 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -694,7 +694,7 @@ EditorAssetInstaller::EditorAssetInstaller() { target_dir_button->set_text(TTR("Change Install Folder")); target_dir_button->set_tooltip_text(TTR("Change the folder where the contents of the asset are going to be installed.")); remapping_tools->add_child(target_dir_button); - target_dir_button->connect("pressed", callable_mp(this, &EditorAssetInstaller::_open_target_dir_dialog)); + target_dir_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetInstaller::_open_target_dir_dialog)); remapping_tools->add_child(memnew(VSeparator)); @@ -716,7 +716,7 @@ EditorAssetInstaller::EditorAssetInstaller() { asset_conflicts_link->set_tooltip_text(TTR("Show contents of the asset and conflicting files.")); asset_conflicts_link->set_visible(false); remapping_tools->add_child(asset_conflicts_link); - asset_conflicts_link->connect("pressed", callable_mp(this, &EditorAssetInstaller::_toggle_source_tree).bind(true, true)); + asset_conflicts_link->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetInstaller::_toggle_source_tree).bind(true, true)); // File hierarchy trees. diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 6ac9e3849c..0b5122fce2 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -92,9 +92,9 @@ void EditorAudioBus::_notification(int p_what) { Color bypass_color = EditorThemeManager::is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(1.03, 2.04, 2.35); float darkening_factor = EditorThemeManager::is_dark_theme() ? 0.15 : 0.65; - Ref<StyleBoxFlat>(solo->get_theme_stylebox("pressed"))->set_border_color(solo_color.darkened(darkening_factor)); - Ref<StyleBoxFlat>(mute->get_theme_stylebox("pressed"))->set_border_color(mute_color.darkened(darkening_factor)); - Ref<StyleBoxFlat>(bypass->get_theme_stylebox("pressed"))->set_border_color(bypass_color.darkened(darkening_factor)); + Ref<StyleBoxFlat>(solo->get_theme_stylebox(SceneStringName(pressed)))->set_border_color(solo_color.darkened(darkening_factor)); + Ref<StyleBoxFlat>(mute->get_theme_stylebox(SceneStringName(pressed)))->set_border_color(mute_color.darkened(darkening_factor)); + Ref<StyleBoxFlat>(bypass->get_theme_stylebox(SceneStringName(pressed)))->set_border_color(bypass_color.darkened(darkening_factor)); solo->set_icon(get_editor_theme_icon(SNAME("AudioBusSolo"))); solo->add_theme_color_override("icon_pressed_color", solo_color); @@ -815,21 +815,21 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { solo->set_toggle_mode(true); solo->set_tooltip_text(TTR("Solo")); solo->set_focus_mode(FOCUS_NONE); - solo->connect("pressed", callable_mp(this, &EditorAudioBus::_solo_toggled)); + solo->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_solo_toggled)); hbc->add_child(solo); mute = memnew(Button); mute->set_theme_type_variation("FlatButton"); mute->set_toggle_mode(true); mute->set_tooltip_text(TTR("Mute")); mute->set_focus_mode(FOCUS_NONE); - mute->connect("pressed", callable_mp(this, &EditorAudioBus::_mute_toggled)); + mute->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_mute_toggled)); hbc->add_child(mute); bypass = memnew(Button); bypass->set_theme_type_variation("FlatButton"); bypass->set_toggle_mode(true); bypass->set_tooltip_text(TTR("Bypass")); bypass->set_focus_mode(FOCUS_NONE); - bypass->connect("pressed", callable_mp(this, &EditorAudioBus::_bypass_toggled)); + bypass->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_bypass_toggled)); hbc->add_child(bypass); hbc->add_spacer(); @@ -845,7 +845,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { sbflat->set_content_margin_all(0); sbflat->set_bg_color(Color(1, 1, 1, 0)); sbflat->set_border_width(Side::SIDE_BOTTOM, Math::round(3 * EDSCALE)); - child->add_theme_style_override("pressed", sbflat); + child->add_theme_style_override(SceneStringName(pressed), sbflat); child->end_bulk_theme_override(); } @@ -1313,7 +1313,7 @@ EditorAudioBuses::EditorAudioBuses() { top_hb->add_child(add); add->set_text(TTR("Add Bus")); add->set_tooltip_text(TTR("Add a new Audio Bus to this layout.")); - add->connect("pressed", callable_mp(this, &EditorAudioBuses::_add_bus)); + add->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_add_bus)); VSeparator *separator = memnew(VSeparator); top_hb->add_child(separator); @@ -1322,25 +1322,25 @@ EditorAudioBuses::EditorAudioBuses() { load->set_text(TTR("Load")); load->set_tooltip_text(TTR("Load an existing Bus Layout.")); top_hb->add_child(load); - load->connect("pressed", callable_mp(this, &EditorAudioBuses::_load_layout)); + load->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_load_layout)); save_as = memnew(Button); save_as->set_text(TTR("Save As")); save_as->set_tooltip_text(TTR("Save this Bus Layout to a file.")); top_hb->add_child(save_as); - save_as->connect("pressed", callable_mp(this, &EditorAudioBuses::_save_as_layout)); + save_as->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_save_as_layout)); _default = memnew(Button); _default->set_text(TTR("Load Default")); _default->set_tooltip_text(TTR("Load the default Bus Layout.")); top_hb->add_child(_default); - _default->connect("pressed", callable_mp(this, &EditorAudioBuses::_load_default_layout)); + _default->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_load_default_layout)); _new = memnew(Button); _new->set_text(TTR("Create")); _new->set_tooltip_text(TTR("Create a new Bus Layout.")); top_hb->add_child(_new); - _new->connect("pressed", callable_mp(this, &EditorAudioBuses::_new_layout)); + _new->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_new_layout)); bus_scroll = memnew(ScrollContainer); bus_scroll->set_v_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index b0571a62c1..a5c4831db7 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -900,7 +900,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() { browse_button = memnew(Button); hbc->add_child(browse_button); - browse_button->connect("pressed", callable_mp(this, &EditorAutoloadSettings::_browse_autoload_add_path)); + browse_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAutoloadSettings::_browse_autoload_add_path)); file_dialog = memnew(EditorFileDialog); hbc->add_child(file_dialog); @@ -924,7 +924,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() { add_autoload = memnew(Button); add_autoload->set_text(TTR("Add")); - add_autoload->connect("pressed", callable_mp(this, &EditorAutoloadSettings::_autoload_add)); + add_autoload->connect(SceneStringName(pressed), callable_mp(this, &EditorAutoloadSettings::_autoload_add)); // The button will be enabled once a valid name is entered (either automatically or manually). add_autoload->set_disabled(true); hbc->add_child(add_autoload); diff --git a/editor/editor_build_profile.cpp b/editor/editor_build_profile.cpp index c1db674cbe..799bda78ab 100644 --- a/editor/editor_build_profile.cpp +++ b/editor/editor_build_profile.cpp @@ -816,19 +816,19 @@ EditorBuildProfileManager::EditorBuildProfileManager() { profile_actions[ACTION_NEW] = memnew(Button(TTR("New"))); path_hbc->add_child(profile_actions[ACTION_NEW]); - profile_actions[ACTION_NEW]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_NEW)); + profile_actions[ACTION_NEW]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_NEW)); profile_actions[ACTION_LOAD] = memnew(Button(TTR("Load"))); path_hbc->add_child(profile_actions[ACTION_LOAD]); - profile_actions[ACTION_LOAD]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_LOAD)); + profile_actions[ACTION_LOAD]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_LOAD)); profile_actions[ACTION_SAVE] = memnew(Button(TTR("Save"))); path_hbc->add_child(profile_actions[ACTION_SAVE]); - profile_actions[ACTION_SAVE]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_SAVE)); + profile_actions[ACTION_SAVE]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_SAVE)); profile_actions[ACTION_SAVE_AS] = memnew(Button(TTR("Save As"))); path_hbc->add_child(profile_actions[ACTION_SAVE_AS]); - profile_actions[ACTION_SAVE_AS]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_SAVE_AS)); + profile_actions[ACTION_SAVE_AS]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_SAVE_AS)); main_vbc->add_margin_child(TTR("Profile:"), path_hbc); @@ -838,11 +838,11 @@ EditorBuildProfileManager::EditorBuildProfileManager() { profile_actions[ACTION_RESET] = memnew(Button(TTR("Reset to Defaults"))); profiles_hbc->add_child(profile_actions[ACTION_RESET]); - profile_actions[ACTION_RESET]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_RESET)); + profile_actions[ACTION_RESET]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_RESET)); profile_actions[ACTION_DETECT] = memnew(Button(TTR("Detect from Project"))); profiles_hbc->add_child(profile_actions[ACTION_DETECT]); - profile_actions[ACTION_DETECT]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_DETECT)); + profile_actions[ACTION_DETECT]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_DETECT)); main_vbc->add_margin_child(TTR("Actions:"), profiles_hbc); diff --git a/editor/editor_dock_manager.cpp b/editor/editor_dock_manager.cpp index 4ba7832e76..a261b4088a 100644 --- a/editor/editor_dock_manager.cpp +++ b/editor/editor_dock_manager.cpp @@ -1073,7 +1073,7 @@ DockContextPopup::DockContextPopup() { tab_move_left_button = memnew(Button); tab_move_left_button->set_flat(true); tab_move_left_button->set_focus_mode(Control::FOCUS_NONE); - tab_move_left_button->connect("pressed", callable_mp(this, &DockContextPopup::_tab_move_left)); + tab_move_left_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_tab_move_left)); header_hb->add_child(tab_move_left_button); Label *position_label = memnew(Label); @@ -1085,7 +1085,7 @@ DockContextPopup::DockContextPopup() { tab_move_right_button = memnew(Button); tab_move_right_button->set_flat(true); tab_move_right_button->set_focus_mode(Control::FOCUS_NONE); - tab_move_right_button->connect("pressed", callable_mp(this, &DockContextPopup::_tab_move_right)); + tab_move_right_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_tab_move_right)); header_hb->add_child(tab_move_right_button); dock_select_popup_vb->add_child(header_hb); @@ -1108,7 +1108,7 @@ DockContextPopup::DockContextPopup() { } make_float_button->set_focus_mode(Control::FOCUS_NONE); make_float_button->set_h_size_flags(Control::SIZE_EXPAND_FILL); - make_float_button->connect("pressed", callable_mp(this, &DockContextPopup::_float_dock)); + make_float_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_float_dock)); dock_select_popup_vb->add_child(make_float_button); dock_to_bottom_button = memnew(Button); @@ -1116,7 +1116,7 @@ DockContextPopup::DockContextPopup() { dock_to_bottom_button->set_tooltip_text(TTR("Move this dock to the bottom panel.")); dock_to_bottom_button->set_focus_mode(Control::FOCUS_NONE); dock_to_bottom_button->set_h_size_flags(Control::SIZE_EXPAND_FILL); - dock_to_bottom_button->connect("pressed", callable_mp(this, &DockContextPopup::_move_dock_to_bottom)); + dock_to_bottom_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_move_dock_to_bottom)); dock_to_bottom_button->hide(); dock_select_popup_vb->add_child(dock_to_bottom_button); @@ -1125,6 +1125,6 @@ DockContextPopup::DockContextPopup() { close_button->set_tooltip_text(TTR("Close this dock.")); close_button->set_focus_mode(Control::FOCUS_NONE); close_button->set_h_size_flags(Control::SIZE_EXPAND_FILL); - close_button->connect("pressed", callable_mp(this, &DockContextPopup::_close_dock)); + close_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_close_dock)); dock_select_popup_vb->add_child(close_button); } diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 86b7b3eb2f..5a7e914c11 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -915,7 +915,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { profile_actions[PROFILE_CLEAR] = memnew(Button(TTR("Reset to Default"))); name_hbc->add_child(profile_actions[PROFILE_CLEAR]); profile_actions[PROFILE_CLEAR]->set_disabled(true); - profile_actions[PROFILE_CLEAR]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_CLEAR)); + profile_actions[PROFILE_CLEAR]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_CLEAR)); main_vbc->add_margin_child(TTR("Current Profile:"), name_hbc); @@ -930,12 +930,12 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { profile_actions[PROFILE_NEW] = memnew(Button(TTR("Create Profile"))); profiles_hbc->add_child(profile_actions[PROFILE_NEW]); - profile_actions[PROFILE_NEW]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_NEW)); + profile_actions[PROFILE_NEW]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_NEW)); profile_actions[PROFILE_ERASE] = memnew(Button(TTR("Remove Profile"))); profiles_hbc->add_child(profile_actions[PROFILE_ERASE]); profile_actions[PROFILE_ERASE]->set_disabled(true); - profile_actions[PROFILE_ERASE]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_ERASE)); + profile_actions[PROFILE_ERASE]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_ERASE)); main_vbc->add_margin_child(TTR("Available Profiles:"), profiles_hbc); @@ -944,18 +944,18 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { profile_actions[PROFILE_SET] = memnew(Button(TTR("Make Current"))); current_profile_hbc->add_child(profile_actions[PROFILE_SET]); profile_actions[PROFILE_SET]->set_disabled(true); - profile_actions[PROFILE_SET]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_SET)); + profile_actions[PROFILE_SET]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_SET)); current_profile_hbc->add_child(memnew(VSeparator)); profile_actions[PROFILE_IMPORT] = memnew(Button(TTR("Import"))); current_profile_hbc->add_child(profile_actions[PROFILE_IMPORT]); - profile_actions[PROFILE_IMPORT]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_IMPORT)); + profile_actions[PROFILE_IMPORT]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_IMPORT)); profile_actions[PROFILE_EXPORT] = memnew(Button(TTR("Export"))); current_profile_hbc->add_child(profile_actions[PROFILE_EXPORT]); profile_actions[PROFILE_EXPORT]->set_disabled(true); - profile_actions[PROFILE_EXPORT]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_EXPORT)); + profile_actions[PROFILE_EXPORT]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_EXPORT)); main_vbc->add_child(current_profile_hbc); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 960ccd4455..a8d978c66d 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -3117,7 +3117,7 @@ EditorHelp::EditorHelp() { toggle_scripts_button = memnew(Button); toggle_scripts_button->set_flat(true); - toggle_scripts_button->connect("pressed", callable_mp(this, &EditorHelp::_toggle_scripts_pressed)); + toggle_scripts_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelp::_toggle_scripts_pressed)); status_bar->add_child(toggle_scripts_button); class_desc->set_selection_enabled(true); @@ -4043,13 +4043,13 @@ FindBar::FindBar() { find_prev->set_flat(true); add_child(find_prev); find_prev->set_focus_mode(FOCUS_NONE); - find_prev->connect("pressed", callable_mp(this, &FindBar::search_prev)); + find_prev->connect(SceneStringName(pressed), callable_mp(this, &FindBar::search_prev)); find_next = memnew(Button); find_next->set_flat(true); add_child(find_next); find_next->set_focus_mode(FOCUS_NONE); - find_next->connect("pressed", callable_mp(this, &FindBar::search_next)); + find_next->connect(SceneStringName(pressed), callable_mp(this, &FindBar::search_next)); Control *space = memnew(Control); add_child(space); @@ -4060,7 +4060,7 @@ FindBar::FindBar() { hide_button->set_focus_mode(FOCUS_NONE); hide_button->set_ignore_texture_size(true); hide_button->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED); - hide_button->connect("pressed", callable_mp(this, &FindBar::_hide_bar)); + hide_button->connect(SceneStringName(pressed), callable_mp(this, &FindBar::_hide_bar)); } void FindBar::popup_search() { diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 0a6802fb7c..f42cc62fe2 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -323,7 +323,7 @@ EditorHelpSearch::EditorHelpSearch() { case_sensitive_button = memnew(Button); case_sensitive_button->set_theme_type_variation("FlatButton"); case_sensitive_button->set_tooltip_text(TTR("Case Sensitive")); - case_sensitive_button->connect("pressed", callable_mp(this, &EditorHelpSearch::_update_results)); + case_sensitive_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelpSearch::_update_results)); case_sensitive_button->set_toggle_mode(true); case_sensitive_button->set_focus_mode(Control::FOCUS_NONE); hbox->add_child(case_sensitive_button); @@ -331,7 +331,7 @@ EditorHelpSearch::EditorHelpSearch() { hierarchy_button = memnew(Button); hierarchy_button->set_theme_type_variation("FlatButton"); hierarchy_button->set_tooltip_text(TTR("Show Hierarchy")); - hierarchy_button->connect("pressed", callable_mp(this, &EditorHelpSearch::_update_results)); + hierarchy_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelpSearch::_update_results)); hierarchy_button->set_toggle_mode(true); hierarchy_button->set_pressed(true); hierarchy_button->set_focus_mode(Control::FOCUS_NONE); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index e427e3f3ac..8e608fb797 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2203,7 +2203,7 @@ void EditorInspectorArray::_setup() { if (element_position > 0) { ae.move_up = memnew(Button); ae.move_up->set_icon(get_editor_theme_icon(SNAME("MoveUp"))); - ae.move_up->connect("pressed", callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position - 1)); + ae.move_up->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position - 1)); move_vbox->add_child(ae.move_up); } @@ -2219,7 +2219,7 @@ void EditorInspectorArray::_setup() { if (element_position < _get_array_count() - 1) { ae.move_down = memnew(Button); ae.move_down->set_icon(get_editor_theme_icon(SNAME("MoveDown"))); - ae.move_down->connect("pressed", callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position + 2)); + ae.move_down->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position + 2)); move_vbox->add_child(ae.move_down); } } @@ -2243,7 +2243,7 @@ void EditorInspectorArray::_setup() { ae.erase = memnew(Button); ae.erase->set_icon(get_editor_theme_icon(SNAME("Remove"))); ae.erase->set_v_size_flags(SIZE_SHRINK_CENTER); - ae.erase->connect("pressed", callable_mp(this, &EditorInspectorArray::_remove_item).bind(element_position)); + ae.erase->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_remove_item).bind(element_position)); ae.hbox->add_child(ae.erase); } @@ -2433,7 +2433,7 @@ EditorInspectorArray::EditorInspectorArray(bool p_read_only) { vbox->add_child(elements_vbox); add_button = EditorInspector::create_inspector_action_button(TTR("Add Element")); - add_button->connect("pressed", callable_mp(this, &EditorInspectorArray::_add_button_pressed)); + add_button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_add_button_pressed)); add_button->set_disabled(read_only); vbox->add_child(add_button); @@ -2528,12 +2528,12 @@ EditorPaginator::EditorPaginator() { first_page_button = memnew(Button); first_page_button->set_flat(true); - first_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_first_page_button_pressed)); + first_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_first_page_button_pressed)); add_child(first_page_button); prev_page_button = memnew(Button); prev_page_button->set_flat(true); - prev_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_prev_page_button_pressed)); + prev_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_prev_page_button_pressed)); add_child(prev_page_button); page_line_edit = memnew(LineEdit); @@ -2546,12 +2546,12 @@ EditorPaginator::EditorPaginator() { next_page_button = memnew(Button); next_page_button->set_flat(true); - next_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_next_page_button_pressed)); + next_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_next_page_button_pressed)); add_child(next_page_button); last_page_button = memnew(Button); last_page_button->set_flat(true); - last_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_last_page_button_pressed)); + last_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_last_page_button_pressed)); add_child(last_page_button); } @@ -3465,7 +3465,7 @@ void EditorInspector::update_tree() { Button *add_md = EditorInspector::create_inspector_action_button(TTR("Add Metadata")); add_md->set_icon(get_editor_theme_icon(SNAME("Add"))); - add_md->connect(SNAME("pressed"), callable_mp(this, &EditorInspector::_show_add_meta_dialog)); + add_md->connect(SceneStringName(pressed), callable_mp(this, &EditorInspector::_show_add_meta_dialog)); main_vbox->add_child(add_md); if (all_read_only) { add_md->set_disabled(true); diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index ab4950f01b..6615133dea 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -483,7 +483,7 @@ EditorLog::EditorLog() { clear_button->set_theme_type_variation("FlatButton"); clear_button->set_focus_mode(FOCUS_NONE); clear_button->set_shortcut(ED_SHORTCUT("editor/clear_output", TTR("Clear Output"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::K)); - clear_button->connect("pressed", callable_mp(this, &EditorLog::_clear_request)); + clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorLog::_clear_request)); hb_tools->add_child(clear_button); // Copy. @@ -492,7 +492,7 @@ EditorLog::EditorLog() { copy_button->set_focus_mode(FOCUS_NONE); copy_button->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KeyModifierMask::CMD_OR_CTRL | Key::C)); copy_button->set_shortcut_context(this); - copy_button->connect("pressed", callable_mp(this, &EditorLog::_copy_request)); + copy_button->connect(SceneStringName(pressed), callable_mp(this, &EditorLog::_copy_request)); hb_tools->add_child(copy_button); // Separate toggle buttons from normal buttons. diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 5702751f17..26110fbe51 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -521,7 +521,7 @@ void EditorNode::_update_theme(bool p_skip_creation) { scene_root_parent->add_theme_style_override("panel", theme->get_stylebox(SNAME("Content"), EditorStringName(EditorStyles))); bottom_panel->add_theme_style_override("panel", theme->get_stylebox(SNAME("BottomPanel"), EditorStringName(EditorStyles))); distraction_free->set_icon(theme->get_icon(SNAME("DistractionFree"), EditorStringName(EditorIcons))); - distraction_free->add_theme_style_override("pressed", theme->get_stylebox("normal", "FlatMenuButton")); + distraction_free->add_theme_style_override(SceneStringName(pressed), theme->get_stylebox("normal", "FlatMenuButton")); help_menu->set_item_icon(help_menu->get_item_index(HELP_SEARCH), theme->get_icon(SNAME("HelpSearch"), EditorStringName(EditorIcons))); help_menu->set_item_icon(help_menu->get_item_index(HELP_COPY_SYSTEM_INFO), theme->get_icon(SNAME("ActionCopy"), EditorStringName(EditorIcons))); @@ -3468,7 +3468,7 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed icon->connect_changed(callable_mp((Control *)tb, &Control::update_minimum_size)); } - tb->connect("pressed", callable_mp(singleton, &EditorNode::editor_select).bind(singleton->main_editor_buttons.size())); + tb->connect(SceneStringName(pressed), callable_mp(singleton, &EditorNode::editor_select).bind(singleton->main_editor_buttons.size())); singleton->main_editor_buttons.push_back(tb); singleton->main_editor_button_hb->add_child(tb); @@ -3498,8 +3498,8 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor, bool p_config_chan break; } else { - singleton->main_editor_buttons[i]->disconnect("pressed", callable_mp(singleton, &EditorNode::editor_select)); - singleton->main_editor_buttons[i]->connect("pressed", callable_mp(singleton, &EditorNode::editor_select).bind(i - 1)); + singleton->main_editor_buttons[i]->disconnect(SceneStringName(pressed), callable_mp(singleton, &EditorNode::editor_select)); + singleton->main_editor_buttons[i]->connect(SceneStringName(pressed), callable_mp(singleton, &EditorNode::editor_select).bind(i - 1)); } } @@ -6652,7 +6652,7 @@ EditorNode::EditorNode() { distraction_free->set_tooltip_text(TTR("Toggle distraction-free mode.")); distraction_free->set_toggle_mode(true); scene_tabs->add_extra_button(distraction_free); - distraction_free->connect("pressed", callable_mp(this, &EditorNode::_toggle_distraction_free_mode)); + distraction_free->connect(SceneStringName(pressed), callable_mp(this, &EditorNode::_toggle_distraction_free_mode)); scene_root_parent = memnew(PanelContainer); scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE); @@ -7135,7 +7135,7 @@ EditorNode::EditorNode() { gradle_build_manage_templates = memnew(ConfirmationDialog); gradle_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates.")); gradle_build_manage_templates->set_ok_button_text(TTR("Manage Templates")); - gradle_build_manage_templates->add_button(TTR("Install from file"))->connect("pressed", callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_INSTALL_ANDROID_BUILD_TEMPLATE)); + gradle_build_manage_templates->add_button(TTR("Install from file"))->connect(SceneStringName(pressed), callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_INSTALL_ANDROID_BUILD_TEMPLATE)); gradle_build_manage_templates->connect("confirmed", callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_MANAGE_EXPORT_TEMPLATES)); gui_base->add_child(gradle_build_manage_templates); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 3195b99f76..49b30bd06e 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -235,7 +235,7 @@ EditorPropertyMultilineText::EditorPropertyMultilineText(bool p_expression) { text->set_h_size_flags(SIZE_EXPAND_FILL); open_big_text = memnew(Button); open_big_text->set_flat(true); - open_big_text->connect("pressed", callable_mp(this, &EditorPropertyMultilineText::_open_big_text)); + open_big_text->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyMultilineText::_open_big_text)); hb->add_child(open_big_text); big_text_dialog = nullptr; big_text = nullptr; @@ -382,7 +382,7 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() { edit_button->set_flat(true); edit_button->hide(); default_layout->add_child(edit_button); - edit_button->connect("pressed", callable_mp(this, &EditorPropertyTextEnum::_edit_custom_value)); + edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyTextEnum::_edit_custom_value)); custom_value_edit = memnew(LineEdit); custom_value_edit->set_h_size_flags(SIZE_EXPAND_FILL); @@ -392,12 +392,12 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() { accept_button = memnew(Button); accept_button->set_flat(true); edit_custom_layout->add_child(accept_button); - accept_button->connect("pressed", callable_mp(this, &EditorPropertyTextEnum::_custom_value_accepted)); + accept_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyTextEnum::_custom_value_accepted)); cancel_button = memnew(Button); cancel_button->set_flat(true); edit_custom_layout->add_child(cancel_button); - cancel_button->connect("pressed", callable_mp(this, &EditorPropertyTextEnum::_custom_value_canceled)); + cancel_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyTextEnum::_custom_value_canceled)); add_focusable(option_button); add_focusable(edit_button); @@ -464,7 +464,7 @@ EditorPropertyLocale::EditorPropertyLocale() { locale_hb->add_child(locale_edit); add_focusable(locale); dialog = nullptr; - locale_edit->connect("pressed", callable_mp(this, &EditorPropertyLocale::_locale_pressed)); + locale_edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLocale::_locale_pressed)); } ///////////////////// PATH ///////////////////////// @@ -605,7 +605,7 @@ EditorPropertyPath::EditorPropertyPath() { path_hb->add_child(path_edit); add_focusable(path); dialog = nullptr; - path_edit->connect("pressed", callable_mp(this, &EditorPropertyPath::_path_pressed)); + path_edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyPath::_path_pressed)); } ///////////////////// CLASS NAME ///////////////////////// @@ -646,7 +646,7 @@ EditorPropertyClassName::EditorPropertyClassName() { add_child(property); add_focusable(property); property->set_text(selected_type); - property->connect("pressed", callable_mp(this, &EditorPropertyClassName::_property_selected)); + property->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyClassName::_property_selected)); dialog = memnew(CreateDialog); dialog->set_base_type(base_type); dialog->connect("create", callable_mp(this, &EditorPropertyClassName::_dialog_created)); @@ -677,7 +677,7 @@ EditorPropertyCheck::EditorPropertyCheck() { checkbox->set_text(TTR("On")); add_child(checkbox); add_focusable(checkbox); - checkbox->connect("pressed", callable_mp(this, &EditorPropertyCheck::_checkbox_pressed)); + checkbox->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyCheck::_checkbox_pressed)); } ///////////////////// ENUM ///////////////////////// @@ -791,7 +791,7 @@ void EditorPropertyFlags::setup(const Vector<String> &p_options) { CheckBox *cb = memnew(CheckBox); cb->set_text(text_split[0]); cb->set_clip_text(true); - cb->connect("pressed", callable_mp(this, &EditorPropertyFlags::_flag_toggled).bind(flag_index)); + cb->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyFlags::_flag_toggled).bind(flag_index)); add_focusable(cb); vbox->add_child(cb); flags.push_back(cb); @@ -1296,7 +1296,7 @@ EditorPropertyLayers::EditorPropertyLayers() { button = memnew(TextureButton); button->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED); button->set_toggle_mode(true); - button->connect("pressed", callable_mp(this, &EditorPropertyLayers::_button_pressed)); + button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLayers::_button_pressed)); hb->add_child(button); set_bottom_editor(hb); @@ -1393,7 +1393,7 @@ EditorPropertyObjectID::EditorPropertyObjectID() { add_child(edit); add_focusable(edit); edit->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS); - edit->connect("pressed", callable_mp(this, &EditorPropertyObjectID::_edit_pressed)); + edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyObjectID::_edit_pressed)); } ///////////////////// SIGNAL ///////////////////////// @@ -1420,7 +1420,7 @@ EditorPropertySignal::EditorPropertySignal() { edit = memnew(Button); add_child(edit); add_focusable(edit); - edit->connect("pressed", callable_mp(this, &EditorPropertySignal::_edit_pressed)); + edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertySignal::_edit_pressed)); } ///////////////////// CALLABLE ///////////////////////// @@ -2154,7 +2154,7 @@ EditorPropertyQuaternion::EditorPropertyQuaternion() { warning = memnew(Button); warning->set_text(TTR("Temporary Euler may be changed implicitly!")); warning->set_clip_text(true); - warning->connect("pressed", callable_mp(this, &EditorPropertyQuaternion::_warning_pressed)); + warning->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyQuaternion::_warning_pressed)); warning_dialog = memnew(AcceptDialog); add_child(warning_dialog); warning_dialog->set_text(TTR("Temporary Euler will not be stored in the object with the original value. Instead, it will be stored as Quaternion with irreversible conversion.\nThis is due to the fact that the result of Euler->Quaternion can be determined uniquely, but the result of Quaternion->Euler can be multi-existent.")); @@ -2182,7 +2182,7 @@ EditorPropertyQuaternion::EditorPropertyQuaternion() { edit_button->set_flat(true); edit_button->set_toggle_mode(true); default_layout->add_child(edit_button); - edit_button->connect("pressed", callable_mp(this, &EditorPropertyQuaternion::_edit_custom_value)); + edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyQuaternion::_edit_custom_value)); add_focusable(edit_button); @@ -2981,7 +2981,7 @@ EditorPropertyNodePath::EditorPropertyNodePath() { assign->set_clip_text(true); assign->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); assign->set_expand_icon(true); - assign->connect("pressed", callable_mp(this, &EditorPropertyNodePath::_node_assign)); + assign->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyNodePath::_node_assign)); SET_DRAG_FORWARDING_CD(assign, EditorPropertyNodePath); hbc->add_child(assign); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 4c75f12952..ca1070d7f3 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -287,13 +287,13 @@ void EditorPropertyArray::_create_new_property_slot() { Button *edit_btn = memnew(Button); edit_btn->set_icon(get_editor_theme_icon(SNAME("Edit"))); edit_btn->set_disabled(is_read_only()); - edit_btn->connect("pressed", callable_mp(this, &EditorPropertyArray::_change_type).bind(edit_btn, idx)); + edit_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_change_type).bind(edit_btn, idx)); hbox->add_child(edit_btn); } else { Button *remove_btn = memnew(Button); remove_btn->set_icon(get_editor_theme_icon(SNAME("Remove"))); remove_btn->set_disabled(is_read_only()); - remove_btn->connect("pressed", callable_mp(this, &EditorPropertyArray::_remove_pressed).bind(idx)); + remove_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_remove_pressed).bind(idx)); hbox->add_child(remove_btn); } property_vbox->add_child(hbox); @@ -383,7 +383,7 @@ void EditorPropertyArray::update_property() { button_add_item = EditorInspector::create_inspector_action_button(TTR("Add Element")); button_add_item->set_icon(get_editor_theme_icon(SNAME("Add"))); - button_add_item->connect(SNAME("pressed"), callable_mp(this, &EditorPropertyArray::_add_element)); + button_add_item->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_add_element)); button_add_item->set_disabled(is_read_only()); vbox->add_child(button_add_item); @@ -829,7 +829,7 @@ EditorPropertyArray::EditorPropertyArray() { edit = memnew(Button); edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->set_clip_text(true); - edit->connect("pressed", callable_mp(this, &EditorPropertyArray::_edit_pressed)); + edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_edit_pressed)); edit->set_toggle_mode(true); SET_DRAG_FORWARDING_CD(edit, EditorPropertyArray); edit->connect(SceneStringName(draw), callable_mp(this, &EditorPropertyArray::_button_draw)); @@ -901,7 +901,7 @@ void EditorPropertyDictionary::_create_new_property_slot(int p_idx) { Button *edit_btn = memnew(Button); edit_btn->set_icon(get_editor_theme_icon(SNAME("Edit"))); edit_btn->set_disabled(is_read_only()); - edit_btn->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_change_type).bind(edit_btn, slots.size())); + edit_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyDictionary::_change_type).bind(edit_btn, slots.size())); hbox->add_child(edit_btn); if (add_panel) { add_panel->get_child(0)->add_child(hbox); @@ -1011,7 +1011,7 @@ void EditorPropertyDictionary::update_property() { button_add_item = EditorInspector::create_inspector_action_button(TTR("Add Key/Value Pair")); button_add_item->set_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); button_add_item->set_disabled(is_read_only()); - button_add_item->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_add_key_value)); + button_add_item->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyDictionary::_add_key_value)); add_vbox->add_child(button_add_item); } @@ -1143,7 +1143,7 @@ EditorPropertyDictionary::EditorPropertyDictionary() { edit = memnew(Button); edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->set_clip_text(true); - edit->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_edit_pressed)); + edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyDictionary::_edit_pressed)); edit->set_toggle_mode(true); add_child(edit); add_focusable(edit); @@ -1290,7 +1290,7 @@ void EditorPropertyLocalizableString::update_property() { Button *edit_btn = memnew(Button); edit_btn->set_icon(get_editor_theme_icon(SNAME("Remove"))); hbox->add_child(edit_btn); - edit_btn->connect("pressed", callable_mp(this, &EditorPropertyLocalizableString::_remove_item).bind(edit_btn, remove_index)); + edit_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLocalizableString::_remove_item).bind(edit_btn, remove_index)); prop->update_property(); } @@ -1298,7 +1298,7 @@ void EditorPropertyLocalizableString::update_property() { if (page_index == max_page) { button_add_item = EditorInspector::create_inspector_action_button(TTR("Add Translation")); button_add_item->set_icon(get_editor_theme_icon(SNAME("Add"))); - button_add_item->connect("pressed", callable_mp(this, &EditorPropertyLocalizableString::_add_locale_popup)); + button_add_item->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLocalizableString::_add_locale_popup)); property_vbox->add_child(button_add_item); } @@ -1358,7 +1358,7 @@ EditorPropertyLocalizableString::EditorPropertyLocalizableString() { edit = memnew(Button); edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->set_clip_text(true); - edit->connect("pressed", callable_mp(this, &EditorPropertyLocalizableString::_edit_pressed)); + edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLocalizableString::_edit_pressed)); edit->set_toggle_mode(true); add_child(edit); add_focusable(edit); diff --git a/editor/editor_properties_vector.cpp b/editor/editor_properties_vector.cpp index 46bfb69e29..de7de9337f 100644 --- a/editor/editor_properties_vector.cpp +++ b/editor/editor_properties_vector.cpp @@ -230,7 +230,7 @@ EditorPropertyVectorN::EditorPropertyVectorN(Variant::Type p_type, bool p_force_ linked->set_toggle_mode(true); linked->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED); linked->set_tooltip_text(TTR("Lock/Unlock Component Ratio")); - linked->connect(SNAME("pressed"), callable_mp(this, &EditorPropertyVectorN::_update_ratio)); + linked->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyVectorN::_update_ratio)); linked->connect(SNAME("toggled"), callable_mp(this, &EditorPropertyVectorN::_store_link)); hb->add_child(linked); diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index ef4469623c..50820ac12f 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -1043,7 +1043,7 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) { assign_button->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); SET_DRAG_FORWARDING_GCD(assign_button, EditorResourcePicker); add_child(assign_button); - assign_button->connect("pressed", callable_mp(this, &EditorResourcePicker::_resource_selected)); + assign_button->connect(SceneStringName(pressed), callable_mp(this, &EditorResourcePicker::_resource_selected)); assign_button->connect(SceneStringName(draw), callable_mp(this, &EditorResourcePicker::_button_draw)); assign_button->connect(SceneStringName(gui_input), callable_mp(this, &EditorResourcePicker::_button_input)); @@ -1061,7 +1061,7 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) { edit_button = memnew(Button); edit_button->set_flat(true); edit_button->set_toggle_mode(true); - edit_button->connect("pressed", callable_mp(this, &EditorResourcePicker::_update_menu)); + edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorResourcePicker::_update_menu)); add_child(edit_button); edit_button->connect(SceneStringName(gui_input), callable_mp(this, &EditorResourcePicker::_button_input)); diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 37210714f1..2c6c13401f 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -747,12 +747,12 @@ EditorSettingsDialog::EditorSettingsDialog() { restart_hb->add_child(restart_label); restart_hb->add_spacer(); Button *restart_button = memnew(Button); - restart_button->connect("pressed", callable_mp(this, &EditorSettingsDialog::_editor_restart)); + restart_button->connect(SceneStringName(pressed), callable_mp(this, &EditorSettingsDialog::_editor_restart)); restart_hb->add_child(restart_button); restart_button->set_text(TTR("Save & Restart")); restart_close_button = memnew(Button); restart_close_button->set_flat(true); - restart_close_button->connect("pressed", callable_mp(this, &EditorSettingsDialog::_editor_restart_close)); + restart_close_button->connect(SceneStringName(pressed), callable_mp(this, &EditorSettingsDialog::_editor_restart_close)); restart_hb->add_child(restart_close_button); restart_container->hide(); @@ -784,8 +784,8 @@ EditorSettingsDialog::EditorSettingsDialog() { Button *clear_all_search = memnew(Button); clear_all_search->set_text(TTR("Clear All")); - clear_all_search->connect("pressed", callable_mp(shortcut_search_box, &LineEdit::clear)); - clear_all_search->connect("pressed", callable_mp(shortcut_search_by_event, &EventListenerLineEdit::clear_event)); + clear_all_search->connect(SceneStringName(pressed), callable_mp(shortcut_search_box, &LineEdit::clear)); + clear_all_search->connect(SceneStringName(pressed), callable_mp(shortcut_search_by_event, &EventListenerLineEdit::clear_event)); top_hbox->add_child(clear_all_search); shortcuts = memnew(Tree); diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp index 9fad872a3b..339a6e4b7f 100644 --- a/editor/export/export_template_manager.cpp +++ b/editor/export/export_template_manager.cpp @@ -928,13 +928,13 @@ ExportTemplateManager::ExportTemplateManager() { current_open_button->set_text(TTR("Open Folder")); current_open_button->set_tooltip_text(TTR("Open the folder containing installed templates for the current version.")); current_installed_hb->add_child(current_open_button); - current_open_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_open_template_folder).bind(VERSION_FULL_CONFIG)); + current_open_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_open_template_folder).bind(VERSION_FULL_CONFIG)); current_uninstall_button = memnew(Button); current_uninstall_button->set_text(TTR("Uninstall")); current_uninstall_button->set_tooltip_text(TTR("Uninstall templates for the current version.")); current_installed_hb->add_child(current_uninstall_button); - current_uninstall_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_uninstall_template).bind(VERSION_FULL_CONFIG)); + current_uninstall_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_uninstall_template).bind(VERSION_FULL_CONFIG)); main_vb->add_child(memnew(HSeparator)); @@ -981,7 +981,7 @@ ExportTemplateManager::ExportTemplateManager() { download_current_button->set_text(TTR("Download and Install")); download_current_button->set_tooltip_text(TTR("Download and install templates for the current version from the best possible mirror.")); download_install_hb->add_child(download_current_button); - download_current_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_download_current)); + download_current_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_download_current)); // Update downloads buttons to prevent unsupported downloads. if (!downloads_available) { @@ -997,7 +997,7 @@ ExportTemplateManager::ExportTemplateManager() { install_file_button->set_text(TTR("Install from File")); install_file_button->set_tooltip_text(TTR("Install templates from a local file.")); install_file_hb->add_child(install_file_button); - install_file_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_install_file)); + install_file_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_install_file)); // Templates are being downloaded; buttons unavailable. download_progress_hb = memnew(HBoxContainer); @@ -1023,7 +1023,7 @@ ExportTemplateManager::ExportTemplateManager() { download_cancel_button->set_text(TTR("Cancel")); download_cancel_button->set_tooltip_text(TTR("Cancel the download of the templates.")); download_progress_hb->add_child(download_cancel_button); - download_cancel_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_cancel_template_download)); + download_cancel_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_cancel_template_download)); download_templates = memnew(HTTPRequest); install_templates_hb->add_child(download_templates); diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 1da75ff88f..c6a671b7f9 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -88,7 +88,7 @@ ProjectExportTextureFormatError::ProjectExportTextureFormatError() { fix_texture_format_button->set_v_size_flags(Control::SIZE_SHRINK_CENTER); fix_texture_format_button->set_text(TTR("Fix Import")); add_child(fix_texture_format_button); - fix_texture_format_button->connect("pressed", callable_mp(this, &ProjectExportTextureFormatError::_on_fix_texture_format_pressed)); + fix_texture_format_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportTextureFormatError::_on_fix_texture_format_pressed)); } void ProjectExportDialog::_notification(int p_what) { @@ -1251,12 +1251,12 @@ ProjectExportDialog::ProjectExportDialog() { duplicate_preset->set_tooltip_text(TTR("Duplicate")); duplicate_preset->set_flat(true); preset_hb->add_child(duplicate_preset); - duplicate_preset->connect("pressed", callable_mp(this, &ProjectExportDialog::_duplicate_preset)); + duplicate_preset->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_duplicate_preset)); delete_preset = memnew(Button); delete_preset->set_tooltip_text(TTR("Delete")); delete_preset->set_flat(true); preset_hb->add_child(delete_preset); - delete_preset->connect("pressed", callable_mp(this, &ProjectExportDialog::_delete_preset)); + delete_preset->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_delete_preset)); // Preset settings. @@ -1271,12 +1271,12 @@ ProjectExportDialog::ProjectExportDialog() { runnable = memnew(CheckButton); runnable->set_text(TTR("Runnable")); runnable->set_tooltip_text(TTR("If checked, the preset will be available for use in one-click deploy.\nOnly one preset per platform may be marked as runnable.")); - runnable->connect("pressed", callable_mp(this, &ProjectExportDialog::_runnable_pressed)); + runnable->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_runnable_pressed)); advanced_options = memnew(CheckButton); advanced_options->set_text(TTR("Advanced Options")); advanced_options->set_tooltip_text(TTR("If checked, the advanced options will be shown.")); - advanced_options->connect("pressed", callable_mp(this, &ProjectExportDialog::_advanced_options_pressed)); + advanced_options->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_advanced_options_pressed)); HBoxContainer *preset_configs_container = memnew(HBoxContainer); preset_configs_container->add_spacer(true); @@ -1434,7 +1434,7 @@ ProjectExportDialog::ProjectExportDialog() { LinkButton *sec_more_info = memnew(LinkButton); sec_more_info->set_text(TTR("More Info...")); - sec_more_info->connect("pressed", callable_mp(this, &ProjectExportDialog::_open_key_help_link)); + sec_more_info->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_open_key_help_link)); sec_vb->add_child(sec_more_info); // Script export parameters. @@ -1484,7 +1484,7 @@ ProjectExportDialog::ProjectExportDialog() { export_button = add_button(TTR("Export Project..."), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "export"); export_button->set_tooltip_text(TTR("Export the project as a playable build (Godot executable and project data) for the selected preset.")); #endif - export_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_project)); + export_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_export_project)); // Disable initially before we select a valid preset export_button->set_disabled(true); @@ -1504,7 +1504,7 @@ ProjectExportDialog::ProjectExportDialog() { #else export_all_button = add_button(TTR("Export All..."), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "export"); #endif - export_all_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_all_dialog)); + export_all_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_export_all_dialog)); export_all_button->set_disabled(true); export_pck_zip = memnew(EditorFileDialog); @@ -1554,7 +1554,7 @@ ProjectExportDialog::ProjectExportDialog() { download_templates->set_text(TTR("Manage Export Templates")); download_templates->set_v_size_flags(Control::SIZE_SHRINK_CENTER); export_templates_error->add_child(download_templates); - download_templates->connect("pressed", callable_mp(this, &ProjectExportDialog::_open_export_template_manager)); + download_templates->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_open_export_template_manager)); // Export project file dialog. diff --git a/editor/fbx_importer_manager.cpp b/editor/fbx_importer_manager.cpp index 2049ac9344..f9673771e1 100644 --- a/editor/fbx_importer_manager.cpp +++ b/editor/fbx_importer_manager.cpp @@ -153,7 +153,7 @@ FBXImporterManager::FBXImporterManager() { hb->add_child(fbx_path); fbx_path_browse = memnew(Button); fbx_path_browse->set_text(TTR("Browse")); - fbx_path_browse->connect("pressed", callable_mp(this, &FBXImporterManager::_browse_install)); + fbx_path_browse->connect(SceneStringName(pressed), callable_mp(this, &FBXImporterManager::_browse_install)); hb->add_child(fbx_path_browse); hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); hb->set_custom_minimum_size(Size2(400 * EDSCALE, 0)); @@ -168,7 +168,7 @@ FBXImporterManager::FBXImporterManager() { fbx_path->connect("text_changed", callable_mp(this, &FBXImporterManager::_validate_path)); get_ok_button()->set_text(TTR("Confirm Path")); - get_cancel_button()->connect("pressed", callable_mp(this, &FBXImporterManager::_cancel_setup)); + get_cancel_button()->connect(SceneStringName(pressed), callable_mp(this, &FBXImporterManager::_cancel_setup)); browse_dialog = memnew(EditorFileDialog); browse_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index b087f4e64e..b05cafa694 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -538,10 +538,10 @@ void FileSystemDock::_notification(int p_what) { EditorFileSystem::get_singleton()->connect("filesystem_changed", callable_mp(this, &FileSystemDock::_fs_changed)); EditorResourcePreview::get_singleton()->connect("preview_invalidated", callable_mp(this, &FileSystemDock::_preview_invalidated)); - button_file_list_display_mode->connect("pressed", callable_mp(this, &FileSystemDock::_toggle_file_display)); + button_file_list_display_mode->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_toggle_file_display)); files->connect("item_activated", callable_mp(this, &FileSystemDock::_file_list_activate_file)); - button_hist_next->connect("pressed", callable_mp(this, &FileSystemDock::_fw_history)); - button_hist_prev->connect("pressed", callable_mp(this, &FileSystemDock::_bw_history)); + button_hist_next->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_fw_history)); + button_hist_prev->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_bw_history)); file_list_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_file_list_rmb_option)); tree_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_tree_rmb_option)); current_path_line_edit->connect("text_submitted", callable_mp(this, &FileSystemDock::_navigate_to_path).bind(false)); @@ -3959,14 +3959,14 @@ FileSystemDock::FileSystemDock() { toolbar_hbc->add_child(current_path_line_edit); button_reload = memnew(Button); - button_reload->connect("pressed", callable_mp(this, &FileSystemDock::_rescan)); + button_reload->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_rescan)); button_reload->set_focus_mode(FOCUS_NONE); button_reload->set_tooltip_text(TTR("Re-Scan Filesystem")); button_reload->hide(); toolbar_hbc->add_child(button_reload); button_toggle_display_mode = memnew(Button); - button_toggle_display_mode->connect("pressed", callable_mp(this, &FileSystemDock::_change_split_mode)); + button_toggle_display_mode->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_change_split_mode)); button_toggle_display_mode->set_focus_mode(FOCUS_NONE); button_toggle_display_mode->set_tooltip_text(TTR("Change Split Mode")); button_toggle_display_mode->set_theme_type_variation("FlatMenuButton"); @@ -3974,7 +3974,7 @@ FileSystemDock::FileSystemDock() { button_dock_placement = memnew(Button); button_dock_placement->set_flat(true); - button_dock_placement->connect("pressed", callable_mp(this, &FileSystemDock::_change_bottom_dock_placement)); + button_dock_placement->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_change_bottom_dock_placement)); button_dock_placement->hide(); toolbar_hbc->add_child(button_dock_placement); @@ -4093,7 +4093,7 @@ FileSystemDock::FileSystemDock() { overwrite_dialog = memnew(ConfirmationDialog); add_child(overwrite_dialog); overwrite_dialog->set_ok_button_text(TTR("Overwrite")); - overwrite_dialog->add_button(TTR("Keep Both"), true)->connect("pressed", callable_mp(this, &FileSystemDock::_overwrite_dialog_action).bind(false)); + overwrite_dialog->add_button(TTR("Keep Both"), true)->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_overwrite_dialog_action).bind(false)); overwrite_dialog->connect("confirmed", callable_mp(this, &FileSystemDock::_overwrite_dialog_action).bind(true)); VBoxContainer *overwrite_dialog_vb = memnew(VBoxContainer); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 87c23564ee..e9edcab52f 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -367,7 +367,7 @@ FindInFilesDialog::FindInFilesDialog() { Button *folder_button = memnew(Button); folder_button->set_text("..."); - folder_button->connect("pressed", callable_mp(this, &FindInFilesDialog::_on_folder_button_pressed)); + folder_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesDialog::_on_folder_button_pressed)); hbc->add_child(folder_button); _folder_dialog = memnew(FileDialog); @@ -603,19 +603,19 @@ FindInFilesPanel::FindInFilesPanel() { _refresh_button = memnew(Button); _refresh_button->set_text(TTR("Refresh")); - _refresh_button->connect("pressed", callable_mp(this, &FindInFilesPanel::_on_refresh_button_clicked)); + _refresh_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesPanel::_on_refresh_button_clicked)); _refresh_button->hide(); hbc->add_child(_refresh_button); _cancel_button = memnew(Button); _cancel_button->set_text(TTR("Cancel")); - _cancel_button->connect("pressed", callable_mp(this, &FindInFilesPanel::_on_cancel_button_clicked)); + _cancel_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesPanel::_on_cancel_button_clicked)); _cancel_button->hide(); hbc->add_child(_cancel_button); _close_button = memnew(Button); _close_button->set_text(TTR("Close")); - _close_button->connect("pressed", callable_mp(this, &FindInFilesPanel::_on_close_button_clicked)); + _close_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesPanel::_on_close_button_clicked)); hbc->add_child(_close_button); vbc->add_child(hbc); @@ -649,7 +649,7 @@ FindInFilesPanel::FindInFilesPanel() { _replace_all_button = memnew(Button); _replace_all_button->set_text(TTR("Replace all (no undo)")); - _replace_all_button->connect("pressed", callable_mp(this, &FindInFilesPanel::_on_replace_all_clicked)); + _replace_all_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesPanel::_on_replace_all_clicked)); _replace_container->add_child(_replace_all_button); _replace_container->hide(); diff --git a/editor/group_settings_editor.cpp b/editor/group_settings_editor.cpp index a7cfa0d6f4..981a847428 100644 --- a/editor/group_settings_editor.cpp +++ b/editor/group_settings_editor.cpp @@ -516,7 +516,7 @@ GroupSettingsEditor::GroupSettingsEditor() { add_button = memnew(Button); add_button->set_text(TTR("Add")); add_button->set_disabled(true); - add_button->connect("pressed", callable_mp(this, &GroupSettingsEditor::_add_group)); + add_button->connect(SceneStringName(pressed), callable_mp(this, &GroupSettingsEditor::_add_group)); hbc->add_child(add_button); tree = memnew(Tree); diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index daa014bfac..fc2ea80be9 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -836,7 +836,7 @@ GroupsEditor::GroupsEditor() { add = memnew(Button); add->set_flat(true); add->set_tooltip_text(TTR("Add a new group.")); - add->connect("pressed", callable_mp(this, &GroupsEditor::_show_add_group_dialog)); + add->connect(SceneStringName(pressed), callable_mp(this, &GroupsEditor::_show_add_group_dialog)); hbc->add_child(add); filter = memnew(LineEdit); diff --git a/editor/gui/editor_bottom_panel.cpp b/editor/gui/editor_bottom_panel.cpp index b575910976..3dbefa5cbc 100644 --- a/editor/gui/editor_bottom_panel.cpp +++ b/editor/gui/editor_bottom_panel.cpp @@ -265,7 +265,7 @@ EditorBottomPanel::EditorBottomPanel() { build_date = TTR("(unknown)"); } version_btn->set_tooltip_text(vformat(TTR("Git commit date: %s\nClick to copy the version information."), build_date)); - version_btn->connect("pressed", callable_mp(this, &EditorBottomPanel::_version_button_pressed)); + version_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorBottomPanel::_version_button_pressed)); version_btn->set_v_size_flags(Control::SIZE_SHRINK_CENTER); bottom_hbox->add_child(version_btn); diff --git a/editor/gui/editor_dir_dialog.cpp b/editor/gui/editor_dir_dialog.cpp index 08612f419c..e64761d5b5 100644 --- a/editor/gui/editor_dir_dialog.cpp +++ b/editor/gui/editor_dir_dialog.cpp @@ -213,7 +213,7 @@ EditorDirDialog::EditorDirDialog() { makedir = memnew(Button(TTR("Create Folder"))); hb->add_child(makedir); - makedir->connect("pressed", callable_mp(this, &EditorDirDialog::_make_dir)); + makedir->connect(SceneStringName(pressed), callable_mp(this, &EditorDirDialog::_make_dir)); tree = memnew(Tree); vb->add_child(tree); @@ -224,7 +224,7 @@ EditorDirDialog::EditorDirDialog() { set_ok_button_text(TTR("Move")); copy = add_button(TTR("Copy"), !DisplayServer::get_singleton()->get_swap_cancel_ok()); - copy->connect("pressed", callable_mp(this, &EditorDirDialog::_copy_pressed)); + copy->connect(SceneStringName(pressed), callable_mp(this, &EditorDirDialog::_copy_pressed)); makedialog = memnew(DirectoryCreateDialog); add_child(makedialog); diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp index 08e75ee812..8883c0b9af 100644 --- a/editor/gui/editor_file_dialog.cpp +++ b/editor/gui/editor_file_dialog.cpp @@ -2109,9 +2109,9 @@ EditorFileDialog::EditorFileDialog() { pathhb->add_child(dir_next); pathhb->add_child(dir_up); - dir_prev->connect("pressed", callable_mp(this, &EditorFileDialog::_go_back)); - dir_next->connect("pressed", callable_mp(this, &EditorFileDialog::_go_forward)); - dir_up->connect("pressed", callable_mp(this, &EditorFileDialog::_go_up)); + dir_prev->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_go_back)); + dir_next->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_go_forward)); + dir_up->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_go_up)); Label *l = memnew(Label(TTR("Path:"))); l->set_theme_type_variation("HeaderSmall"); @@ -2128,14 +2128,14 @@ EditorFileDialog::EditorFileDialog() { refresh = memnew(Button); refresh->set_theme_type_variation("FlatButton"); refresh->set_tooltip_text(TTR("Refresh files.")); - refresh->connect("pressed", callable_mp(this, &EditorFileDialog::update_file_list)); + refresh->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::update_file_list)); pathhb->add_child(refresh); favorite = memnew(Button); favorite->set_theme_type_variation("FlatButton"); favorite->set_toggle_mode(true); favorite->set_tooltip_text(TTR("(Un)favorite current folder.")); - favorite->connect("pressed", callable_mp(this, &EditorFileDialog::_favorite_pressed)); + favorite->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_pressed)); pathhb->add_child(favorite); show_hidden = memnew(Button); @@ -2153,7 +2153,7 @@ EditorFileDialog::EditorFileDialog() { mode_thumbnails = memnew(Button); mode_thumbnails->set_theme_type_variation("FlatButton"); - mode_thumbnails->connect("pressed", callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_THUMBNAILS)); + mode_thumbnails->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_THUMBNAILS)); mode_thumbnails->set_toggle_mode(true); mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS); mode_thumbnails->set_button_group(view_mode_group); @@ -2162,7 +2162,7 @@ EditorFileDialog::EditorFileDialog() { mode_list = memnew(Button); mode_list->set_theme_type_variation("FlatButton"); - mode_list->connect("pressed", callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_LIST)); + mode_list->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_LIST)); mode_list->set_toggle_mode(true); mode_list->set_pressed(display_mode == DISPLAY_LIST); mode_list->set_button_group(view_mode_group); @@ -2181,7 +2181,7 @@ EditorFileDialog::EditorFileDialog() { makedir = memnew(Button); makedir->set_theme_type_variation("FlatButton"); makedir->set_tooltip_text(TTR("Create a new folder.")); - makedir->connect("pressed", callable_mp(this, &EditorFileDialog::_make_dir)); + makedir->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_make_dir)); pathhb->add_child(makedir); body_hsplit = memnew(HSplitContainer); @@ -2215,11 +2215,11 @@ EditorFileDialog::EditorFileDialog() { fav_up = memnew(Button); fav_up->set_theme_type_variation("FlatButton"); fav_hb->add_child(fav_up); - fav_up->connect("pressed", callable_mp(this, &EditorFileDialog::_favorite_move_up)); + fav_up->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_move_up)); fav_down = memnew(Button); fav_down->set_theme_type_variation("FlatButton"); fav_hb->add_child(fav_down); - fav_down->connect("pressed", callable_mp(this, &EditorFileDialog::_favorite_move_down)); + fav_down->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_move_down)); favorites = memnew(ItemList); favorites->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); diff --git a/editor/gui/editor_object_selector.cpp b/editor/gui/editor_object_selector.cpp index 862ecc0a68..a713aa1ecd 100644 --- a/editor/gui/editor_object_selector.cpp +++ b/editor/gui/editor_object_selector.cpp @@ -211,7 +211,7 @@ void EditorObjectSelector::_notification(int p_what) { } break; case NOTIFICATION_READY: { - connect("pressed", callable_mp(this, &EditorObjectSelector::_show_popup)); + connect(SceneStringName(pressed), callable_mp(this, &EditorObjectSelector::_show_popup)); } break; } } diff --git a/editor/gui/editor_run_bar.cpp b/editor/gui/editor_run_bar.cpp index a44dfc9858..31331126b2 100644 --- a/editor/gui/editor_run_bar.cpp +++ b/editor/gui/editor_run_bar.cpp @@ -376,7 +376,7 @@ EditorRunBar::EditorRunBar() { play_button->set_toggle_mode(true); play_button->set_focus_mode(Control::FOCUS_NONE); play_button->set_tooltip_text(TTR("Run the project's default scene.")); - play_button->connect("pressed", callable_mp(this, &EditorRunBar::play_main_scene).bind(false)); + play_button->connect(SceneStringName(pressed), callable_mp(this, &EditorRunBar::play_main_scene).bind(false)); ED_SHORTCUT_AND_COMMAND("editor/run_project", TTR("Run Project"), Key::F5); ED_SHORTCUT_OVERRIDE("editor/run_project", "macos", KeyModifierMask::META | Key::B); @@ -400,7 +400,7 @@ EditorRunBar::EditorRunBar() { stop_button->set_focus_mode(Control::FOCUS_NONE); stop_button->set_tooltip_text(TTR("Stop the currently running project.")); stop_button->set_disabled(true); - stop_button->connect("pressed", callable_mp(this, &EditorRunBar::stop_playing)); + stop_button->connect(SceneStringName(pressed), callable_mp(this, &EditorRunBar::stop_playing)); ED_SHORTCUT("editor/stop_running_project", TTR("Stop Running Project"), Key::F8); ED_SHORTCUT_OVERRIDE("editor/stop_running_project", "macos", KeyModifierMask::META | Key::PERIOD); @@ -416,7 +416,7 @@ EditorRunBar::EditorRunBar() { play_scene_button->set_toggle_mode(true); play_scene_button->set_focus_mode(Control::FOCUS_NONE); play_scene_button->set_tooltip_text(TTR("Run the currently edited scene.")); - play_scene_button->connect("pressed", callable_mp(this, &EditorRunBar::_play_current_pressed)); + play_scene_button->connect(SceneStringName(pressed), callable_mp(this, &EditorRunBar::_play_current_pressed)); ED_SHORTCUT_AND_COMMAND("editor/run_current_scene", TTR("Run Current Scene"), Key::F6); ED_SHORTCUT_OVERRIDE("editor/run_current_scene", "macos", KeyModifierMask::META | Key::R); @@ -428,7 +428,7 @@ EditorRunBar::EditorRunBar() { play_custom_scene_button->set_toggle_mode(true); play_custom_scene_button->set_focus_mode(Control::FOCUS_NONE); play_custom_scene_button->set_tooltip_text(TTR("Run a specific scene.")); - play_custom_scene_button->connect("pressed", callable_mp(this, &EditorRunBar::_play_custom_pressed)); + play_custom_scene_button->connect(SceneStringName(pressed), callable_mp(this, &EditorRunBar::_play_custom_pressed)); ED_SHORTCUT_AND_COMMAND("editor/run_specific_scene", TTR("Run Specific Scene"), KeyModifierMask::CTRL | KeyModifierMask::SHIFT | Key::F5); ED_SHORTCUT_OVERRIDE("editor/run_specific_scene", "macos", KeyModifierMask::META | KeyModifierMask::SHIFT | Key::R); diff --git a/editor/gui/editor_scene_tabs.cpp b/editor/gui/editor_scene_tabs.cpp index f39e2adcb1..f1ca59e0ac 100644 --- a/editor/gui/editor_scene_tabs.cpp +++ b/editor/gui/editor_scene_tabs.cpp @@ -415,7 +415,7 @@ EditorSceneTabs::EditorSceneTabs() { scene_tab_add->set_flat(true); scene_tab_add->set_tooltip_text(TTR("Add a new scene.")); scene_tabs->add_child(scene_tab_add); - scene_tab_add->connect("pressed", callable_mp(EditorNode::get_singleton(), &EditorNode::trigger_menu_option).bind(EditorNode::FILE_NEW_SCENE, false)); + scene_tab_add->connect(SceneStringName(pressed), callable_mp(EditorNode::get_singleton(), &EditorNode::trigger_menu_option).bind(EditorNode::FILE_NEW_SCENE, false)); scene_tab_add_ph = memnew(Control); scene_tab_add_ph->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); diff --git a/editor/gui/editor_toaster.cpp b/editor/gui/editor_toaster.cpp index e857a82fa5..7aa5335b77 100644 --- a/editor/gui/editor_toaster.cpp +++ b/editor/gui/editor_toaster.cpp @@ -376,7 +376,7 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_ Button *close_button = memnew(Button); close_button->set_flat(true); close_button->set_icon(get_editor_theme_icon(SNAME("Close"))); - close_button->connect("pressed", callable_mp(this, &EditorToaster::close).bind(panel)); + close_button->connect(SceneStringName(pressed), callable_mp(this, &EditorToaster::close).bind(panel)); close_button->connect(SceneStringName(theme_changed), callable_mp(this, &EditorToaster::_close_button_theme_changed).bind(close_button)); hbox_container->add_child(close_button); } @@ -544,8 +544,8 @@ EditorToaster::EditorToaster() { main_button->set_modulate(Color(0.5, 0.5, 0.5)); main_button->set_disabled(true); main_button->set_theme_type_variation("FlatMenuButton"); - main_button->connect("pressed", callable_mp(this, &EditorToaster::_set_notifications_enabled).bind(true)); - main_button->connect("pressed", callable_mp(this, &EditorToaster::_repop_old)); + main_button->connect(SceneStringName(pressed), callable_mp(this, &EditorToaster::_set_notifications_enabled).bind(true)); + main_button->connect(SceneStringName(pressed), callable_mp(this, &EditorToaster::_repop_old)); main_button->connect(SceneStringName(draw), callable_mp(this, &EditorToaster::_draw_button)); add_child(main_button); @@ -558,7 +558,7 @@ EditorToaster::EditorToaster() { disable_notifications_button = memnew(Button); disable_notifications_button->set_tooltip_text(TTR("Silence the notifications.")); disable_notifications_button->set_flat(true); - disable_notifications_button->connect("pressed", callable_mp(this, &EditorToaster::_set_notifications_enabled).bind(false)); + disable_notifications_button->connect(SceneStringName(pressed), callable_mp(this, &EditorToaster::_set_notifications_enabled).bind(false)); disable_notifications_panel->add_child(disable_notifications_button); // Other diff --git a/editor/gui/editor_zoom_widget.cpp b/editor/gui/editor_zoom_widget.cpp index 6db4c5047e..e3d8d4b224 100644 --- a/editor/gui/editor_zoom_widget.cpp +++ b/editor/gui/editor_zoom_widget.cpp @@ -199,7 +199,7 @@ EditorZoomWidget::EditorZoomWidget() { zoom_minus->set_shortcut_context(this); zoom_minus->set_focus_mode(FOCUS_NONE); add_child(zoom_minus); - zoom_minus->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_minus)); + zoom_minus->connect(SceneStringName(pressed), callable_mp(this, &EditorZoomWidget::_button_zoom_minus)); zoom_reset = memnew(Button); zoom_reset->set_flat(true); @@ -208,7 +208,7 @@ EditorZoomWidget::EditorZoomWidget() { zoom_reset->add_theme_style_override("normal", empty_stylebox); zoom_reset->add_theme_style_override("hover", empty_stylebox); zoom_reset->add_theme_style_override("focus", empty_stylebox); - zoom_reset->add_theme_style_override("pressed", empty_stylebox); + zoom_reset->add_theme_style_override(SceneStringName(pressed), empty_stylebox); zoom_reset->add_theme_constant_override("outline_size", Math::ceil(2 * EDSCALE)); zoom_reset->add_theme_color_override("font_outline_color", Color(0, 0, 0)); zoom_reset->add_theme_color_override("font_color", Color(1, 1, 1)); @@ -220,7 +220,7 @@ EditorZoomWidget::EditorZoomWidget() { // Prevent the button's size from changing when the text size changes zoom_reset->set_custom_minimum_size(Size2(56 * EDSCALE, 0)); add_child(zoom_reset); - zoom_reset->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_reset)); + zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &EditorZoomWidget::_button_zoom_reset)); zoom_plus = memnew(Button); zoom_plus->set_flat(true); @@ -228,7 +228,7 @@ EditorZoomWidget::EditorZoomWidget() { zoom_plus->set_shortcut_context(this); zoom_plus->set_focus_mode(FOCUS_NONE); add_child(zoom_plus); - zoom_plus->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_plus)); + zoom_plus->connect(SceneStringName(pressed), callable_mp(this, &EditorZoomWidget::_button_zoom_plus)); _update_zoom_label(); diff --git a/editor/import/3d/scene_import_settings.cpp b/editor/import/3d/scene_import_settings.cpp index ff5eb670af..4c78c620c1 100644 --- a/editor/import/3d/scene_import_settings.cpp +++ b/editor/import/3d/scene_import_settings.cpp @@ -1263,7 +1263,7 @@ void SceneImportSettingsDialog::_notification(int p_what) { action_menu->begin_bulk_theme_override(); action_menu->add_theme_style_override("normal", get_theme_stylebox("normal", "Button")); action_menu->add_theme_style_override("hover", get_theme_stylebox("hover", "Button")); - action_menu->add_theme_style_override("pressed", get_theme_stylebox("pressed", "Button")); + action_menu->add_theme_style_override(SceneStringName(pressed), get_theme_stylebox(SceneStringName(pressed), "Button")); action_menu->end_bulk_theme_override(); if (animation_player != nullptr && animation_player->is_playing()) { @@ -1649,13 +1649,13 @@ SceneImportSettingsDialog::SceneImportSettingsDialog() { animation_play_button->set_flat(true); animation_play_button->set_focus_mode(Control::FOCUS_NONE); animation_play_button->set_shortcut(ED_SHORTCUT("scene_import_settings/play_selected_animation", TTR("Selected Animation Play/Pause"), Key::SPACE)); - animation_play_button->connect(SNAME("pressed"), callable_mp(this, &SceneImportSettingsDialog::_play_animation)); + animation_play_button->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_play_animation)); animation_stop_button = memnew(Button); animation_hbox->add_child(animation_stop_button); animation_stop_button->set_flat(true); animation_stop_button->set_focus_mode(Control::FOCUS_NONE); - animation_stop_button->connect(SNAME("pressed"), callable_mp(this, &SceneImportSettingsDialog::_stop_current_animation)); + animation_stop_button->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_stop_current_animation)); animation_slider = memnew(HSlider); animation_hbox->add_child(animation_slider); @@ -1684,7 +1684,7 @@ SceneImportSettingsDialog::SceneImportSettingsDialog() { light_rotate_switch->set_toggle_mode(true); light_rotate_switch->set_pressed(true); light_rotate_switch->set_tooltip_text(TTR("Rotate Lights With Model")); - light_rotate_switch->connect("pressed", callable_mp(this, &SceneImportSettingsDialog::_on_light_rotate_switch_pressed)); + light_rotate_switch->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_on_light_rotate_switch_pressed)); vb_light->add_child(light_rotate_switch); light_1_switch = memnew(Button); @@ -1692,7 +1692,7 @@ SceneImportSettingsDialog::SceneImportSettingsDialog() { light_1_switch->set_toggle_mode(true); light_1_switch->set_pressed(true); light_1_switch->set_tooltip_text(TTR("Primary Light")); - light_1_switch->connect("pressed", callable_mp(this, &SceneImportSettingsDialog::_on_light_1_switch_pressed)); + light_1_switch->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_on_light_1_switch_pressed)); vb_light->add_child(light_1_switch); light_2_switch = memnew(Button); @@ -1700,7 +1700,7 @@ SceneImportSettingsDialog::SceneImportSettingsDialog() { light_2_switch->set_toggle_mode(true); light_2_switch->set_pressed(true); light_2_switch->set_tooltip_text(TTR("Secondary Light")); - light_2_switch->connect("pressed", callable_mp(this, &SceneImportSettingsDialog::_on_light_2_switch_pressed)); + light_2_switch->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_on_light_2_switch_pressed)); vb_light->add_child(light_2_switch); camera = memnew(Camera3D); diff --git a/editor/import/audio_stream_import_settings.cpp b/editor/import/audio_stream_import_settings.cpp index a342da4bcf..6353e63695 100644 --- a/editor/import/audio_stream_import_settings.cpp +++ b/editor/import/audio_stream_import_settings.cpp @@ -618,9 +618,9 @@ AudioStreamImportSettingsDialog::AudioStreamImportSettingsDialog() { zoom_hbox->add_child(zoom_out); zoom_hbox->add_child(zoom_reset); zoom_hbox->add_child(zoom_in); - zoom_in->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_in)); - zoom_reset->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_reset)); - zoom_out->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_out)); + zoom_in->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_in)); + zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_reset)); + zoom_out->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_out)); zoom_bar->connect("value_changed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_offset_changed)); vbox->add_child(zoom_hbox); @@ -639,13 +639,13 @@ AudioStreamImportSettingsDialog::AudioStreamImportSettingsDialog() { _play_button->set_flat(true); hbox->add_child(_play_button); _play_button->set_focus_mode(Control::FOCUS_NONE); - _play_button->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_play)); + _play_button->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_play)); _stop_button = memnew(Button); _stop_button->set_flat(true); hbox->add_child(_stop_button); _stop_button->set_focus_mode(Control::FOCUS_NONE); - _stop_button->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_stop)); + _stop_button->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_stop)); _current_label = memnew(Label); _current_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index f2096c362e..aad7302ec5 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -1372,7 +1372,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { add_var = memnew(Button); add_var->set_tooltip_text(TTR("Add configuration")); page2_hb_vars->add_child(add_var); - add_var->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_add)); + add_var->connect(SceneStringName(pressed), callable_mp(this, &DynamicFontImportSettingsDialog::_variation_add)); vars_list = memnew(Tree); vars_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); @@ -1414,7 +1414,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { Button *btn_clear = memnew(Button); btn_clear->set_text(TTR("Clear Glyph List")); gl_hb->add_child(btn_clear); - btn_clear->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_clear)); + btn_clear->connect(SceneStringName(pressed), callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_clear)); VBoxContainer *page2_0_vb = memnew(VBoxContainer); page2_0_vb->set_name(TTR("Glyphs from the Translations")); @@ -1446,7 +1446,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { btn_fill_locales = memnew(Button); btn_fill_locales->set_text(TTR("Shape all Strings in the Translations and Add Glyphs")); locale_hb->add_child(btn_fill_locales); - btn_fill_locales->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_process_locales)); + btn_fill_locales->connect(SceneStringName(pressed), callable_mp(this, &DynamicFontImportSettingsDialog::_process_locales)); // Page 2.1 layout: Text to select glyphs VBoxContainer *page2_1_vb = memnew(VBoxContainer); @@ -1484,7 +1484,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { btn_fill = memnew(Button); btn_fill->set_text(TTR("Shape Text and Add Glyphs")); text_hb->add_child(btn_fill); - btn_fill->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_text_selected)); + btn_fill->connect(SceneStringName(pressed), callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_text_selected)); // Page 2.2 layout: Character map VBoxContainer *page2_2_vb = memnew(VBoxContainer); diff --git a/editor/import_defaults_editor.cpp b/editor/import_defaults_editor.cpp index 968f2a8915..ab7988109f 100644 --- a/editor/import_defaults_editor.cpp +++ b/editor/import_defaults_editor.cpp @@ -211,7 +211,7 @@ ImportDefaultsEditor::ImportDefaultsEditor() { reset_defaults = memnew(Button); reset_defaults->set_text(TTR("Reset to Defaults")); reset_defaults->set_disabled(true); - reset_defaults->connect("pressed", callable_mp(this, &ImportDefaultsEditor::_reset)); + reset_defaults->connect(SceneStringName(pressed), callable_mp(this, &ImportDefaultsEditor::_reset)); hb->add_child(reset_defaults); add_child(hb); @@ -225,7 +225,7 @@ ImportDefaultsEditor::ImportDefaultsEditor() { CenterContainer *cc = memnew(CenterContainer); save_defaults = memnew(Button); save_defaults->set_text(TTR("Save")); - save_defaults->connect("pressed", callable_mp(this, &ImportDefaultsEditor::_save)); + save_defaults->connect(SceneStringName(pressed), callable_mp(this, &ImportDefaultsEditor::_save)); cc->add_child(save_defaults); add_child(cc); diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index e12f74eb64..fbe76e1d5c 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -798,7 +798,7 @@ ImportDock::ImportDock() { import = memnew(Button); import->set_text(TTR("Reimport")); import->set_disabled(true); - import->connect("pressed", callable_mp(this, &ImportDock::_reimport_pressed)); + import->connect(SceneStringName(pressed), callable_mp(this, &ImportDock::_reimport_pressed)); if (!DisplayServer::get_singleton()->get_swap_cancel_ok()) { advanced_spacer = hb->add_spacer(); advanced = memnew(Button); @@ -818,7 +818,7 @@ ImportDock::ImportDock() { advanced->hide(); advanced_spacer->hide(); - advanced->connect("pressed", callable_mp(this, &ImportDock::_advanced_options)); + advanced->connect(SceneStringName(pressed), callable_mp(this, &ImportDock::_advanced_options)); reimport_confirm = memnew(ConfirmationDialog); content->add_child(reimport_confirm); diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 2965a8a904..5455933809 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -649,14 +649,14 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) { resource_new_button->set_theme_type_variation("FlatMenuButton"); resource_new_button->set_tooltip_text(TTR("Create a new resource in memory and edit it.")); general_options_hb->add_child(resource_new_button); - resource_new_button->connect("pressed", callable_mp(this, &InspectorDock::_new_resource)); + resource_new_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_new_resource)); resource_new_button->set_focus_mode(Control::FOCUS_NONE); resource_load_button = memnew(Button); resource_load_button->set_theme_type_variation("FlatMenuButton"); resource_load_button->set_tooltip_text(TTR("Load an existing resource from disk and edit it.")); general_options_hb->add_child(resource_load_button); - resource_load_button->connect("pressed", callable_mp(this, &InspectorDock::_open_resource_selector)); + resource_load_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_open_resource_selector)); resource_load_button->set_focus_mode(Control::FOCUS_NONE); resource_save_button = memnew(MenuButton); @@ -692,14 +692,14 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) { general_options_hb->add_child(backward_button); backward_button->set_tooltip_text(TTR("Go to previous edited object in history.")); backward_button->set_disabled(true); - backward_button->connect("pressed", callable_mp(this, &InspectorDock::_edit_back)); + backward_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_edit_back)); forward_button = memnew(Button); forward_button->set_flat(true); general_options_hb->add_child(forward_button); forward_button->set_tooltip_text(TTR("Go to next edited object in history.")); forward_button->set_disabled(true); - forward_button->connect("pressed", callable_mp(this, &InspectorDock::_edit_forward)); + forward_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_edit_forward)); history_menu = memnew(MenuButton); history_menu->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); @@ -722,7 +722,7 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) { open_docs_button->set_tooltip_text(TTR("Open documentation for this object.")); open_docs_button->set_shortcut(ED_SHORTCUT("property_editor/open_help", TTR("Open Documentation"))); subresource_hb->add_child(open_docs_button); - open_docs_button->connect("pressed", callable_mp(this, &InspectorDock::_menu_option).bind(OBJECT_REQUEST_HELP)); + open_docs_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_menu_option).bind(OBJECT_REQUEST_HELP)); new_resource_dialog = memnew(CreateDialog); EditorNode::get_singleton()->get_gui_base()->add_child(new_resource_dialog); @@ -751,7 +751,7 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) { add_child(info); info->set_clip_text(true); info->hide(); - info->connect("pressed", callable_mp(this, &InspectorDock::_info_pressed)); + info->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_info_pressed)); unique_resources_confirmation = memnew(ConfirmationDialog); add_child(unique_resources_confirmation); diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index eb7f508695..11d1b3e089 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -626,7 +626,7 @@ LocalizationEditor::LocalizationEditor() { tvb->add_child(thb); Button *addtr = memnew(Button(TTR("Add..."))); - addtr->connect("pressed", callable_mp(this, &LocalizationEditor::_translation_file_open)); + addtr->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_translation_file_open)); thb->add_child(addtr); VBoxContainer *tmc = memnew(VBoxContainer); @@ -660,7 +660,7 @@ LocalizationEditor::LocalizationEditor() { tvb->add_child(thb); Button *addtr = memnew(Button(TTR("Add..."))); - addtr->connect("pressed", callable_mp(this, &LocalizationEditor::_translation_res_file_open)); + addtr->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_translation_res_file_open)); thb->add_child(addtr); VBoxContainer *tmc = memnew(VBoxContainer); @@ -686,7 +686,7 @@ LocalizationEditor::LocalizationEditor() { tvb->add_child(thb); addtr = memnew(Button(TTR("Add..."))); - addtr->connect("pressed", callable_mp(this, &LocalizationEditor::_translation_res_option_file_open)); + addtr->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_translation_res_option_file_open)); translation_res_option_add_button = addtr; thb->add_child(addtr); @@ -729,11 +729,11 @@ LocalizationEditor::LocalizationEditor() { tvb->add_child(thb); Button *addtr = memnew(Button(TTR("Add..."))); - addtr->connect("pressed", callable_mp(this, &LocalizationEditor::_pot_file_open)); + addtr->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_pot_file_open)); thb->add_child(addtr); pot_generate_button = memnew(Button(TTR("Generate POT"))); - pot_generate_button->connect("pressed", callable_mp(this, &LocalizationEditor::_pot_generate_open)); + pot_generate_button->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_pot_generate_open)); thb->add_child(pot_generate_button); translation_pot_list = memnew(Tree); @@ -742,7 +742,7 @@ LocalizationEditor::LocalizationEditor() { translation_pot_add_builtin = memnew(CheckBox(TTR("Add Built-in Strings to POT"))); translation_pot_add_builtin->set_tooltip_text(TTR("Add strings from built-in components such as certain Control nodes.")); - translation_pot_add_builtin->connect("pressed", callable_mp(this, &LocalizationEditor::_pot_add_builtin_toggled)); + translation_pot_add_builtin->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_pot_add_builtin_toggled)); tvb->add_child(translation_pot_add_builtin); pot_generate_dialog = memnew(EditorFileDialog); diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index 71bc9c64be..b8e0b61cd9 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -120,7 +120,7 @@ NodeDock::NodeDock() { connections_button->set_h_size_flags(SIZE_EXPAND_FILL); connections_button->set_clip_text(true); mode_hb->add_child(connections_button); - connections_button->connect("pressed", callable_mp(this, &NodeDock::show_connections)); + connections_button->connect(SceneStringName(pressed), callable_mp(this, &NodeDock::show_connections)); groups_button = memnew(Button); groups_button->set_theme_type_variation("FlatButton"); @@ -130,7 +130,7 @@ NodeDock::NodeDock() { groups_button->set_h_size_flags(SIZE_EXPAND_FILL); groups_button->set_clip_text(true); mode_hb->add_child(groups_button); - groups_button->connect("pressed", callable_mp(this, &NodeDock::show_groups)); + groups_button->connect(SceneStringName(pressed), callable_mp(this, &NodeDock::show_groups)); connections = memnew(ConnectionsDock); add_child(connections); diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index dd52375c10..b1279e4192 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -730,19 +730,19 @@ AbstractPolygon2DEditor::AbstractPolygon2DEditor(bool p_wip_destructive) { button_create = memnew(Button); button_create->set_theme_type_variation("FlatButton"); add_child(button_create); - button_create->connect("pressed", callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_CREATE)); + button_create->connect(SceneStringName(pressed), callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_CREATE)); button_create->set_toggle_mode(true); button_edit = memnew(Button); button_edit->set_theme_type_variation("FlatButton"); add_child(button_edit); - button_edit->connect("pressed", callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_EDIT)); + button_edit->connect(SceneStringName(pressed), callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_EDIT)); button_edit->set_toggle_mode(true); button_delete = memnew(Button); button_delete->set_theme_type_variation("FlatButton"); add_child(button_delete); - button_delete->connect("pressed", callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_DELETE)); + button_delete->connect(SceneStringName(pressed), callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_DELETE)); button_delete->set_toggle_mode(true); create_resource = memnew(ConfirmationDialog); diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index 377c533b9e..95b184b8ab 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -667,7 +667,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { top_hb->add_child(tool_blend); tool_blend->set_pressed(true); tool_blend->set_tooltip_text(TTR("Set the blending position within the space")); - tool_blend->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(3)); + tool_blend->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(3)); tool_select = memnew(Button); tool_select->set_theme_type_variation("FlatButton"); @@ -675,7 +675,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { tool_select->set_button_group(bg); top_hb->add_child(tool_select); tool_select->set_tooltip_text(TTR("Select and move points, create points with RMB.")); - tool_select->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(0)); + tool_select->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(0)); tool_create = memnew(Button); tool_create->set_theme_type_variation("FlatButton"); @@ -683,7 +683,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { tool_create->set_button_group(bg); top_hb->add_child(tool_create); tool_create->set_tooltip_text(TTR("Create points.")); - tool_create->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(1)); + tool_create->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(1)); tool_erase_sep = memnew(VSeparator); top_hb->add_child(tool_erase_sep); @@ -691,7 +691,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { tool_erase->set_theme_type_variation("FlatButton"); top_hb->add_child(tool_erase); tool_erase->set_tooltip_text(TTR("Erase points.")); - tool_erase->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_erase_selected)); + tool_erase->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_erase_selected)); top_hb->add_child(memnew(VSeparator)); @@ -701,7 +701,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { top_hb->add_child(snap); snap->set_pressed(true); snap->set_tooltip_text(TTR("Enable snap and show grid.")); - snap->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_snap_toggled)); + snap->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_snap_toggled)); snap_value = memnew(SpinBox); top_hb->add_child(snap_value); @@ -737,7 +737,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { open_editor = memnew(Button); edit_hb->add_child(open_editor); open_editor->set_text(TTR("Open Editor")); - open_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_open_editor), CONNECT_DEFERRED); + open_editor->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_open_editor), CONNECT_DEFERRED); edit_hb->hide(); open_editor->hide(); diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index 9d91be0174..7ee86c77d2 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -888,7 +888,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(tool_blend); tool_blend->set_pressed(true); tool_blend->set_tooltip_text(TTR("Set the blending position within the space")); - tool_blend->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(3)); + tool_blend->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(3)); tool_select = memnew(Button); tool_select->set_theme_type_variation("FlatButton"); @@ -896,7 +896,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { tool_select->set_button_group(bg); top_hb->add_child(tool_select); tool_select->set_tooltip_text(TTR("Select and move points, create points with RMB.")); - tool_select->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(0)); + tool_select->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(0)); tool_create = memnew(Button); tool_create->set_theme_type_variation("FlatButton"); @@ -904,7 +904,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { tool_create->set_button_group(bg); top_hb->add_child(tool_create); tool_create->set_tooltip_text(TTR("Create points.")); - tool_create->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(1)); + tool_create->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(1)); tool_triangle = memnew(Button); tool_triangle->set_theme_type_variation("FlatButton"); @@ -912,7 +912,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { tool_triangle->set_button_group(bg); top_hb->add_child(tool_triangle); tool_triangle->set_tooltip_text(TTR("Create triangles by connecting points.")); - tool_triangle->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(2)); + tool_triangle->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(2)); tool_erase_sep = memnew(VSeparator); top_hb->add_child(tool_erase_sep); @@ -920,7 +920,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { tool_erase->set_theme_type_variation("FlatButton"); top_hb->add_child(tool_erase); tool_erase->set_tooltip_text(TTR("Erase points and triangles.")); - tool_erase->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_erase_selected)); + tool_erase->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_erase_selected)); tool_erase->set_disabled(true); top_hb->add_child(memnew(VSeparator)); @@ -928,7 +928,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { auto_triangles = memnew(Button); auto_triangles->set_theme_type_variation("FlatButton"); top_hb->add_child(auto_triangles); - auto_triangles->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled)); + auto_triangles->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled)); auto_triangles->set_toggle_mode(true); auto_triangles->set_tooltip_text(TTR("Generate blend triangles automatically (instead of manually)")); @@ -940,7 +940,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(snap); snap->set_pressed(true); snap->set_tooltip_text(TTR("Enable snap and show grid.")); - snap->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_snap_toggled)); + snap->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_snap_toggled)); snap_x = memnew(SpinBox); top_hb->add_child(snap_x); @@ -989,7 +989,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { open_editor = memnew(Button); edit_hb->add_child(open_editor); open_editor->set_text(TTR("Open Editor")); - open_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_open_editor), CONNECT_DEFERRED); + open_editor->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_open_editor), CONNECT_DEFERRED); edit_hb->hide(); open_editor->hide(); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 2ba75f9deb..26a90c3ce8 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -177,7 +177,7 @@ void AnimationNodeBlendTreeEditor::update_graph() { delete_button->set_flat(true); delete_button->set_focus_mode(FOCUS_NONE); delete_button->set_icon(get_editor_theme_icon(SNAME("Close"))); - delete_button->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_delete_node_request).bind(E), CONNECT_DEFERRED); + delete_button->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_delete_node_request).bind(E), CONNECT_DEFERRED); node->get_titlebar_hbox()->add_child(delete_button); } } @@ -216,7 +216,7 @@ void AnimationNodeBlendTreeEditor::update_graph() { open_in_editor->set_text(TTR("Open Editor")); open_in_editor->set_icon(get_editor_theme_icon(SNAME("Edit"))); node->add_child(open_in_editor); - open_in_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_open_in_editor).bind(E), CONNECT_DEFERRED); + open_in_editor->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_open_in_editor).bind(E), CONNECT_DEFERRED); open_in_editor->set_h_size_flags(SIZE_SHRINK_CENTER); } @@ -230,7 +230,7 @@ void AnimationNodeBlendTreeEditor::update_graph() { } inspect_filters->set_icon(get_editor_theme_icon(SNAME("AnimationFilter"))); node->add_child(inspect_filters); - inspect_filters->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_inspect_filters).bind(E), CONNECT_DEFERRED); + inspect_filters->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_inspect_filters).bind(E), CONNECT_DEFERRED); inspect_filters->set_h_size_flags(SIZE_SHRINK_CENTER); } @@ -1232,22 +1232,22 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { filter_enabled = memnew(CheckBox); filter_enabled->set_text(TTR("Enable Filtering")); - filter_enabled->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_toggled)); + filter_enabled->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_toggled)); filter_hbox->add_child(filter_enabled); filter_fill_selection = memnew(Button); filter_fill_selection->set_text(TTR("Fill Selected Children")); - filter_fill_selection->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_fill_selection)); + filter_fill_selection->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_fill_selection)); filter_hbox->add_child(filter_fill_selection); filter_invert_selection = memnew(Button); filter_invert_selection->set_text(TTR("Invert")); - filter_invert_selection->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_invert_selection)); + filter_invert_selection->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_invert_selection)); filter_hbox->add_child(filter_invert_selection); filter_clear_selection = memnew(Button); filter_clear_selection->set_text(TTR("Clear")); - filter_clear_selection->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_clear_selection)); + filter_clear_selection->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_clear_selection)); filter_hbox->add_child(filter_clear_selection); filters = memnew(Tree); diff --git a/editor/plugins/animation_library_editor.cpp b/editor/plugins/animation_library_editor.cpp index 9a7974acef..8620c3b883 100644 --- a/editor/plugins/animation_library_editor.cpp +++ b/editor/plugins/animation_library_editor.cpp @@ -29,6 +29,7 @@ /**************************************************************************/ #include "animation_library_editor.h" + #include "editor/editor_node.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" @@ -811,11 +812,11 @@ AnimationLibraryEditor::AnimationLibraryEditor() { hb->add_spacer(true); new_library_button = memnew(Button(TTR("New Library"))); new_library_button->set_tooltip_text(TTR("Create new empty animation library.")); - new_library_button->connect("pressed", callable_mp(this, &AnimationLibraryEditor::_add_library)); + new_library_button->connect(SceneStringName(pressed), callable_mp(this, &AnimationLibraryEditor::_add_library)); hb->add_child(new_library_button); load_library_button = memnew(Button(TTR("Load Library"))); load_library_button->set_tooltip_text(TTR("Load animation library from disk.")); - load_library_button->connect("pressed", callable_mp(this, &AnimationLibraryEditor::_load_library)); + load_library_button->connect(SceneStringName(pressed), callable_mp(this, &AnimationLibraryEditor::_load_library)); hb->add_child(load_library_button); vb->add_child(hb); tree = memnew(Tree); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index d2b29b02ff..1366a38bec 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1987,7 +1987,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug onion_toggle->set_theme_type_variation("FlatButton"); onion_toggle->set_toggle_mode(true); onion_toggle->set_tooltip_text(TTR("Enable Onion Skinning")); - onion_toggle->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_onion_skinning_menu).bind(ONION_SKINNING_ENABLE)); + onion_toggle->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_onion_skinning_menu).bind(ONION_SKINNING_ENABLE)); hb->add_child(onion_toggle); onion_skinning = memnew(MenuButton); @@ -2018,7 +2018,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug pin->set_toggle_mode(true); pin->set_tooltip_text(TTR("Pin AnimationPlayer")); hb->add_child(pin); - pin->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_pin_pressed)); + pin->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_pin_pressed)); file = memnew(EditorFileDialog); add_child(file); @@ -2074,13 +2074,13 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug blend_editor.next->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); blend_vb->add_margin_child(TTR("Next (Auto Queue):"), blend_editor.next); - autoplay->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_autoplay_pressed)); + autoplay->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_autoplay_pressed)); autoplay->set_toggle_mode(true); - play->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_play_pressed)); - play_from->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_play_from_pressed)); - play_bw->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_play_bw_pressed)); - play_bw_from->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_play_bw_from_pressed)); - stop->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_stop_pressed)); + play->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_play_pressed)); + play_from->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_play_from_pressed)); + play_bw->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_play_bw_pressed)); + play_bw_from->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_play_bw_from_pressed)); + stop->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_stop_pressed)); animation->connect(SNAME("item_selected"), callable_mp(this, &AnimationPlayerEditor::_animation_selected)); diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index e1942bb33e..b6d81ce461 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1673,7 +1673,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_select->set_button_group(bg); tool_select->set_pressed(true); tool_select->set_tooltip_text(TTR("Select and move nodes.\nRMB: Add node at position clicked.\nShift+LMB+Drag: Connects the selected node with another node or creates a new node if you select an area without nodes.")); - tool_select->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED); + tool_select->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED); tool_create = memnew(Button); tool_create->set_theme_type_variation("FlatButton"); @@ -1681,7 +1681,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_create->set_toggle_mode(true); tool_create->set_button_group(bg); tool_create->set_tooltip_text(TTR("Create new nodes.")); - tool_create->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED); + tool_create->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED); tool_connect = memnew(Button); tool_connect->set_theme_type_variation("FlatButton"); @@ -1689,7 +1689,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_connect->set_toggle_mode(true); tool_connect->set_button_group(bg); tool_connect->set_tooltip_text(TTR("Connect nodes.")); - tool_connect->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED); + tool_connect->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED); // Context-sensitive selection tools: selection_tools_hb = memnew(HBoxContainer); @@ -1699,7 +1699,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_erase = memnew(Button); tool_erase->set_theme_type_variation("FlatButton"); tool_erase->set_tooltip_text(TTR("Remove selected node or transition.")); - tool_erase->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_erase_selected).bind(false)); + tool_erase->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_erase_selected).bind(false)); tool_erase->set_disabled(true); selection_tools_hb->add_child(tool_erase); @@ -1815,10 +1815,10 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { Button *ok = delete_window->get_cancel_button(); ok->set_text(TTR("Delete Selected")); - ok->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_delete_selected)); + ok->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_delete_selected)); Button *delete_all = delete_window->add_button(TTR("Delete All"), true); - delete_all->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_delete_all)); + delete_all->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_delete_all)); } void EditorAnimationMultiTransitionEdit::add_transition(const StringName &p_from, const StringName &p_to, Ref<AnimationNodeStateMachineTransition> p_transition) { diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index 7470bb0e44..cc1f51348d 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -100,7 +100,7 @@ void AnimationTreeEditor::_update_path() { b->set_button_group(group); b->set_pressed(true); b->set_focus_mode(FOCUS_NONE); - b->connect("pressed", callable_mp(this, &AnimationTreeEditor::_path_button_pressed).bind(-1)); + b->connect(SceneStringName(pressed), callable_mp(this, &AnimationTreeEditor::_path_button_pressed).bind(-1)); path_hb->add_child(b); for (int i = 0; i < button_path.size(); i++) { b = memnew(Button); @@ -111,7 +111,7 @@ void AnimationTreeEditor::_update_path() { path_hb->add_child(b); b->set_pressed(true); b->set_focus_mode(FOCUS_NONE); - b->connect("pressed", callable_mp(this, &AnimationTreeEditor::_path_button_pressed).bind(i)); + b->connect(SceneStringName(pressed), callable_mp(this, &AnimationTreeEditor::_path_button_pressed).bind(i)); } } diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 638532b7cf..99c7ab63e9 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -165,10 +165,10 @@ EditorAssetLibraryItem::EditorAssetLibraryItem(bool p_clickable) { if (p_clickable) { author->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); icon->set_default_cursor_shape(CURSOR_POINTING_HAND); - icon->connect("pressed", callable_mp(this, &EditorAssetLibraryItem::_asset_clicked)); - title->connect("pressed", callable_mp(this, &EditorAssetLibraryItem::_asset_clicked)); - category->connect("pressed", callable_mp(this, &EditorAssetLibraryItem::_category_clicked)); - author->connect("pressed", callable_mp(this, &EditorAssetLibraryItem::_author_clicked)); + icon->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItem::_asset_clicked)); + title->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItem::_asset_clicked)); + category->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItem::_category_clicked)); + author->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItem::_author_clicked)); } else { title->set_mouse_filter(MOUSE_FILTER_IGNORE); category->set_mouse_filter(MOUSE_FILTER_IGNORE); @@ -303,7 +303,7 @@ void EditorAssetLibraryItemDescription::add_preview(int p_id, bool p_video, cons new_preview.button = memnew(Button); new_preview.button->set_icon(previews->get_editor_theme_icon(SNAME("ThumbnailWait"))); new_preview.button->set_toggle_mode(true); - new_preview.button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDescription::_preview_click).bind(p_id)); + new_preview.button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItemDescription::_preview_click).bind(p_id)); preview_hb->add_child(new_preview.button); if (!p_video) { new_preview.image = previews->get_editor_theme_icon(SNAME("ThumbnailWait")); @@ -577,7 +577,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { title->set_h_size_flags(Control::SIZE_EXPAND_FILL); dismiss_button = memnew(TextureButton); - dismiss_button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDownload::_close)); + dismiss_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItemDownload::_close)); title_hb->add_child(dismiss_button); title->set_clip_text(true); @@ -597,11 +597,11 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { install_button = memnew(Button); install_button->set_text(TTR("Install...")); install_button->set_disabled(true); - install_button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDownload::install)); + install_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItemDownload::install)); retry_button = memnew(Button); retry_button->set_text(TTR("Retry")); - retry_button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDownload::_make_request)); + retry_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItemDownload::_make_request)); // Only show the Retry button in case of a failure. retry_button->hide(); @@ -1134,7 +1134,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int first->set_text(TTR("First", "Pagination")); first->set_theme_type_variation("PanelBackgroundButton"); if (p_page != 0) { - first->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(0)); + first->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(0)); } else { first->set_disabled(true); first->set_focus_mode(Control::FOCUS_NONE); @@ -1145,7 +1145,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int prev->set_text(TTR("Previous", "Pagination")); prev->set_theme_type_variation("PanelBackgroundButton"); if (p_page > 0) { - prev->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(p_page - 1)); + prev->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(p_page - 1)); } else { prev->set_disabled(true); prev->set_focus_mode(Control::FOCUS_NONE); @@ -1162,7 +1162,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int current->set_disabled(true); current->set_focus_mode(Control::FOCUS_NONE); } else { - current->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(i)); + current->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(i)); } hbc->add_child(current); } @@ -1171,7 +1171,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int next->set_text(TTR("Next", "Pagination")); next->set_theme_type_variation("PanelBackgroundButton"); if (p_page < p_page_count - 1) { - next->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(p_page + 1)); + next->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(p_page + 1)); } else { next->set_disabled(true); next->set_focus_mode(Control::FOCUS_NONE); @@ -1183,7 +1183,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int last->set_text(TTR("Last", "Pagination")); last->set_theme_type_variation("PanelBackgroundButton"); if (p_page != p_page_count - 1) { - last->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(p_page_count - 1)); + last->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(p_page_count - 1)); } else { last->set_disabled(true); last->set_focus_mode(Control::FOCUS_NONE); @@ -1542,7 +1542,7 @@ void EditorAssetLibrary::_set_library_message(const String &p_message) { library_message->set_text(p_message); if (library_message_action.is_valid()) { - library_message_button->disconnect("pressed", library_message_action); + library_message_button->disconnect(SceneStringName(pressed), library_message_action); library_message_action = Callable(); } library_message_button->hide(); @@ -1555,11 +1555,11 @@ void EditorAssetLibrary::_set_library_message_with_action(const String &p_messag library_message_button->set_text(p_action_text); if (library_message_action.is_valid()) { - library_message_button->disconnect("pressed", library_message_action); + library_message_button->disconnect(SceneStringName(pressed), library_message_action); library_message_action = Callable(); } library_message_action = p_action; - library_message_button->connect("pressed", library_message_action); + library_message_button->connect(SceneStringName(pressed), library_message_action); library_message_button->show(); library_message_box->show(); @@ -1618,12 +1618,12 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { Button *open_asset = memnew(Button); open_asset->set_text(TTR("Import...")); search_hb->add_child(open_asset); - open_asset->connect("pressed", callable_mp(this, &EditorAssetLibrary::_asset_open)); + open_asset->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_asset_open)); Button *plugins = memnew(Button); plugins->set_text(TTR("Plugins...")); search_hb->add_child(plugins); - plugins->connect("pressed", callable_mp(this, &EditorAssetLibrary::_manage_plugins)); + plugins->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_manage_plugins)); if (p_templates_only) { open_asset->hide(); diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp index 6a64f46a93..af6bbb679a 100644 --- a/editor/plugins/audio_stream_editor_plugin.cpp +++ b/editor/plugins/audio_stream_editor_plugin.cpp @@ -244,14 +244,14 @@ AudioStreamEditor::AudioStreamEditor() { hbox->add_child(_play_button); _play_button->set_flat(true); _play_button->set_focus_mode(Control::FOCUS_NONE); - _play_button->connect(SNAME("pressed"), callable_mp(this, &AudioStreamEditor::_play)); + _play_button->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamEditor::_play)); _play_button->set_shortcut(ED_SHORTCUT("audio_stream_editor/audio_preview_play_pause", TTR("Audio Preview Play/Pause"), Key::SPACE)); _stop_button = memnew(Button); hbox->add_child(_stop_button); _stop_button->set_flat(true); _stop_button->set_focus_mode(Control::FOCUS_NONE); - _stop_button->connect(SNAME("pressed"), callable_mp(this, &AudioStreamEditor::_stop)); + _stop_button->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamEditor::_stop)); _current_label = memnew(Label); _current_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp index 2bf9ad9e09..c7207a6eab 100644 --- a/editor/plugins/bone_map_editor_plugin.cpp +++ b/editor/plugins/bone_map_editor_plugin.cpp @@ -120,7 +120,7 @@ void BoneMapperItem::create_editor() { picker_button = memnew(Button); picker_button->set_icon(get_editor_theme_icon(SNAME("ClassList"))); - picker_button->connect("pressed", callable_mp(this, &BoneMapperItem::_open_picker)); + picker_button->connect(SceneStringName(pressed), callable_mp(this, &BoneMapperItem::_open_picker)); hbox->add_child(picker_button); add_child(memnew(HSeparator)); @@ -301,7 +301,7 @@ void BoneMapper::create_editor() { clear_mapping_button = memnew(Button); clear_mapping_button->set_icon(get_editor_theme_icon(SNAME("Clear"))); clear_mapping_button->set_tooltip_text(TTR("Clear mappings in current group.")); - clear_mapping_button->connect("pressed", callable_mp(this, &BoneMapper::_clear_mapping_current_group)); + clear_mapping_button->connect(SceneStringName(pressed), callable_mp(this, &BoneMapper::_clear_mapping_current_group)); group_hbox->add_child(clear_mapping_button); bone_mapper_field = memnew(AspectRatioContainer); @@ -422,7 +422,7 @@ void BoneMapper::recreate_editor() { for (int i = 0; i < len; i++) { if (profile->get_group(i) == profile->get_group_name(current_group_idx)) { BoneMapperButton *mb = memnew(BoneMapperButton(profile->get_bone_name(i), profile->is_required(i), current_bone_idx == i)); - mb->connect("pressed", callable_mp(this, &BoneMapper::set_current_bone_idx).bind(i), CONNECT_DEFERRED); + mb->connect(SceneStringName(pressed), callable_mp(this, &BoneMapper::set_current_bone_idx).bind(i), CONNECT_DEFERRED); mb->set_h_grow_direction(GROW_DIRECTION_BOTH); mb->set_v_grow_direction(GROW_DIRECTION_BOTH); Vector2 vc = profile->get_handle_offset(i); diff --git a/editor/plugins/camera_3d_editor_plugin.cpp b/editor/plugins/camera_3d_editor_plugin.cpp index b9555296b8..62b40043c1 100644 --- a/editor/plugins/camera_3d_editor_plugin.cpp +++ b/editor/plugins/camera_3d_editor_plugin.cpp @@ -76,7 +76,7 @@ Camera3DEditor::Camera3DEditor() { preview->set_offset(SIDE_RIGHT, 0); preview->set_offset(SIDE_TOP, 0); preview->set_offset(SIDE_BOTTOM, 10); - preview->connect("pressed", callable_mp(this, &Camera3DEditor::_pressed)); + preview->connect(SceneStringName(pressed), callable_mp(this, &Camera3DEditor::_pressed)); } void Camera3DEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 0ab9192454..731c89250e 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5251,7 +5251,7 @@ CanvasItemEditor::CanvasItemEditor() { controls_hb->add_child(button_center_view); button_center_view->set_flat(true); button_center_view->set_tooltip_text(TTR("Center View")); - button_center_view->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(VIEW_CENTER_TO_SELECTION)); + button_center_view->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(VIEW_CENTER_TO_SELECTION)); zoom_widget = memnew(EditorZoomWidget); zoom_widget->set_anchors_and_offsets_preset(Control::PRESET_TOP_LEFT, Control::PRESET_MODE_MINSIZE, 2 * EDSCALE); @@ -5288,7 +5288,7 @@ CanvasItemEditor::CanvasItemEditor() { select_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(select_button); select_button->set_toggle_mode(true); - select_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SELECT)); + select_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SELECT)); select_button->set_pressed(true); select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), Key::Q)); select_button->set_shortcut_context(this); @@ -5300,7 +5300,7 @@ CanvasItemEditor::CanvasItemEditor() { move_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(move_button); move_button->set_toggle_mode(true); - move_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_MOVE)); + move_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_MOVE)); move_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/move_mode", TTR("Move Mode"), Key::W)); move_button->set_shortcut_context(this); move_button->set_tooltip_text(TTR("Move Mode")); @@ -5309,7 +5309,7 @@ CanvasItemEditor::CanvasItemEditor() { rotate_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(rotate_button); rotate_button->set_toggle_mode(true); - rotate_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_ROTATE)); + rotate_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_ROTATE)); rotate_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/rotate_mode", TTR("Rotate Mode"), Key::E)); rotate_button->set_shortcut_context(this); rotate_button->set_tooltip_text(TTR("Rotate Mode")); @@ -5318,7 +5318,7 @@ CanvasItemEditor::CanvasItemEditor() { scale_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(scale_button); scale_button->set_toggle_mode(true); - scale_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SCALE)); + scale_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SCALE)); scale_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/scale_mode", TTR("Scale Mode"), Key::S)); scale_button->set_shortcut_context(this); scale_button->set_tooltip_text(TTR("Shift: Scale proportionally.")); @@ -5329,21 +5329,21 @@ CanvasItemEditor::CanvasItemEditor() { list_select_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(list_select_button); list_select_button->set_toggle_mode(true); - list_select_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_LIST_SELECT)); + list_select_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_LIST_SELECT)); list_select_button->set_tooltip_text(TTR("Show list of selectable nodes at position clicked.")); pivot_button = memnew(Button); pivot_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(pivot_button); pivot_button->set_toggle_mode(true); - pivot_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_EDIT_PIVOT)); + pivot_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_EDIT_PIVOT)); pivot_button->set_tooltip_text(TTR("Click to change object's rotation pivot.") + "\n" + TTR("Shift: Set temporary rotation pivot.") + "\n" + TTR("Click this button while holding Shift to put the rotation pivot in the center of the selected nodes.")); pan_button = memnew(Button); pan_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(pan_button); pan_button->set_toggle_mode(true); - pan_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_PAN)); + pan_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_PAN)); pan_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/pan_mode", TTR("Pan Mode"), Key::G)); pan_button->set_shortcut_context(this); pan_button->set_tooltip_text(TTR("You can also use Pan View shortcut (Space by default) to pan in any mode.")); @@ -5352,7 +5352,7 @@ CanvasItemEditor::CanvasItemEditor() { ruler_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(ruler_button); ruler_button->set_toggle_mode(true); - ruler_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_RULER)); + ruler_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_RULER)); ruler_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/ruler_mode", TTR("Ruler Mode"), Key::R)); ruler_button->set_shortcut_context(this); ruler_button->set_tooltip_text(TTR("Ruler Mode")); @@ -5414,7 +5414,7 @@ CanvasItemEditor::CanvasItemEditor() { lock_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(lock_button); - lock_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(LOCK_SELECTED)); + lock_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(LOCK_SELECTED)); lock_button->set_tooltip_text(TTR("Lock selected node, preventing selection and movement.")); // Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused. lock_button->set_shortcut(ED_SHORTCUT("editor/lock_selected_nodes", TTR("Lock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::L)); @@ -5422,7 +5422,7 @@ CanvasItemEditor::CanvasItemEditor() { unlock_button = memnew(Button); unlock_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(unlock_button); - unlock_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNLOCK_SELECTED)); + unlock_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNLOCK_SELECTED)); unlock_button->set_tooltip_text(TTR("Unlock selected node, allowing selection and movement.")); // Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused. unlock_button->set_shortcut(ED_SHORTCUT("editor/unlock_selected_nodes", TTR("Unlock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::L)); @@ -5430,7 +5430,7 @@ CanvasItemEditor::CanvasItemEditor() { group_button = memnew(Button); group_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(group_button); - group_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(GROUP_SELECTED)); + group_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(GROUP_SELECTED)); group_button->set_tooltip_text(TTR("Groups the selected node with its children. This causes the parent to be selected when any child node is clicked in 2D and 3D view.")); // Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused. group_button->set_shortcut(ED_SHORTCUT("editor/group_selected_nodes", TTR("Group Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::G)); @@ -5438,7 +5438,7 @@ CanvasItemEditor::CanvasItemEditor() { ungroup_button = memnew(Button); ungroup_button->set_theme_type_variation("FlatButton"); main_menu_hbox->add_child(ungroup_button); - ungroup_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNGROUP_SELECTED)); + ungroup_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNGROUP_SELECTED)); ungroup_button->set_tooltip_text(TTR("Ungroups the selected node from its children. Child nodes will be individual items in 2D and 3D view.")); // Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused. ungroup_button->set_shortcut(ED_SHORTCUT("editor/ungroup_selected_nodes", TTR("Ungroup Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::G)); @@ -5550,7 +5550,7 @@ CanvasItemEditor::CanvasItemEditor() { key_loc_button->set_toggle_mode(true); key_loc_button->set_pressed(true); key_loc_button->set_focus_mode(FOCUS_NONE); - key_loc_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_POS)); + key_loc_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_POS)); key_loc_button->set_tooltip_text(TTR("Translation mask for inserting keys.")); animation_hb->add_child(key_loc_button); @@ -5559,7 +5559,7 @@ CanvasItemEditor::CanvasItemEditor() { key_rot_button->set_toggle_mode(true); key_rot_button->set_pressed(true); key_rot_button->set_focus_mode(FOCUS_NONE); - key_rot_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_ROT)); + key_rot_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_ROT)); key_rot_button->set_tooltip_text(TTR("Rotation mask for inserting keys.")); animation_hb->add_child(key_rot_button); @@ -5567,14 +5567,14 @@ CanvasItemEditor::CanvasItemEditor() { key_scale_button->set_theme_type_variation("FlatButton"); key_scale_button->set_toggle_mode(true); key_scale_button->set_focus_mode(FOCUS_NONE); - key_scale_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_SCALE)); + key_scale_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_SCALE)); key_scale_button->set_tooltip_text(TTR("Scale mask for inserting keys.")); animation_hb->add_child(key_scale_button); key_insert_button = memnew(Button); key_insert_button->set_theme_type_variation("FlatButton"); key_insert_button->set_focus_mode(FOCUS_NONE); - key_insert_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_KEY)); + key_insert_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_KEY)); key_insert_button->set_tooltip_text(TTR("Insert keys (based on mask).")); key_insert_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/anim_insert_key", TTR("Insert Key"), Key::INSERT)); key_insert_button->set_shortcut_context(this); diff --git a/editor/plugins/control_editor_plugin.cpp b/editor/plugins/control_editor_plugin.cpp index 80446e48e8..1d5b0a832a 100644 --- a/editor/plugins/control_editor_plugin.cpp +++ b/editor/plugins/control_editor_plugin.cpp @@ -352,7 +352,7 @@ void EditorPropertySizeFlags::setup(const Vector<String> &p_options, bool p_vert cb->set_text(text_split[0]); cb->set_clip_text(true); cb->set_meta("_value", current_val); - cb->connect("pressed", callable_mp(this, &EditorPropertySizeFlags::_flag_toggled)); + cb->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertySizeFlags::_flag_toggled)); add_focusable(cb); flag_options->add_child(cb); @@ -407,7 +407,7 @@ EditorPropertySizeFlags::EditorPropertySizeFlags() { flag_expand->set_text(TTR("Expand")); vb->add_child(flag_expand); add_focusable(flag_expand); - flag_expand->connect("pressed", callable_mp(this, &EditorPropertySizeFlags::_expand_toggled)); + flag_expand->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertySizeFlags::_expand_toggled)); } bool EditorInspectorPluginControl::can_handle(Object *p_object) { @@ -552,7 +552,7 @@ void ControlEditorPresetPicker::_add_row_button(HBoxContainer *p_row, const int b->set_tooltip_text(p_name); b->set_flat(true); p_row->add_child(b); - b->connect("pressed", callable_mp(this, &ControlEditorPresetPicker::_preset_button_pressed).bind(p_preset)); + b->connect(SceneStringName(pressed), callable_mp(this, &ControlEditorPresetPicker::_preset_button_pressed).bind(p_preset)); preset_buttons[p_preset] = b; } @@ -731,7 +731,7 @@ SizeFlagPresetPicker::SizeFlagPresetPicker(bool p_vertical) { expand_button->set_flat(true); expand_button->set_text(TTR("Expand")); expand_button->set_tooltip_text(TTR("Enable to also set the Expand flag.\nDisable to only set Shrink/Fill flags.")); - expand_button->connect("pressed", callable_mp(this, &SizeFlagPresetPicker::_expand_button_pressed)); + expand_button->connect(SceneStringName(pressed), callable_mp(this, &SizeFlagPresetPicker::_expand_button_pressed)); main_vb->add_child(expand_button); } @@ -1077,7 +1077,7 @@ ControlEditorToolbar::ControlEditorToolbar() { keep_ratio_button->set_text(TTR("Set to Current Ratio")); keep_ratio_button->set_tooltip_text(TTR("Adjust anchors and offsets to match the current rect size.")); anchors_button->get_popup_hbox()->add_child(keep_ratio_button); - keep_ratio_button->connect("pressed", callable_mp(this, &ControlEditorToolbar::_anchors_to_current_ratio)); + keep_ratio_button->connect(SceneStringName(pressed), callable_mp(this, &ControlEditorToolbar::_anchors_to_current_ratio)); anchor_mode_button = memnew(Button); anchor_mode_button->set_theme_type_variation("FlatButton"); diff --git a/editor/plugins/editor_plugin_settings.cpp b/editor/plugins/editor_plugin_settings.cpp index 2920cf19c0..afc60b09d6 100644 --- a/editor/plugins/editor_plugin_settings.cpp +++ b/editor/plugins/editor_plugin_settings.cpp @@ -215,7 +215,7 @@ EditorPluginSettings::EditorPluginSettings() { title_hb->add_child(label); title_hb->add_spacer(); Button *create_plugin_button = memnew(Button(TTR("Create New Plugin"))); - create_plugin_button->connect("pressed", callable_mp(this, &EditorPluginSettings::_create_clicked)); + create_plugin_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPluginSettings::_create_clicked)); title_hb->add_child(create_plugin_button); add_child(title_hb); diff --git a/editor/plugins/font_config_plugin.cpp b/editor/plugins/font_config_plugin.cpp index be7ff6ba3e..1b104f9075 100644 --- a/editor/plugins/font_config_plugin.cpp +++ b/editor/plugins/font_config_plugin.cpp @@ -305,7 +305,7 @@ void EditorPropertyFontMetaOverride::update_property() { Button *remove = memnew(Button); remove->set_icon(get_editor_theme_icon(SNAME("Remove"))); hbox->add_child(remove); - remove->connect("pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_remove).bind(remove, name)); + remove->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyFontMetaOverride::_remove).bind(remove, name)); prop->update_property(); } @@ -316,7 +316,7 @@ void EditorPropertyFontMetaOverride::update_property() { } else { button_add = EditorInspector::create_inspector_action_button(TTR("Add Locale")); } - button_add->connect("pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_add_menu)); + button_add->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyFontMetaOverride::_add_menu)); property_vbox->add_child(button_add); updating = false; @@ -359,7 +359,7 @@ EditorPropertyFontMetaOverride::EditorPropertyFontMetaOverride(bool p_script) { edit = memnew(Button); edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->set_clip_text(true); - edit->connect("pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_edit_pressed)); + edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyFontMetaOverride::_edit_pressed)); edit->set_toggle_mode(true); add_child(edit); add_focusable(edit); @@ -530,7 +530,7 @@ EditorPropertyOTVariation::EditorPropertyOTVariation() { edit = memnew(Button); edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->set_clip_text(true); - edit->connect("pressed", callable_mp(this, &EditorPropertyOTVariation::_edit_pressed)); + edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyOTVariation::_edit_pressed)); edit->set_toggle_mode(true); add_child(edit); add_focusable(edit); @@ -784,7 +784,7 @@ void EditorPropertyOTFeatures::update_property() { Button *remove = memnew(Button); remove->set_icon(get_editor_theme_icon(SNAME("Remove"))); hbox->add_child(remove); - remove->connect("pressed", callable_mp(this, &EditorPropertyOTFeatures::_remove).bind(remove, name_tag)); + remove->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyOTFeatures::_remove).bind(remove, name_tag)); prop->update_property(); } @@ -792,7 +792,7 @@ void EditorPropertyOTFeatures::update_property() { button_add = EditorInspector::create_inspector_action_button(TTR("Add Feature")); button_add->set_icon(get_editor_theme_icon(SNAME("Add"))); - button_add->connect("pressed", callable_mp(this, &EditorPropertyOTFeatures::_add_menu)); + button_add->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyOTFeatures::_add_menu)); property_vbox->add_child(button_add); updating = false; @@ -833,7 +833,7 @@ EditorPropertyOTFeatures::EditorPropertyOTFeatures() { edit = memnew(Button); edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->set_clip_text(true); - edit->connect("pressed", callable_mp(this, &EditorPropertyOTFeatures::_edit_pressed)); + edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyOTFeatures::_edit_pressed)); edit->set_toggle_mode(true); add_child(edit); add_focusable(edit); diff --git a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp index 99a702f3a4..25b076d0e5 100644 --- a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp @@ -186,7 +186,7 @@ GPUParticlesCollisionSDF3DEditorPlugin::GPUParticlesCollisionSDF3DEditorPlugin() bake->set_theme_type_variation("FlatButton"); bake->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Bake"), EditorStringName(EditorIcons))); bake->set_text(TTR("Bake SDF")); - bake->connect("pressed", callable_mp(this, &GPUParticlesCollisionSDF3DEditorPlugin::_bake)); + bake->connect(SceneStringName(pressed), callable_mp(this, &GPUParticlesCollisionSDF3DEditorPlugin::_bake)); bake_hb->add_child(bake); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake_hb); diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index 80a7121ee4..dd7998c6bf 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -644,7 +644,7 @@ GradientEditor::GradientEditor() { gradient_editor_rect = memnew(GradientEdit); add_child(gradient_editor_rect); - reverse_button->connect("pressed", callable_mp(gradient_editor_rect, &GradientEdit::reverse_gradient)); + reverse_button->connect(SceneStringName(pressed), callable_mp(gradient_editor_rect, &GradientEdit::reverse_gradient)); set_mouse_filter(MOUSE_FILTER_STOP); _set_snap_enabled(snap_button->is_pressed()); diff --git a/editor/plugins/gradient_texture_2d_editor_plugin.cpp b/editor/plugins/gradient_texture_2d_editor_plugin.cpp index ebc00c49bb..9a2e625210 100644 --- a/editor/plugins/gradient_texture_2d_editor_plugin.cpp +++ b/editor/plugins/gradient_texture_2d_editor_plugin.cpp @@ -282,7 +282,7 @@ GradientTexture2DEditor::GradientTexture2DEditor() { reverse_button = memnew(Button); reverse_button->set_tooltip_text(TTR("Swap Gradient Fill Points")); toolbar->add_child(reverse_button); - reverse_button->connect("pressed", callable_mp(this, &GradientTexture2DEditor::_reverse_button_pressed)); + reverse_button->connect(SceneStringName(pressed), callable_mp(this, &GradientTexture2DEditor::_reverse_button_pressed)); toolbar->add_child(memnew(VSeparator)); diff --git a/editor/plugins/input_event_editor_plugin.cpp b/editor/plugins/input_event_editor_plugin.cpp index 973c929059..1f6bb11929 100644 --- a/editor/plugins/input_event_editor_plugin.cpp +++ b/editor/plugins/input_event_editor_plugin.cpp @@ -88,7 +88,7 @@ InputEventConfigContainer::InputEventConfigContainer() { add_child(input_event_text); open_config_button = EditorInspector::create_inspector_action_button(TTR("Configure")); - open_config_button->connect("pressed", callable_mp(this, &InputEventConfigContainer::_configure_pressed)); + open_config_button->connect(SceneStringName(pressed), callable_mp(this, &InputEventConfigContainer::_configure_pressed)); add_child(open_config_button); add_child(memnew(Control)); diff --git a/editor/plugins/lightmap_gi_editor_plugin.cpp b/editor/plugins/lightmap_gi_editor_plugin.cpp index 335498dff9..2289105d78 100644 --- a/editor/plugins/lightmap_gi_editor_plugin.cpp +++ b/editor/plugins/lightmap_gi_editor_plugin.cpp @@ -177,7 +177,7 @@ LightmapGIEditorPlugin::LightmapGIEditorPlugin() { bake->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Bake"), EditorStringName(EditorIcons))); bake->set_text(TTR("Bake Lightmaps")); bake->hide(); - bake->connect("pressed", Callable(this, "_bake")); + bake->connect(SceneStringName(pressed), Callable(this, "_bake")); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake); lightmap = nullptr; diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index d3a0d56ec9..602e6f945c 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -242,14 +242,14 @@ MaterialEditor::MaterialEditor() { sphere_switch->set_toggle_mode(true); sphere_switch->set_pressed(true); vb_shape->add_child(sphere_switch); - sphere_switch->connect("pressed", callable_mp(this, &MaterialEditor::_on_sphere_switch_pressed)); + sphere_switch->connect(SceneStringName(pressed), callable_mp(this, &MaterialEditor::_on_sphere_switch_pressed)); box_switch = memnew(Button); box_switch->set_theme_type_variation("PreviewLightButton"); box_switch->set_toggle_mode(true); box_switch->set_pressed(false); vb_shape->add_child(box_switch); - box_switch->connect("pressed", callable_mp(this, &MaterialEditor::_on_box_switch_pressed)); + box_switch->connect(SceneStringName(pressed), callable_mp(this, &MaterialEditor::_on_box_switch_pressed)); layout_3d->add_spacer(); @@ -261,14 +261,14 @@ MaterialEditor::MaterialEditor() { light_1_switch->set_toggle_mode(true); light_1_switch->set_pressed(true); vb_light->add_child(light_1_switch); - light_1_switch->connect("pressed", callable_mp(this, &MaterialEditor::_on_light_1_switch_pressed)); + light_1_switch->connect(SceneStringName(pressed), callable_mp(this, &MaterialEditor::_on_light_1_switch_pressed)); light_2_switch = memnew(Button); light_2_switch->set_theme_type_variation("PreviewLightButton"); light_2_switch->set_toggle_mode(true); light_2_switch->set_pressed(true); vb_light->add_child(light_2_switch); - light_2_switch->connect("pressed", callable_mp(this, &MaterialEditor::_on_light_2_switch_pressed)); + light_2_switch->connect(SceneStringName(pressed), callable_mp(this, &MaterialEditor::_on_light_2_switch_pressed)); if (EditorSettings::get_singleton()->get_project_metadata("inspector_options", "material_preview_on_sphere", true)) { box_instance->hide(); diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index 0324b1d4f7..c8eda600b8 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -150,14 +150,14 @@ MeshEditor::MeshEditor() { light_1_switch->set_toggle_mode(true); light_1_switch->set_pressed(true); vb_light->add_child(light_1_switch); - light_1_switch->connect("pressed", callable_mp(this, &MeshEditor::_on_light_1_switch_pressed)); + light_1_switch->connect(SceneStringName(pressed), callable_mp(this, &MeshEditor::_on_light_1_switch_pressed)); light_2_switch = memnew(Button); light_2_switch->set_theme_type_variation("PreviewLightButton"); light_2_switch->set_toggle_mode(true); light_2_switch->set_pressed(true); vb_light->add_child(light_2_switch); - light_2_switch->connect("pressed", callable_mp(this, &MeshEditor::_on_light_2_switch_pressed)); + light_2_switch->connect(SceneStringName(pressed), callable_mp(this, &MeshEditor::_on_light_2_switch_pressed)); rot_x = 0; rot_y = 0; diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index 1a5727a1e8..950aced7a1 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -276,12 +276,12 @@ MeshLibraryEditor::MeshLibraryEditor() { cd_remove = memnew(ConfirmationDialog); add_child(cd_remove); - cd_remove->get_ok_button()->connect("pressed", callable_mp(this, &MeshLibraryEditor::_menu_remove_confirm)); + cd_remove->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &MeshLibraryEditor::_menu_remove_confirm)); cd_update = memnew(ConfirmationDialog); add_child(cd_update); cd_update->set_ok_button_text(TTR("Apply without Transforms")); - cd_update->get_ok_button()->connect("pressed", callable_mp(this, &MeshLibraryEditor::_menu_update_confirm).bind(false)); - cd_update->add_button(TTR("Apply with Transforms"))->connect("pressed", callable_mp(this, &MeshLibraryEditor::_menu_update_confirm).bind(true)); + cd_update->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &MeshLibraryEditor::_menu_update_confirm).bind(false)); + cd_update->add_button(TTR("Apply with Transforms"))->connect(SceneStringName(pressed), callable_mp(this, &MeshLibraryEditor::_menu_update_confirm).bind(true)); } void MeshLibraryEditorPlugin::edit(Object *p_node) { diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp index 9fec263af3..ffe46d5daa 100644 --- a/editor/plugins/multimesh_editor_plugin.cpp +++ b/editor/plugins/multimesh_editor_plugin.cpp @@ -296,7 +296,7 @@ MultiMeshEditor::MultiMeshEditor() { Button *b = memnew(Button); hbc->add_child(b); b->set_text(".."); - b->connect("pressed", callable_mp(this, &MultiMeshEditor::_browse).bind(false)); + b->connect(SceneStringName(pressed), callable_mp(this, &MultiMeshEditor::_browse).bind(false)); vbc->add_margin_child(TTR("Target Surface:"), hbc); @@ -308,7 +308,7 @@ MultiMeshEditor::MultiMeshEditor() { hbc->add_child(b); b->set_text(".."); vbc->add_margin_child(TTR("Source Mesh:"), hbc); - b->connect("pressed", callable_mp(this, &MultiMeshEditor::_browse).bind(true)); + b->connect(SceneStringName(pressed), callable_mp(this, &MultiMeshEditor::_browse).bind(true)); populate_axis = memnew(OptionButton); populate_axis->add_item(TTR("X-Axis")); @@ -354,7 +354,7 @@ MultiMeshEditor::MultiMeshEditor() { populate_dialog->set_ok_button_text(TTR("Populate")); - populate_dialog->get_ok_button()->connect("pressed", callable_mp(this, &MultiMeshEditor::_populate)); + populate_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &MultiMeshEditor::_populate)); std = memnew(SceneTreeDialog); Vector<StringName> valid_types; valid_types.push_back("MeshInstance3D"); diff --git a/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp b/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp index 37c62870e1..9629a673e9 100644 --- a/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp +++ b/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp @@ -526,13 +526,13 @@ NavigationObstacle3DEditor::NavigationObstacle3DEditor() { button_create = memnew(Button); button_create->set_theme_type_variation("FlatButton"); add_child(button_create); - button_create->connect("pressed", callable_mp(this, &NavigationObstacle3DEditor::_menu_option).bind(MODE_CREATE)); + button_create->connect(SceneStringName(pressed), callable_mp(this, &NavigationObstacle3DEditor::_menu_option).bind(MODE_CREATE)); button_create->set_toggle_mode(true); button_edit = memnew(Button); button_edit->set_theme_type_variation("FlatButton"); add_child(button_edit); - button_edit->connect("pressed", callable_mp(this, &NavigationObstacle3DEditor::_menu_option).bind(MODE_EDIT)); + button_edit->connect(SceneStringName(pressed), callable_mp(this, &NavigationObstacle3DEditor::_menu_option).bind(MODE_EDIT)); button_edit->set_toggle_mode(true); mode = MODE_EDIT; diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp index 8bddcd4881..8926f612a2 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -148,14 +148,14 @@ NavigationPolygonEditor::NavigationPolygonEditor() { button_bake->set_toggle_mode(true); button_bake->set_text(TTR("Bake NavigationPolygon")); button_bake->set_tooltip_text(TTR("Bakes the NavigationPolygon by first parsing the scene for source geometry and then creating the navigation polygon vertices and polygons.")); - button_bake->connect("pressed", callable_mp(this, &NavigationPolygonEditor::_bake_pressed)); + button_bake->connect(SceneStringName(pressed), callable_mp(this, &NavigationPolygonEditor::_bake_pressed)); button_reset = memnew(Button); button_reset->set_flat(true); bake_hbox->add_child(button_reset); button_reset->set_text(TTR("Clear NavigationPolygon")); button_reset->set_tooltip_text(TTR("Clears the internal NavigationPolygon outlines, vertices and polygons.")); - button_reset->connect("pressed", callable_mp(this, &NavigationPolygonEditor::_clear_pressed)); + button_reset->connect(SceneStringName(pressed), callable_mp(this, &NavigationPolygonEditor::_clear_pressed)); bake_info = memnew(Label); bake_hbox->add_child(bake_info); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 5eb12f795b..5873d10e76 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -3013,7 +3013,7 @@ void Node3DEditorViewport::_notification(int p_what) { view_menu->begin_bulk_theme_override(); view_menu->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); view_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); - view_menu->add_theme_style_override("pressed", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); + view_menu->add_theme_style_override(SceneStringName(pressed), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); view_menu->add_theme_style_override("focus", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); view_menu->add_theme_style_override("disabled", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); view_menu->end_bulk_theme_override(); @@ -3021,7 +3021,7 @@ void Node3DEditorViewport::_notification(int p_what) { preview_camera->begin_bulk_theme_override(); preview_camera->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); preview_camera->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); - preview_camera->add_theme_style_override("pressed", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); + preview_camera->add_theme_style_override(SceneStringName(pressed), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); preview_camera->add_theme_style_override("focus", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); preview_camera->add_theme_style_override("disabled", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles))); preview_camera->end_bulk_theme_override(); @@ -8360,7 +8360,7 @@ Node3DEditor::Node3DEditor() { tool_button[TOOL_MODE_SELECT]->set_toggle_mode(true); tool_button[TOOL_MODE_SELECT]->set_theme_type_variation("FlatButton"); tool_button[TOOL_MODE_SELECT]->set_pressed(true); - tool_button[TOOL_MODE_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SELECT)); + tool_button[TOOL_MODE_SELECT]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SELECT)); tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), Key::Q)); tool_button[TOOL_MODE_SELECT]->set_shortcut_context(this); tool_button[TOOL_MODE_SELECT]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); @@ -8371,7 +8371,7 @@ Node3DEditor::Node3DEditor() { tool_button[TOOL_MODE_MOVE]->set_toggle_mode(true); tool_button[TOOL_MODE_MOVE]->set_theme_type_variation("FlatButton"); - tool_button[TOOL_MODE_MOVE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_MOVE)); + tool_button[TOOL_MODE_MOVE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_MOVE)); tool_button[TOOL_MODE_MOVE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_move", TTR("Move Mode"), Key::W)); tool_button[TOOL_MODE_MOVE]->set_shortcut_context(this); tool_button[TOOL_MODE_MOVE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); @@ -8380,7 +8380,7 @@ Node3DEditor::Node3DEditor() { main_menu_hbox->add_child(tool_button[TOOL_MODE_ROTATE]); tool_button[TOOL_MODE_ROTATE]->set_toggle_mode(true); tool_button[TOOL_MODE_ROTATE]->set_theme_type_variation("FlatButton"); - tool_button[TOOL_MODE_ROTATE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_ROTATE)); + tool_button[TOOL_MODE_ROTATE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_ROTATE)); tool_button[TOOL_MODE_ROTATE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_rotate", TTR("Rotate Mode"), Key::E)); tool_button[TOOL_MODE_ROTATE]->set_shortcut_context(this); tool_button[TOOL_MODE_ROTATE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); @@ -8389,7 +8389,7 @@ Node3DEditor::Node3DEditor() { main_menu_hbox->add_child(tool_button[TOOL_MODE_SCALE]); tool_button[TOOL_MODE_SCALE]->set_toggle_mode(true); tool_button[TOOL_MODE_SCALE]->set_theme_type_variation("FlatButton"); - tool_button[TOOL_MODE_SCALE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SCALE)); + tool_button[TOOL_MODE_SCALE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SCALE)); tool_button[TOOL_MODE_SCALE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_scale", TTR("Scale Mode"), Key::R)); tool_button[TOOL_MODE_SCALE]->set_shortcut_context(this); tool_button[TOOL_MODE_SCALE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); @@ -8400,13 +8400,13 @@ Node3DEditor::Node3DEditor() { main_menu_hbox->add_child(tool_button[TOOL_MODE_LIST_SELECT]); tool_button[TOOL_MODE_LIST_SELECT]->set_toggle_mode(true); tool_button[TOOL_MODE_LIST_SELECT]->set_theme_type_variation("FlatButton"); - tool_button[TOOL_MODE_LIST_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_LIST_SELECT)); + tool_button[TOOL_MODE_LIST_SELECT]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_LIST_SELECT)); tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip_text(TTR("Show list of selectable nodes at position clicked.")); tool_button[TOOL_LOCK_SELECTED] = memnew(Button); main_menu_hbox->add_child(tool_button[TOOL_LOCK_SELECTED]); tool_button[TOOL_LOCK_SELECTED]->set_theme_type_variation("FlatButton"); - tool_button[TOOL_LOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_LOCK_SELECTED)); + tool_button[TOOL_LOCK_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_LOCK_SELECTED)); tool_button[TOOL_LOCK_SELECTED]->set_tooltip_text(TTR("Lock selected node, preventing selection and movement.")); // Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused. tool_button[TOOL_LOCK_SELECTED]->set_shortcut(ED_SHORTCUT("editor/lock_selected_nodes", TTR("Lock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::L)); @@ -8414,7 +8414,7 @@ Node3DEditor::Node3DEditor() { tool_button[TOOL_UNLOCK_SELECTED] = memnew(Button); main_menu_hbox->add_child(tool_button[TOOL_UNLOCK_SELECTED]); tool_button[TOOL_UNLOCK_SELECTED]->set_theme_type_variation("FlatButton"); - tool_button[TOOL_UNLOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNLOCK_SELECTED)); + tool_button[TOOL_UNLOCK_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNLOCK_SELECTED)); tool_button[TOOL_UNLOCK_SELECTED]->set_tooltip_text(TTR("Unlock selected node, allowing selection and movement.")); // Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused. tool_button[TOOL_UNLOCK_SELECTED]->set_shortcut(ED_SHORTCUT("editor/unlock_selected_nodes", TTR("Unlock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::L)); @@ -8422,7 +8422,7 @@ Node3DEditor::Node3DEditor() { tool_button[TOOL_GROUP_SELECTED] = memnew(Button); main_menu_hbox->add_child(tool_button[TOOL_GROUP_SELECTED]); tool_button[TOOL_GROUP_SELECTED]->set_theme_type_variation("FlatButton"); - tool_button[TOOL_GROUP_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_GROUP_SELECTED)); + tool_button[TOOL_GROUP_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_GROUP_SELECTED)); tool_button[TOOL_GROUP_SELECTED]->set_tooltip_text(TTR("Groups the selected node with its children. This selects the parent when any child node is clicked in 2D and 3D view.")); // Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused. tool_button[TOOL_GROUP_SELECTED]->set_shortcut(ED_SHORTCUT("editor/group_selected_nodes", TTR("Group Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::G)); @@ -8430,7 +8430,7 @@ Node3DEditor::Node3DEditor() { tool_button[TOOL_UNGROUP_SELECTED] = memnew(Button); main_menu_hbox->add_child(tool_button[TOOL_UNGROUP_SELECTED]); tool_button[TOOL_UNGROUP_SELECTED]->set_theme_type_variation("FlatButton"); - tool_button[TOOL_UNGROUP_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNGROUP_SELECTED)); + tool_button[TOOL_UNGROUP_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNGROUP_SELECTED)); tool_button[TOOL_UNGROUP_SELECTED]->set_tooltip_text(TTR("Ungroups the selected node from its children. Child nodes will be individual items in 2D and 3D view.")); // Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused. tool_button[TOOL_UNGROUP_SELECTED]->set_shortcut(ED_SHORTCUT("editor/ungroup_selected_nodes", TTR("Ungroup Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::G)); @@ -8468,7 +8468,7 @@ Node3DEditor::Node3DEditor() { sun_button->set_tooltip_text(TTR("Toggle preview sunlight.\nIf a DirectionalLight3D node is added to the scene, preview sunlight is disabled.")); sun_button->set_toggle_mode(true); sun_button->set_theme_type_variation("FlatButton"); - sun_button->connect("pressed", callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED); + sun_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED); // Preview is enabled by default - ensure this applies on editor startup when there is no state yet. sun_button->set_pressed(true); @@ -8478,7 +8478,7 @@ Node3DEditor::Node3DEditor() { environ_button->set_tooltip_text(TTR("Toggle preview environment.\nIf a WorldEnvironment node is added to the scene, preview environment is disabled.")); environ_button->set_toggle_mode(true); environ_button->set_theme_type_variation("FlatButton"); - environ_button->connect("pressed", callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED); + environ_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED); // Preview is enabled by default - ensure this applies on editor startup when there is no state yet. environ_button->set_pressed(true); @@ -8487,7 +8487,7 @@ Node3DEditor::Node3DEditor() { sun_environ_settings = memnew(Button); sun_environ_settings->set_tooltip_text(TTR("Edit Sun and Environment settings.")); sun_environ_settings->set_theme_type_variation("FlatButton"); - sun_environ_settings->connect("pressed", callable_mp(this, &Node3DEditor::_sun_environ_settings_pressed)); + sun_environ_settings->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_sun_environ_settings_pressed)); main_menu_hbox->add_child(sun_environ_settings); @@ -8616,7 +8616,7 @@ Node3DEditor::Node3DEditor() { snap_dialog->set_title(TTR("Snap Settings")); add_child(snap_dialog); snap_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_snap_changed)); - snap_dialog->get_cancel_button()->connect("pressed", callable_mp(this, &Node3DEditor::_snap_update)); + snap_dialog->get_cancel_button()->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_snap_update)); VBoxContainer *snap_dialog_vbc = memnew(VBoxContainer); snap_dialog->add_child(snap_dialog_vbc); @@ -8852,7 +8852,7 @@ void fragment() { sun_add_to_scene = memnew(Button); sun_add_to_scene->set_text(TTR("Add Sun to Scene")); sun_add_to_scene->set_tooltip_text(TTR("Adds a DirectionalLight3D node matching the preview sun settings to the current scene.\nHold Shift while clicking to also add the preview environment to the current scene.")); - sun_add_to_scene->connect("pressed", callable_mp(this, &Node3DEditor::_add_sun_to_scene).bind(false)); + sun_add_to_scene->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_add_sun_to_scene).bind(false)); sun_vb->add_spacer(); sun_vb->add_child(sun_add_to_scene); @@ -8901,29 +8901,29 @@ void fragment() { environ_ao_button = memnew(Button); environ_ao_button->set_text(TTR("AO")); environ_ao_button->set_toggle_mode(true); - environ_ao_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED); + environ_ao_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED); fx_vb->add_child(environ_ao_button); environ_glow_button = memnew(Button); environ_glow_button->set_text(TTR("Glow")); environ_glow_button->set_toggle_mode(true); - environ_glow_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED); + environ_glow_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED); fx_vb->add_child(environ_glow_button); environ_tonemap_button = memnew(Button); environ_tonemap_button->set_text(TTR("Tonemap")); environ_tonemap_button->set_toggle_mode(true); - environ_tonemap_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED); + environ_tonemap_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED); fx_vb->add_child(environ_tonemap_button); environ_gi_button = memnew(Button); environ_gi_button->set_text(TTR("GI")); environ_gi_button->set_toggle_mode(true); - environ_gi_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED); + environ_gi_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED); fx_vb->add_child(environ_gi_button); environ_vb->add_margin_child(TTR("Post Process"), fx_vb); environ_add_to_scene = memnew(Button); environ_add_to_scene->set_text(TTR("Add Environment to Scene")); environ_add_to_scene->set_tooltip_text(TTR("Adds a WorldEnvironment node matching the preview environment settings to the current scene.\nHold Shift while clicking to also add the preview sun to the current scene.")); - environ_add_to_scene->connect("pressed", callable_mp(this, &Node3DEditor::_add_environment_to_scene).bind(false)); + environ_add_to_scene->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_add_environment_to_scene).bind(false)); environ_vb->add_spacer(); environ_vb->add_child(environ_add_to_scene); diff --git a/editor/plugins/occluder_instance_3d_editor_plugin.cpp b/editor/plugins/occluder_instance_3d_editor_plugin.cpp index b0bd6f7817..c14d9e02aa 100644 --- a/editor/plugins/occluder_instance_3d_editor_plugin.cpp +++ b/editor/plugins/occluder_instance_3d_editor_plugin.cpp @@ -108,7 +108,7 @@ OccluderInstance3DEditorPlugin::OccluderInstance3DEditorPlugin() { bake->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Bake"), EditorStringName(EditorIcons))); bake->set_text(TTR("Bake Occluders")); bake->hide(); - bake->connect("pressed", Callable(this, "_bake")); + bake->connect(SceneStringName(pressed), Callable(this, "_bake")); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake); occluder_instance = nullptr; diff --git a/editor/plugins/packed_scene_editor_plugin.cpp b/editor/plugins/packed_scene_editor_plugin.cpp index 540779b232..c2d9851c17 100644 --- a/editor/plugins/packed_scene_editor_plugin.cpp +++ b/editor/plugins/packed_scene_editor_plugin.cpp @@ -52,7 +52,7 @@ PackedSceneEditor::PackedSceneEditor(Ref<PackedScene> &p_packed_scene) { packed_scene = p_packed_scene; open_scene_button = EditorInspector::create_inspector_action_button(TTR("Open Scene")); - open_scene_button->connect(SNAME("pressed"), callable_mp(this, &PackedSceneEditor::_on_open_scene_pressed)); + open_scene_button->connect(SceneStringName(pressed), callable_mp(this, &PackedSceneEditor::_on_open_scene_pressed)); open_scene_button->set_disabled(!packed_scene->get_path().get_file().is_valid_filename()); add_child(open_scene_button); diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index ca884c4d97..f404dca88b 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -612,7 +612,7 @@ Path2DEditor::Path2DEditor() { curve_edit->set_pressed(true); curve_edit->set_focus_mode(Control::FOCUS_NONE); curve_edit->set_tooltip_text(TTR("Select Points") + "\n" + TTR("Shift+Drag: Select Control Points") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Click: Add Point") + "\n" + TTR("Left Click: Split Segment (in curve)") + "\n" + TTR("Right Click: Delete Point")); - curve_edit->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT)); + curve_edit->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT)); add_child(curve_edit); curve_edit_curve = memnew(Button); @@ -620,7 +620,7 @@ Path2DEditor::Path2DEditor() { curve_edit_curve->set_toggle_mode(true); curve_edit_curve->set_focus_mode(Control::FOCUS_NONE); curve_edit_curve->set_tooltip_text(TTR("Select Control Points (Shift+Drag)")); - curve_edit_curve->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT_CURVE)); + curve_edit_curve->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT_CURVE)); add_child(curve_edit_curve); curve_create = memnew(Button); @@ -628,7 +628,7 @@ Path2DEditor::Path2DEditor() { curve_create->set_toggle_mode(true); curve_create->set_focus_mode(Control::FOCUS_NONE); curve_create->set_tooltip_text(TTR("Add Point (in empty space)") + "\n" + TTR("Right Click: Delete Point")); - curve_create->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CREATE)); + curve_create->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CREATE)); add_child(curve_create); curve_del = memnew(Button); @@ -636,21 +636,21 @@ Path2DEditor::Path2DEditor() { curve_del->set_toggle_mode(true); curve_del->set_focus_mode(Control::FOCUS_NONE); curve_del->set_tooltip_text(TTR("Delete Point")); - curve_del->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_DELETE)); + curve_del->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_DELETE)); add_child(curve_del); curve_close = memnew(Button); curve_close->set_theme_type_variation("FlatButton"); curve_close->set_focus_mode(Control::FOCUS_NONE); curve_close->set_tooltip_text(TTR("Close Curve")); - curve_close->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CLOSE)); + curve_close->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CLOSE)); add_child(curve_close); curve_clear_points = memnew(Button); curve_clear_points->set_theme_type_variation("FlatButton"); curve_clear_points->set_focus_mode(Control::FOCUS_NONE); curve_clear_points->set_tooltip_text(TTR("Clear Points")); - curve_clear_points->connect("pressed", callable_mp(this, &Path2DEditor::_confirm_clear_points)); + curve_clear_points->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_confirm_clear_points)); add_child(curve_clear_points); clear_points_dialog = memnew(ConfirmationDialog); diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 34af6d1d7e..3f5ade8a03 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -465,11 +465,11 @@ Path3DGizmo::Path3DGizmo(Path3D *p_path, float p_disk_size) { // Connecting to a signal once, rather than plaguing the implementation with calls to `Node3DEditor::update_transform_gizmo`. path->connect("curve_changed", callable_mp(this, &Path3DGizmo::_update_transform_gizmo)); - Path3DEditorPlugin::singleton->curve_edit->connect("pressed", callable_mp(this, &Path3DGizmo::redraw)); - Path3DEditorPlugin::singleton->curve_edit_curve->connect("pressed", callable_mp(this, &Path3DGizmo::redraw)); - Path3DEditorPlugin::singleton->curve_create->connect("pressed", callable_mp(this, &Path3DGizmo::redraw)); - Path3DEditorPlugin::singleton->curve_del->connect("pressed", callable_mp(this, &Path3DGizmo::redraw)); - Path3DEditorPlugin::singleton->curve_close->connect("pressed", callable_mp(this, &Path3DGizmo::redraw)); + Path3DEditorPlugin::singleton->curve_edit->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw)); + Path3DEditorPlugin::singleton->curve_edit_curve->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw)); + Path3DEditorPlugin::singleton->curve_create->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw)); + Path3DEditorPlugin::singleton->curve_del->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw)); + Path3DEditorPlugin::singleton->curve_close->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw)); } EditorPlugin::AfterGUIInput Path3DEditorPlugin::forward_3d_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { @@ -788,12 +788,12 @@ void Path3DEditorPlugin::_update_theme() { void Path3DEditorPlugin::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - curve_create->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_CREATE)); - curve_edit_curve->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT_CURVE)); - curve_edit_tilt->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT_TILT)); - curve_edit->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT)); - curve_del->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_DELETE)); - curve_close->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_close_curve)); + curve_create->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_CREATE)); + curve_edit_curve->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT_CURVE)); + curve_edit_tilt->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT_TILT)); + curve_edit->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT)); + curve_del->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_DELETE)); + curve_close->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_close_curve)); _update_theme(); } break; @@ -875,7 +875,7 @@ Path3DEditorPlugin::Path3DEditorPlugin() { curve_clear_points->set_theme_type_variation("FlatButton"); curve_clear_points->set_focus_mode(Control::FOCUS_NONE); curve_clear_points->set_tooltip_text(TTR("Clear Points")); - curve_clear_points->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_confirm_clear_points)); + curve_clear_points->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_confirm_clear_points)); topmenu_bar->add_child(curve_clear_points); clear_points_dialog = memnew(ConfirmationDialog); diff --git a/editor/plugins/plugin_config_dialog.cpp b/editor/plugins/plugin_config_dialog.cpp index a535b18b9d..fda06c3eec 100644 --- a/editor/plugins/plugin_config_dialog.cpp +++ b/editor/plugins/plugin_config_dialog.cpp @@ -161,7 +161,7 @@ void PluginConfigDialog::_notification(int p_what) { case NOTIFICATION_READY: { connect("confirmed", callable_mp(this, &PluginConfigDialog::_on_confirmed)); - get_cancel_button()->connect("pressed", callable_mp(this, &PluginConfigDialog::_on_canceled)); + get_cancel_button()->connect(SceneStringName(pressed), callable_mp(this, &PluginConfigDialog::_on_canceled)); } break; } } diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 240bf7463c..8bffbeaf15 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -212,7 +212,7 @@ void Polygon2DEditor::_update_bone_list() { cb->set_pressed(true); } - cb->connect("pressed", callable_mp(this, &Polygon2DEditor::_bone_paint_selected).bind(i)); + cb->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_bone_paint_selected).bind(i)); } uv_edit_draw->queue_redraw(); @@ -1302,7 +1302,7 @@ Polygon2DEditor::Polygon2DEditor() { button_uv->set_theme_type_variation("FlatButton"); add_child(button_uv); button_uv->set_tooltip_text(TTR("Open Polygon 2D UV editor.")); - button_uv->connect("pressed", callable_mp(this, &Polygon2DEditor::_menu_option).bind(MODE_EDIT_UV)); + button_uv->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_menu_option).bind(MODE_EDIT_UV)); uv_mode = UV_MODE_EDIT_POINT; uv_edit = memnew(AcceptDialog); @@ -1341,10 +1341,10 @@ Polygon2DEditor::Polygon2DEditor() { uv_edit_mode[2]->set_button_group(uv_edit_group); uv_edit_mode[3]->set_button_group(uv_edit_group); - uv_edit_mode[0]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(0)); - uv_edit_mode[1]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(1)); - uv_edit_mode[2]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(2)); - uv_edit_mode[3]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(3)); + uv_edit_mode[0]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(0)); + uv_edit_mode[1]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(1)); + uv_edit_mode[2]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(2)); + uv_edit_mode[3]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(3)); uv_mode_hb->add_child(memnew(VSeparator)); @@ -1354,7 +1354,7 @@ Polygon2DEditor::Polygon2DEditor() { uv_button[i]->set_theme_type_variation("FlatButton"); uv_button[i]->set_toggle_mode(true); uv_mode_hb->add_child(uv_button[i]); - uv_button[i]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_mode).bind(i)); + uv_button[i]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_mode).bind(i)); uv_button[i]->set_focus_mode(FOCUS_NONE); } @@ -1521,7 +1521,7 @@ Polygon2DEditor::Polygon2DEditor() { sync_bones = memnew(Button(TTR("Sync Bones to Polygon"))); bone_scroll_main_vb->add_child(sync_bones); sync_bones->set_h_size_flags(0); - sync_bones->connect("pressed", callable_mp(this, &Polygon2DEditor::_sync_bones)); + sync_bones->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_sync_bones)); uv_main_hsc->add_child(bone_scroll_main_vb); bone_scroll = memnew(ScrollContainer); bone_scroll->set_v_scroll(true); diff --git a/editor/plugins/polygon_3d_editor_plugin.cpp b/editor/plugins/polygon_3d_editor_plugin.cpp index 7c41093774..56baa4a839 100644 --- a/editor/plugins/polygon_3d_editor_plugin.cpp +++ b/editor/plugins/polygon_3d_editor_plugin.cpp @@ -538,13 +538,13 @@ Polygon3DEditor::Polygon3DEditor() { button_create = memnew(Button); button_create->set_theme_type_variation("FlatButton"); add_child(button_create); - button_create->connect("pressed", callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_CREATE)); + button_create->connect(SceneStringName(pressed), callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_CREATE)); button_create->set_toggle_mode(true); button_edit = memnew(Button); button_edit->set_theme_type_variation("FlatButton"); add_child(button_edit); - button_edit->connect("pressed", callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_EDIT)); + button_edit->connect(SceneStringName(pressed), callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_EDIT)); button_edit->set_toggle_mode(true); mode = MODE_EDIT; diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index c95195ae2a..ba6699fcc4 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -385,8 +385,8 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() { dialog = memnew(AcceptDialog); add_child(dialog); - load->connect("pressed", callable_mp(this, &ResourcePreloaderEditor::_load_pressed)); - paste->connect("pressed", callable_mp(this, &ResourcePreloaderEditor::_paste_pressed)); + load->connect(SceneStringName(pressed), callable_mp(this, &ResourcePreloaderEditor::_load_pressed)); + paste->connect(SceneStringName(pressed), callable_mp(this, &ResourcePreloaderEditor::_paste_pressed)); file->connect("files_selected", callable_mp(this, &ResourcePreloaderEditor::_files_load_request)); tree->connect("item_edited", callable_mp(this, &ResourcePreloaderEditor::_item_edited)); loading_scene = false; diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp index f6a5c58acf..4d0156eb5b 100644 --- a/editor/plugins/root_motion_editor_plugin.cpp +++ b/editor/plugins/root_motion_editor_plugin.cpp @@ -202,11 +202,11 @@ EditorPropertyRootMotion::EditorPropertyRootMotion() { assign = memnew(Button); assign->set_h_size_flags(SIZE_EXPAND_FILL); assign->set_clip_text(true); - assign->connect("pressed", callable_mp(this, &EditorPropertyRootMotion::_node_assign)); + assign->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyRootMotion::_node_assign)); hbc->add_child(assign); clear = memnew(Button); - clear->connect("pressed", callable_mp(this, &EditorPropertyRootMotion::_node_clear)); + clear->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyRootMotion::_node_clear)); hbc->add_child(clear); filter_dialog = memnew(ConfirmationDialog); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 9c5072ec67..6cb49bbfa6 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -4148,14 +4148,14 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) { site_search = memnew(Button); site_search->set_flat(true); site_search->set_text(TTR("Online Docs")); - site_search->connect("pressed", callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_WEBSITE)); + site_search->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_WEBSITE)); menu_hb->add_child(site_search); site_search->set_tooltip_text(TTR("Open Godot online documentation.")); help_search = memnew(Button); help_search->set_flat(true); help_search->set_text(TTR("Search Help")); - help_search->connect("pressed", callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_HELP)); + help_search->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_HELP)); menu_hb->add_child(help_search); help_search->set_tooltip_text(TTR("Search the reference documentation.")); @@ -4163,14 +4163,14 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) { script_back = memnew(Button); script_back->set_flat(true); - script_back->connect("pressed", callable_mp(this, &ScriptEditor::_history_back)); + script_back->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_history_back)); menu_hb->add_child(script_back); script_back->set_disabled(true); script_back->set_tooltip_text(TTR("Go to previous edited document.")); script_forward = memnew(Button); script_forward->set_flat(true); - script_forward->connect("pressed", callable_mp(this, &ScriptEditor::_history_forward)); + script_forward->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_history_forward)); menu_hb->add_child(script_forward); script_forward->set_disabled(true); script_forward->set_tooltip_text(TTR("Go to next edited document.")); diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp index 3e025f8ba0..dac5592113 100644 --- a/editor/plugins/shader_file_editor_plugin.cpp +++ b/editor/plugins/shader_file_editor_plugin.cpp @@ -286,7 +286,7 @@ ShaderFileEditor::ShaderFileEditor() { stage_hb->add_child(button); stages[i] = button; button->set_button_group(bg); - button->connect("pressed", callable_mp(this, &ShaderFileEditor::_version_selected).bind(i)); + button->connect(SceneStringName(pressed), callable_mp(this, &ShaderFileEditor::_version_selected).bind(i)); } error_text = memnew(RichTextLabel); diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index 527c56aec3..e792f0998b 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -789,7 +789,7 @@ void Skeleton3DEditor::create_editors() { key_insert_button = memnew(Button); key_insert_button->set_theme_type_variation("FlatButton"); key_insert_button->set_focus_mode(FOCUS_NONE); - key_insert_button->connect("pressed", callable_mp(this, &Skeleton3DEditor::insert_keys).bind(false)); + key_insert_button->connect(SceneStringName(pressed), callable_mp(this, &Skeleton3DEditor::insert_keys).bind(false)); key_insert_button->set_tooltip_text(TTR("Insert key of bone poses already exist track.")); key_insert_button->set_shortcut(ED_SHORTCUT("skeleton_3d_editor/insert_key_to_existing_tracks", TTR("Insert Key (Existing Tracks)"), Key::INSERT)); animation_hb->add_child(key_insert_button); @@ -797,7 +797,7 @@ void Skeleton3DEditor::create_editors() { key_insert_all_button = memnew(Button); key_insert_all_button->set_theme_type_variation("FlatButton"); key_insert_all_button->set_focus_mode(FOCUS_NONE); - key_insert_all_button->connect("pressed", callable_mp(this, &Skeleton3DEditor::insert_keys).bind(true)); + key_insert_all_button->connect(SceneStringName(pressed), callable_mp(this, &Skeleton3DEditor::insert_keys).bind(true)); key_insert_all_button->set_tooltip_text(TTR("Insert key of all bone poses.")); key_insert_all_button->set_shortcut(ED_SHORTCUT("skeleton_3d_editor/insert_key_of_all_bones", TTR("Insert Key (All Bones)"), KeyModifierMask::CMD_OR_CTRL + Key::INSERT)); animation_hb->add_child(key_insert_all_button); diff --git a/editor/plugins/skeleton_ik_3d_editor_plugin.cpp b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp index 003380dec1..1753df5cb7 100644 --- a/editor/plugins/skeleton_ik_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp @@ -82,7 +82,7 @@ SkeletonIK3DEditorPlugin::SkeletonIK3DEditorPlugin() { play_btn->set_text(TTR("Play IK")); play_btn->set_toggle_mode(true); play_btn->hide(); - play_btn->connect("pressed", callable_mp(this, &SkeletonIK3DEditorPlugin::_play)); + play_btn->connect(SceneStringName(pressed), callable_mp(this, &SkeletonIK3DEditorPlugin::_play)); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, play_btn); skeleton_ik = nullptr; } diff --git a/editor/plugins/sprite_2d_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index fa1fd626c3..0b882e265d 100644 --- a/editor/plugins/sprite_2d_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -647,7 +647,7 @@ Sprite2DEditor::Sprite2DEditor() { hb->add_spacer(); update_preview = memnew(Button); update_preview->set_text(TTR("Update Preview")); - update_preview->connect("pressed", callable_mp(this, &Sprite2DEditor::_update_mesh_data)); + update_preview->connect(SceneStringName(pressed), callable_mp(this, &Sprite2DEditor::_update_mesh_data)); hb->add_child(update_preview); vb->add_margin_child(TTR("Settings:"), hb); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 46a478b0c3..56f8e1173f 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -1782,13 +1782,13 @@ SpriteFramesEditor::SpriteFramesEditor() { add_anim = memnew(Button); add_anim->set_theme_type_variation("FlatButton"); hbc_animlist->add_child(add_anim); - add_anim->connect("pressed", callable_mp(this, &SpriteFramesEditor::_animation_add)); + add_anim->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_animation_add)); delete_anim = memnew(Button); delete_anim->set_theme_type_variation("FlatButton"); hbc_animlist->add_child(delete_anim); delete_anim->set_disabled(true); - delete_anim->connect("pressed", callable_mp(this, &SpriteFramesEditor::_animation_remove)); + delete_anim->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_animation_remove)); autoplay_container = memnew(HBoxContainer); hbc_animlist->add_child(autoplay_container); @@ -1806,7 +1806,7 @@ SpriteFramesEditor::SpriteFramesEditor() { anim_loop->set_toggle_mode(true); anim_loop->set_theme_type_variation("FlatButton"); anim_loop->set_tooltip_text(TTR("Animation Looping")); - anim_loop->connect("pressed", callable_mp(this, &SpriteFramesEditor::_animation_loop_changed)); + anim_loop->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_animation_loop_changed)); hbc_animlist->add_child(anim_loop); anim_speed = memnew(SpinBox); @@ -1890,13 +1890,13 @@ SpriteFramesEditor::SpriteFramesEditor() { playback_container->add_child(memnew(VSeparator)); - autoplay->connect("pressed", callable_mp(this, &SpriteFramesEditor::_autoplay_pressed)); + autoplay->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_autoplay_pressed)); autoplay->set_toggle_mode(true); - play->connect("pressed", callable_mp(this, &SpriteFramesEditor::_play_pressed)); - play_from->connect("pressed", callable_mp(this, &SpriteFramesEditor::_play_from_pressed)); - play_bw->connect("pressed", callable_mp(this, &SpriteFramesEditor::_play_bw_pressed)); - play_bw_from->connect("pressed", callable_mp(this, &SpriteFramesEditor::_play_bw_from_pressed)); - stop->connect("pressed", callable_mp(this, &SpriteFramesEditor::_stop_pressed)); + play->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_play_pressed)); + play_from->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_play_from_pressed)); + play_bw->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_play_bw_pressed)); + play_bw_from->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_play_bw_from_pressed)); + stop->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_stop_pressed)); HBoxContainer *hbc_actions = memnew(HBoxContainer); hfc->add_child(hbc_actions); @@ -1973,19 +1973,19 @@ SpriteFramesEditor::SpriteFramesEditor() { hfc->add_child(hbc_zoom); zoom_out = memnew(Button); - zoom_out->connect("pressed", callable_mp(this, &SpriteFramesEditor::_zoom_out)); + zoom_out->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_zoom_out)); zoom_out->set_flat(true); zoom_out->set_tooltip_text(TTR("Zoom Out")); hbc_zoom->add_child(zoom_out); zoom_reset = memnew(Button); - zoom_reset->connect("pressed", callable_mp(this, &SpriteFramesEditor::_zoom_reset)); + zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_zoom_reset)); zoom_reset->set_flat(true); zoom_reset->set_tooltip_text(TTR("Zoom Reset")); hbc_zoom->add_child(zoom_reset); zoom_in = memnew(Button); - zoom_in->connect("pressed", callable_mp(this, &SpriteFramesEditor::_zoom_in)); + zoom_in->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_zoom_in)); zoom_in->set_flat(true); zoom_in->set_tooltip_text(TTR("Zoom In")); hbc_zoom->add_child(zoom_in); @@ -2014,15 +2014,15 @@ SpriteFramesEditor::SpriteFramesEditor() { dialog = memnew(AcceptDialog); add_child(dialog); - load->connect("pressed", callable_mp(this, &SpriteFramesEditor::_load_pressed)); - load_sheet->connect("pressed", callable_mp(this, &SpriteFramesEditor::_open_sprite_sheet)); - delete_frame->connect("pressed", callable_mp(this, &SpriteFramesEditor::_delete_pressed)); - copy->connect("pressed", callable_mp(this, &SpriteFramesEditor::_copy_pressed)); - paste->connect("pressed", callable_mp(this, &SpriteFramesEditor::_paste_pressed)); - empty_before->connect("pressed", callable_mp(this, &SpriteFramesEditor::_empty_pressed)); - empty_after->connect("pressed", callable_mp(this, &SpriteFramesEditor::_empty2_pressed)); - move_up->connect("pressed", callable_mp(this, &SpriteFramesEditor::_up_pressed)); - move_down->connect("pressed", callable_mp(this, &SpriteFramesEditor::_down_pressed)); + load->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_load_pressed)); + load_sheet->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_open_sprite_sheet)); + delete_frame->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_delete_pressed)); + copy->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_copy_pressed)); + paste->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_paste_pressed)); + empty_before->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_empty_pressed)); + empty_after->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_empty2_pressed)); + move_up->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_up_pressed)); + move_down->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_down_pressed)); load->set_shortcut_context(frame_list); load->set_shortcut(ED_SHORTCUT("sprite_frames/load_from_file", TTR("Add frame from file"), KeyModifierMask::CMD_OR_CTRL | Key::O)); @@ -2096,12 +2096,12 @@ SpriteFramesEditor::SpriteFramesEditor() { Button *select_all = memnew(Button); select_all->set_text(TTR("Select All")); - select_all->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_select_all_frames)); + select_all->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_select_all_frames)); split_sheet_menu_hb->add_child(select_all); Button *clear_all = memnew(Button); clear_all->set_text(TTR("Select None")); - clear_all->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_clear_all_frames)); + clear_all->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_clear_all_frames)); split_sheet_menu_hb->add_child(clear_all); split_sheet_menu_hb->add_spacer(); @@ -2109,7 +2109,7 @@ SpriteFramesEditor::SpriteFramesEditor() { toggle_settings_button = memnew(Button); toggle_settings_button->set_h_size_flags(SIZE_SHRINK_END); toggle_settings_button->set_theme_type_variation("FlatButton"); - toggle_settings_button->connect("pressed", callable_mp(this, &SpriteFramesEditor::_toggle_show_settings)); + toggle_settings_button->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_toggle_show_settings)); toggle_settings_button->set_tooltip_text(TTR("Toggle Settings Panel")); split_sheet_menu_hb->add_child(toggle_settings_button); @@ -2149,21 +2149,21 @@ SpriteFramesEditor::SpriteFramesEditor() { split_sheet_zoom_out->set_theme_type_variation("FlatButton"); split_sheet_zoom_out->set_focus_mode(FOCUS_NONE); split_sheet_zoom_out->set_tooltip_text(TTR("Zoom Out")); - split_sheet_zoom_out->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_zoom_out)); + split_sheet_zoom_out->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_zoom_out)); split_sheet_zoom_hb->add_child(split_sheet_zoom_out); split_sheet_zoom_reset = memnew(Button); split_sheet_zoom_reset->set_theme_type_variation("FlatButton"); split_sheet_zoom_reset->set_focus_mode(FOCUS_NONE); split_sheet_zoom_reset->set_tooltip_text(TTR("Zoom Reset")); - split_sheet_zoom_reset->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_zoom_reset)); + split_sheet_zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_zoom_reset)); split_sheet_zoom_hb->add_child(split_sheet_zoom_reset); split_sheet_zoom_in = memnew(Button); split_sheet_zoom_in->set_theme_type_variation("FlatButton"); split_sheet_zoom_in->set_focus_mode(FOCUS_NONE); split_sheet_zoom_in->set_tooltip_text(TTR("Zoom In")); - split_sheet_zoom_in->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_zoom_in)); + split_sheet_zoom_in->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_zoom_in)); split_sheet_zoom_hb->add_child(split_sheet_zoom_in); split_sheet_settings_vb = memnew(VBoxContainer); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 00c3cf4663..6b90ea79b2 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -1228,19 +1228,19 @@ TextureRegionEditor::TextureRegionEditor() { zoom_out = memnew(Button); zoom_out->set_flat(true); zoom_out->set_tooltip_text(TTR("Zoom Out")); - zoom_out->connect("pressed", callable_mp(this, &TextureRegionEditor::_zoom_out)); + zoom_out->connect(SceneStringName(pressed), callable_mp(this, &TextureRegionEditor::_zoom_out)); zoom_hb->add_child(zoom_out); zoom_reset = memnew(Button); zoom_reset->set_flat(true); zoom_reset->set_tooltip_text(TTR("Zoom Reset")); - zoom_reset->connect("pressed", callable_mp(this, &TextureRegionEditor::_zoom_reset)); + zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &TextureRegionEditor::_zoom_reset)); zoom_hb->add_child(zoom_reset); zoom_in = memnew(Button); zoom_in->set_flat(true); zoom_in->set_tooltip_text(TTR("Zoom In")); - zoom_in->connect("pressed", callable_mp(this, &TextureRegionEditor::_zoom_in)); + zoom_in->connect(SceneStringName(pressed), callable_mp(this, &TextureRegionEditor::_zoom_in)); zoom_hb->add_child(zoom_in); vscroll = memnew(VScrollBar); @@ -1271,7 +1271,7 @@ bool EditorInspectorPluginTextureRegion::parse_property(Object *p_object, const if (((Object::cast_to<Sprite2D>(p_object) || Object::cast_to<Sprite3D>(p_object) || Object::cast_to<NinePatchRect>(p_object) || Object::cast_to<StyleBoxTexture>(p_object)) && p_path == "region_rect") || (Object::cast_to<AtlasTexture>(p_object) && p_path == "region")) { Button *button = EditorInspector::create_inspector_action_button(TTR("Edit Region")); button->set_icon(texture_region_editor->get_editor_theme_icon(SNAME("RegionEdit"))); - button->connect("pressed", callable_mp(this, &EditorInspectorPluginTextureRegion::_region_edit).bind(p_object)); + button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorPluginTextureRegion::_region_edit).bind(p_object)); add_property_editor(p_path, button, true); } } diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index ef1bbdcb0f..8489574194 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -1120,15 +1120,15 @@ ThemeItemImportTree::ThemeItemImportTree() { select_all_items_button->set_flat(true); select_all_items_button->set_tooltip_text(select_all_items_tooltip); button_set->add_child(select_all_items_button); - select_all_items_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_select_all_data_type_pressed).bind(i)); + select_all_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_select_all_data_type_pressed).bind(i)); select_full_items_button->set_flat(true); select_full_items_button->set_tooltip_text(select_full_items_tooltip); button_set->add_child(select_full_items_button); - select_full_items_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_select_full_data_type_pressed).bind(i)); + select_full_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_select_full_data_type_pressed).bind(i)); deselect_all_items_button->set_flat(true); deselect_all_items_button->set_tooltip_text(deselect_all_items_tooltip); button_set->add_child(deselect_all_items_button); - deselect_all_items_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_deselect_all_data_type_pressed).bind(i)); + deselect_all_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_deselect_all_data_type_pressed).bind(i)); total_selected_items_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); total_selected_items_label->hide(); @@ -1159,12 +1159,12 @@ ThemeItemImportTree::ThemeItemImportTree() { import_collapse_types_button->set_flat(true); import_collapse_types_button->set_tooltip_text(TTR("Collapse types.")); import_buttons->add_child(import_collapse_types_button); - import_collapse_types_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_toggle_type_items).bind(true)); + import_collapse_types_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_toggle_type_items).bind(true)); import_expand_types_button = memnew(Button); import_expand_types_button->set_flat(true); import_expand_types_button->set_tooltip_text(TTR("Expand types.")); import_buttons->add_child(import_expand_types_button); - import_expand_types_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_toggle_type_items).bind(false)); + import_expand_types_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_toggle_type_items).bind(false)); import_buttons->add_child(memnew(VSeparator)); @@ -1173,26 +1173,26 @@ ThemeItemImportTree::ThemeItemImportTree() { import_select_all_button->set_text(TTR("Select All")); import_select_all_button->set_tooltip_text(TTR("Select all Theme items.")); import_buttons->add_child(import_select_all_button); - import_select_all_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_select_all_items_pressed)); + import_select_all_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_select_all_items_pressed)); import_select_full_button = memnew(Button); import_select_full_button->set_flat(true); import_select_full_button->set_text(TTR("Select With Data")); import_select_full_button->set_tooltip_text(TTR("Select all Theme items with item data.")); import_buttons->add_child(import_select_full_button); - import_select_full_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_select_full_items_pressed)); + import_select_full_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_select_full_items_pressed)); import_deselect_all_button = memnew(Button); import_deselect_all_button->set_flat(true); import_deselect_all_button->set_text(TTR("Deselect All")); import_deselect_all_button->set_tooltip_text(TTR("Deselect all Theme items.")); import_buttons->add_child(import_deselect_all_button); - import_deselect_all_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_deselect_all_items_pressed)); + import_deselect_all_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_deselect_all_items_pressed)); import_buttons->add_spacer(); Button *import_add_selected_button = memnew(Button); import_add_selected_button->set_text(TTR("Import Selected")); import_buttons->add_child(import_add_selected_button); - import_add_selected_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_import_selected)); + import_add_selected_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_import_selected)); } /////////////////////// @@ -1950,7 +1950,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito edit_add_type_hb->add_child(edit_add_type_value); edit_add_type_button = memnew(Button); edit_add_type_hb->add_child(edit_add_type_button); - edit_add_type_button->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_add_theme_type).bind("")); + edit_add_type_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_add_theme_type).bind("")); VBoxContainer *edit_items_vb = memnew(VBoxContainer); edit_items_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -1968,42 +1968,42 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito edit_items_add_color->set_flat(true); edit_items_add_color->set_disabled(true); edit_items_toolbar->add_child(edit_items_add_color); - edit_items_add_color->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_COLOR)); + edit_items_add_color->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_COLOR)); edit_items_add_constant = memnew(Button); edit_items_add_constant->set_tooltip_text(TTR("Add Constant Item")); edit_items_add_constant->set_flat(true); edit_items_add_constant->set_disabled(true); edit_items_toolbar->add_child(edit_items_add_constant); - edit_items_add_constant->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_CONSTANT)); + edit_items_add_constant->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_CONSTANT)); edit_items_add_font = memnew(Button); edit_items_add_font->set_tooltip_text(TTR("Add Font Item")); edit_items_add_font->set_flat(true); edit_items_add_font->set_disabled(true); edit_items_toolbar->add_child(edit_items_add_font); - edit_items_add_font->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_FONT)); + edit_items_add_font->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_FONT)); edit_items_add_font_size = memnew(Button); edit_items_add_font_size->set_tooltip_text(TTR("Add Font Size Item")); edit_items_add_font_size->set_flat(true); edit_items_add_font_size->set_disabled(true); edit_items_toolbar->add_child(edit_items_add_font_size); - edit_items_add_font_size->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_FONT_SIZE)); + edit_items_add_font_size->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_FONT_SIZE)); edit_items_add_icon = memnew(Button); edit_items_add_icon->set_tooltip_text(TTR("Add Icon Item")); edit_items_add_icon->set_flat(true); edit_items_add_icon->set_disabled(true); edit_items_toolbar->add_child(edit_items_add_icon); - edit_items_add_icon->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_ICON)); + edit_items_add_icon->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_ICON)); edit_items_add_stylebox = memnew(Button); edit_items_add_stylebox->set_tooltip_text(TTR("Add StyleBox Item")); edit_items_add_stylebox->set_flat(true); edit_items_add_stylebox->set_disabled(true); edit_items_toolbar->add_child(edit_items_add_stylebox); - edit_items_add_stylebox->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_STYLEBOX)); + edit_items_add_stylebox->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_STYLEBOX)); edit_items_toolbar->add_child(memnew(VSeparator)); @@ -2016,21 +2016,21 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito edit_items_remove_class->set_flat(true); edit_items_remove_class->set_disabled(true); edit_items_toolbar->add_child(edit_items_remove_class); - edit_items_remove_class->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_remove_class_items)); + edit_items_remove_class->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_remove_class_items)); edit_items_remove_custom = memnew(Button); edit_items_remove_custom->set_tooltip_text(TTR("Remove Custom Items")); edit_items_remove_custom->set_flat(true); edit_items_remove_custom->set_disabled(true); edit_items_toolbar->add_child(edit_items_remove_custom); - edit_items_remove_custom->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_remove_custom_items)); + edit_items_remove_custom->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_remove_custom_items)); edit_items_remove_all = memnew(Button); edit_items_remove_all->set_tooltip_text(TTR("Remove All Items")); edit_items_remove_all->set_flat(true); edit_items_remove_all->set_disabled(true); edit_items_toolbar->add_child(edit_items_remove_all); - edit_items_remove_all->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_remove_all_items)); + edit_items_remove_all->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_remove_all_items)); edit_items_tree = memnew(Tree); edit_items_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); @@ -2096,7 +2096,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito import_another_file_hb->add_child(import_another_theme_value); import_another_theme_button = memnew(Button); import_another_file_hb->add_child(import_another_theme_button); - import_another_theme_button->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_select_another_theme)); + import_another_theme_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_select_another_theme)); import_another_theme_dialog = memnew(EditorFileDialog); import_another_theme_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); @@ -2296,7 +2296,7 @@ VBoxContainer *ThemeTypeEditor::_create_item_list(Theme::DataType p_data_type) { item_add_button->set_text(TTR("Add")); item_add_button->set_disabled(true); item_add_hb->add_child(item_add_button); - item_add_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_add_cbk).bind(p_data_type, item_add_edit)); + item_add_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_add_cbk).bind(p_data_type, item_add_edit)); item_add_edit->set_meta("button", item_add_button); item_add_edit->connect("text_changed", callable_mp(this, &ThemeTypeEditor::_update_add_button).bind(item_add_edit)); @@ -2472,21 +2472,21 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_ item_rename_button->set_tooltip_text(TTR("Rename Item")); item_rename_button->set_flat(true); item_name_container->add_child(item_rename_button); - item_rename_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_cbk).bind(p_data_type, p_item_name, item_name_container)); + item_rename_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_rename_cbk).bind(p_data_type, p_item_name, item_name_container)); Button *item_remove_button = memnew(Button); item_remove_button->set_icon(get_editor_theme_icon(SNAME("Remove"))); item_remove_button->set_tooltip_text(TTR("Remove Item")); item_remove_button->set_flat(true); item_name_container->add_child(item_remove_button); - item_remove_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_remove_cbk).bind(p_data_type, p_item_name)); + item_remove_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_remove_cbk).bind(p_data_type, p_item_name)); Button *item_rename_confirm_button = memnew(Button); item_rename_confirm_button->set_icon(get_editor_theme_icon(SNAME("ImportCheck"))); item_rename_confirm_button->set_tooltip_text(TTR("Confirm Item Rename")); item_rename_confirm_button->set_flat(true); item_name_container->add_child(item_rename_confirm_button); - item_rename_confirm_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_confirmed).bind(p_data_type, p_item_name, item_name_container)); + item_rename_confirm_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_rename_confirmed).bind(p_data_type, p_item_name, item_name_container)); item_rename_confirm_button->hide(); Button *item_rename_cancel_button = memnew(Button); @@ -2494,7 +2494,7 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_ item_rename_cancel_button->set_tooltip_text(TTR("Cancel Item Rename")); item_rename_cancel_button->set_flat(true); item_name_container->add_child(item_rename_cancel_button); - item_rename_cancel_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_canceled).bind(p_data_type, p_item_name, item_name_container)); + item_rename_cancel_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_rename_canceled).bind(p_data_type, p_item_name, item_name_container)); item_rename_cancel_button->hide(); } else { item_name->add_theme_color_override("font_color", get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor))); @@ -2504,7 +2504,7 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_ item_override_button->set_tooltip_text(TTR("Override Item")); item_override_button->set_flat(true); item_name_container->add_child(item_override_button); - item_override_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_override_cbk).bind(p_data_type, p_item_name)); + item_override_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_override_cbk).bind(p_data_type, p_item_name)); } return item_control; @@ -2712,7 +2712,7 @@ void ThemeTypeEditor::_update_type_items() { pin_leader_button->set_icon(get_editor_theme_icon(SNAME("Pin"))); pin_leader_button->set_tooltip_text(TTR("Unpin this StyleBox as a main style.")); item_control->add_child(pin_leader_button); - pin_leader_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_on_unpin_leader_button_pressed)); + pin_leader_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_on_unpin_leader_button_pressed)); item_control->add_child(item_editor); @@ -2755,7 +2755,7 @@ void ThemeTypeEditor::_update_type_items() { pin_leader_button->set_icon(get_editor_theme_icon(SNAME("Pin"))); pin_leader_button->set_tooltip_text(TTR("Pin this StyleBox as a main style. Editing its properties will update the same properties in all other StyleBoxes of this type.")); item_control->add_child(pin_leader_button); - pin_leader_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_on_pin_leader_button_pressed).bind(item_editor, E.key)); + pin_leader_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_on_pin_leader_button_pressed).bind(item_editor, E.key)); } else { if (ThemeDB::get_singleton()->get_default_theme()->has_stylebox(E.key, edited_type)) { item_editor->set_edited_resource(ThemeDB::get_singleton()->get_default_theme()->get_stylebox(E.key, edited_type)); @@ -3446,7 +3446,7 @@ ThemeTypeEditor::ThemeTypeEditor() { add_type_button = memnew(Button); add_type_button->set_tooltip_text(TTR("Add a type from a list of available types or create a new one.")); type_list_hb->add_child(add_type_button); - add_type_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_add_type_button_cbk)); + add_type_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_add_type_button_cbk)); HBoxContainer *type_controls = memnew(HBoxContainer); main_vb->add_child(type_controls); @@ -3457,14 +3457,14 @@ ThemeTypeEditor::ThemeTypeEditor() { show_default_items_button->set_tooltip_text(TTR("Show default type items alongside items that have been overridden.")); show_default_items_button->set_pressed(true); type_controls->add_child(show_default_items_button); - show_default_items_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_update_type_items)); + show_default_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_update_type_items)); Button *add_default_items_button = memnew(Button); add_default_items_button->set_h_size_flags(SIZE_EXPAND_FILL); add_default_items_button->set_text(TTR("Override All")); add_default_items_button->set_tooltip_text(TTR("Override all default type items.")); type_controls->add_child(add_default_items_button); - add_default_items_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_add_default_type_items)); + add_default_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_add_default_type_items)); data_type_tabs = memnew(TabContainer); data_type_tabs->set_tab_alignment(TabBar::ALIGNMENT_CENTER); @@ -3510,7 +3510,7 @@ ThemeTypeEditor::ThemeTypeEditor() { type_variation_button = memnew(Button); type_variation_hb->add_child(type_variation_button); type_variation_button->set_tooltip_text(TTR("Select the variation base type from a list of available types.")); - type_variation_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_add_type_variation_cbk)); + type_variation_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_add_type_variation_cbk)); type_variation_locked = memnew(Label); type_variation_vb->add_child(type_variation_locked); @@ -3691,19 +3691,19 @@ ThemeEditor::ThemeEditor() { Button *theme_save_button = memnew(Button); theme_save_button->set_text(TTR("Save")); theme_save_button->set_flat(true); - theme_save_button->connect("pressed", callable_mp(this, &ThemeEditor::_theme_save_button_cbk).bind(false)); + theme_save_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_theme_save_button_cbk).bind(false)); top_menu->add_child(theme_save_button); Button *theme_save_as_button = memnew(Button); theme_save_as_button->set_text(TTR("Save As...")); theme_save_as_button->set_flat(true); - theme_save_as_button->connect("pressed", callable_mp(this, &ThemeEditor::_theme_save_button_cbk).bind(true)); + theme_save_as_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_theme_save_button_cbk).bind(true)); top_menu->add_child(theme_save_as_button); Button *theme_close_button = memnew(Button); theme_close_button->set_text(TTR("Close")); theme_close_button->set_flat(true); - theme_close_button->connect("pressed", callable_mp(this, &ThemeEditor::_theme_close_button_cbk)); + theme_close_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_theme_close_button_cbk)); top_menu->add_child(theme_close_button); top_menu->add_child(memnew(VSeparator)); @@ -3712,7 +3712,7 @@ ThemeEditor::ThemeEditor() { theme_edit_button->set_text(TTR("Manage Items...")); theme_edit_button->set_tooltip_text(TTR("Add, remove, organize and import Theme items.")); theme_edit_button->set_flat(true); - theme_edit_button->connect("pressed", callable_mp(this, &ThemeEditor::_theme_edit_button_cbk)); + theme_edit_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_theme_edit_button_cbk)); top_menu->add_child(theme_edit_button); theme_type_editor = memnew(ThemeTypeEditor); @@ -3748,7 +3748,7 @@ ThemeEditor::ThemeEditor() { add_preview_button = memnew(Button); add_preview_button->set_text(TTR("Add Preview")); add_preview_button_hb->add_child(add_preview_button); - add_preview_button->connect("pressed", callable_mp(this, &ThemeEditor::_add_preview_button_cbk)); + add_preview_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_add_preview_button_cbk)); DefaultThemeEditorPreview *default_preview_tab = memnew(DefaultThemeEditorPreview); preview_tabs_content->add_child(default_preview_tab); diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index e3cc80ebbc..4d98b24ccc 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -243,7 +243,7 @@ ThemeEditorPreview::ThemeEditorPreview() { picker_button->set_theme_type_variation("FlatButton"); picker_button->set_toggle_mode(true); picker_button->set_tooltip_text(TTR("Toggle the control picker, allowing to visually select control types for edit.")); - picker_button->connect("pressed", callable_mp(this, &ThemeEditorPreview::_picker_button_cbk)); + picker_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditorPreview::_picker_button_cbk)); MarginContainer *preview_body = memnew(MarginContainer); preview_body->set_custom_minimum_size(Size2(480, 0) * EDSCALE); @@ -531,5 +531,5 @@ SceneThemeEditorPreview::SceneThemeEditorPreview() { reload_scene_button->set_flat(true); reload_scene_button->set_tooltip_text(TTR("Reload the scene to reflect its most actual state.")); preview_toolbar->add_child(reload_scene_button); - reload_scene_button->connect("pressed", callable_mp(this, &SceneThemeEditorPreview::_reload_scene)); + reload_scene_button->connect(SceneStringName(pressed), callable_mp(this, &SceneThemeEditorPreview::_reload_scene)); } diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index 0807b59c22..2ee0dc0316 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -614,7 +614,7 @@ TileAtlasView::TileAtlasView() { button_center_view = memnew(Button); button_center_view->set_anchors_and_offsets_preset(Control::PRESET_TOP_RIGHT, Control::PRESET_MODE_MINSIZE, 5); button_center_view->set_grow_direction_preset(Control::PRESET_TOP_RIGHT); - button_center_view->connect("pressed", callable_mp(this, &TileAtlasView::_center_view)); + button_center_view->connect(SceneStringName(pressed), callable_mp(this, &TileAtlasView::_center_view)); button_center_view->set_flat(true); button_center_view->set_disabled(true); button_center_view->set_tooltip_text(TTR("Center View")); diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index 3dd4ccc132..2d0e5214db 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -952,7 +952,7 @@ GenericTilePolygonEditor::GenericTilePolygonEditor() { button_center_view = memnew(Button); button_center_view->set_anchors_and_offsets_preset(Control::PRESET_TOP_RIGHT, Control::PRESET_MODE_MINSIZE, 5); button_center_view->set_grow_direction_preset(Control::PRESET_TOP_RIGHT); - button_center_view->connect("pressed", callable_mp(this, &GenericTilePolygonEditor::_center_view)); + button_center_view->connect(SceneStringName(pressed), callable_mp(this, &GenericTilePolygonEditor::_center_view)); button_center_view->set_theme_type_variation("FlatButton"); button_center_view->set_tooltip_text(TTR("Center View")); button_center_view->set_disabled(true); diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp index 285302ca56..98c05e9b15 100644 --- a/editor/plugins/tiles/tile_map_layer_editor.cpp +++ b/editor/plugins/tiles/tile_map_layer_editor.cpp @@ -616,7 +616,7 @@ bool TileMapLayerEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEven b->set_pressed(b->get_button_group().is_valid() || !b->is_pressed()); } else { // Can't press a button without toggle mode, so just emit the signal directly. - b->emit_signal(SNAME("pressed")); + b->emit_signal(SceneStringName(pressed)); } return true; } @@ -2209,7 +2209,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { select_tool_button->set_toggle_mode(true); select_tool_button->set_button_group(tool_buttons_group); select_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/selection_tool", TTR("Selection"), Key::S)); - select_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); + select_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(select_tool_button); viewport_shortcut_buttons.push_back(select_tool_button); @@ -2219,7 +2219,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { paint_tool_button->set_button_group(tool_buttons_group); paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", TTR("Paint"), Key::D)); paint_tool_button->set_tooltip_text(TTR("Shift: Draw line.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Shift: Draw rectangle.")); - paint_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); + paint_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(paint_tool_button); viewport_shortcut_buttons.push_back(paint_tool_button); @@ -2229,7 +2229,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { line_tool_button->set_button_group(tool_buttons_group); // TRANSLATORS: This refers to the line tool in the tilemap editor. line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", TTR("Line", "Tool"), Key::L)); - line_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); + line_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(line_tool_button); viewport_shortcut_buttons.push_back(line_tool_button); @@ -2238,7 +2238,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { rect_tool_button->set_toggle_mode(true); rect_tool_button->set_button_group(tool_buttons_group); rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", TTR("Rect"), Key::R)); - rect_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); + rect_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(rect_tool_button); viewport_shortcut_buttons.push_back(rect_tool_button); @@ -2247,7 +2247,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { bucket_tool_button->set_toggle_mode(true); bucket_tool_button->set_button_group(tool_buttons_group); bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", TTR("Bucket"), Key::B)); - bucket_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); + bucket_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(bucket_tool_button); toolbar->add_child(tilemap_tiles_tools_buttons); viewport_shortcut_buttons.push_back(bucket_tool_button); @@ -2266,7 +2266,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P)); Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL; picker_button->set_tooltip_text(vformat(TTR("Alternatively hold %s with other tools to pick tile."), find_keycode_name(key))); - picker_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport)); + picker_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport)); tools_settings->add_child(picker_button); viewport_shortcut_buttons.push_back(picker_button); @@ -2276,7 +2276,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { erase_button->set_toggle_mode(true); erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", TTR("Eraser"), Key::E)); erase_button->set_tooltip_text(TTR("Alternatively use RMB to erase tiles.")); - erase_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport)); + erase_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport)); tools_settings->add_child(erase_button); viewport_shortcut_buttons.push_back(erase_button); @@ -2289,28 +2289,28 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { transform_button_rotate_left->set_theme_type_variation("FlatButton"); transform_button_rotate_left->set_shortcut(ED_SHORTCUT("tiles_editor/rotate_tile_left", TTR("Rotate Tile Left"), Key::Z)); transform_toolbar->add_child(transform_button_rotate_left); - transform_button_rotate_left->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_LEFT)); + transform_button_rotate_left->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_LEFT)); viewport_shortcut_buttons.push_back(transform_button_rotate_left); transform_button_rotate_right = memnew(Button); transform_button_rotate_right->set_theme_type_variation("FlatButton"); transform_button_rotate_right->set_shortcut(ED_SHORTCUT("tiles_editor/rotate_tile_right", TTR("Rotate Tile Right"), Key::X)); transform_toolbar->add_child(transform_button_rotate_right); - transform_button_rotate_right->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_RIGHT)); + transform_button_rotate_right->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_RIGHT)); viewport_shortcut_buttons.push_back(transform_button_rotate_right); transform_button_flip_h = memnew(Button); transform_button_flip_h->set_theme_type_variation("FlatButton"); transform_button_flip_h->set_shortcut(ED_SHORTCUT("tiles_editor/flip_tile_horizontal", TTR("Flip Tile Horizontally"), Key::C)); transform_toolbar->add_child(transform_button_flip_h); - transform_button_flip_h->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_H)); + transform_button_flip_h->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_H)); viewport_shortcut_buttons.push_back(transform_button_flip_h); transform_button_flip_v = memnew(Button); transform_button_flip_v->set_theme_type_variation("FlatButton"); transform_button_flip_v->set_shortcut(ED_SHORTCUT("tiles_editor/flip_tile_vertical", TTR("Flip Tile Vertically"), Key::V)); transform_toolbar->add_child(transform_button_flip_v); - transform_button_flip_v->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_V)); + transform_button_flip_v->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_V)); viewport_shortcut_buttons.push_back(transform_button_flip_v); // Separator 2. @@ -3553,7 +3553,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() { paint_tool_button->set_button_group(tool_buttons_group); paint_tool_button->set_pressed(true); paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", TTR("Paint"), Key::D)); - paint_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar)); + paint_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(paint_tool_button); viewport_shortcut_buttons.push_back(paint_tool_button); @@ -3562,7 +3562,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() { line_tool_button->set_toggle_mode(true); line_tool_button->set_button_group(tool_buttons_group); line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", TTR("Line"), Key::L)); - line_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar)); + line_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(line_tool_button); viewport_shortcut_buttons.push_back(line_tool_button); @@ -3571,7 +3571,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() { rect_tool_button->set_toggle_mode(true); rect_tool_button->set_button_group(tool_buttons_group); rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", TTR("Rect"), Key::R)); - rect_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar)); + rect_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(rect_tool_button); viewport_shortcut_buttons.push_back(rect_tool_button); @@ -3580,7 +3580,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() { bucket_tool_button->set_toggle_mode(true); bucket_tool_button->set_button_group(tool_buttons_group); bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", TTR("Bucket"), Key::B)); - bucket_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar)); + bucket_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar)); tilemap_tiles_tools_buttons->add_child(bucket_tool_button); viewport_shortcut_buttons.push_back(bucket_tool_button); @@ -3598,7 +3598,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() { picker_button->set_theme_type_variation("FlatButton"); picker_button->set_toggle_mode(true); picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P)); - picker_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport)); + picker_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport)); tools_settings->add_child(picker_button); viewport_shortcut_buttons.push_back(picker_button); @@ -3607,7 +3607,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() { erase_button->set_theme_type_variation("FlatButton"); erase_button->set_toggle_mode(true); erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", TTR("Eraser"), Key::E)); - erase_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport)); + erase_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport)); tools_settings->add_child(erase_button); viewport_shortcut_buttons.push_back(erase_button); @@ -4457,19 +4457,19 @@ TileMapLayerEditor::TileMapLayerEditor() { select_previous_layer = memnew(Button); select_previous_layer->set_theme_type_variation("FlatButton"); select_previous_layer->set_tooltip_text(TTR("Select previous layer")); - select_previous_layer->connect("pressed", callable_mp(this, &TileMapLayerEditor::_select_previous_layer_pressed)); + select_previous_layer->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_previous_layer_pressed)); layer_selection_hbox->add_child(select_previous_layer); select_next_layer = memnew(Button); select_next_layer->set_theme_type_variation("FlatButton"); select_next_layer->set_tooltip_text(TTR("Select next layer")); - select_next_layer->connect("pressed", callable_mp(this, &TileMapLayerEditor::_select_next_layer_pressed)); + select_next_layer->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_next_layer_pressed)); layer_selection_hbox->add_child(select_next_layer); select_all_layers = memnew(Button); select_all_layers->set_theme_type_variation("FlatButton"); select_all_layers->set_text(TTR("Select all layers")); - select_all_layers->connect("pressed", callable_mp(this, &TileMapLayerEditor::_select_all_layers_pressed)); + select_all_layers->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_all_layers_pressed)); select_all_layers->set_tooltip_text(TTR("Select all TileMapLayers in scene")); layer_selection_hbox->add_child(select_all_layers); diff --git a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp index a75ab45106..9add6ef586 100644 --- a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp +++ b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp @@ -463,7 +463,7 @@ TileProxiesManagerDialog::TileProxiesManagerDialog() { Button *add_button = memnew(Button); add_button->set_text(TTR("Add")); add_button->set_h_size_flags(Control::SIZE_SHRINK_CENTER); - add_button->connect("pressed", callable_mp(this, &TileProxiesManagerDialog::_add_button_pressed)); + add_button->connect(SceneStringName(pressed), callable_mp(this, &TileProxiesManagerDialog::_add_button_pressed)); vbox_container->add_child(add_button); h_separator = memnew(HSeparator); @@ -480,13 +480,13 @@ TileProxiesManagerDialog::TileProxiesManagerDialog() { Button *clear_invalid_button = memnew(Button); clear_invalid_button->set_text(TTR("Clear Invalid")); clear_invalid_button->set_h_size_flags(Control::SIZE_SHRINK_CENTER); - clear_invalid_button->connect("pressed", callable_mp(this, &TileProxiesManagerDialog::_clear_invalid_button_pressed)); + clear_invalid_button->connect(SceneStringName(pressed), callable_mp(this, &TileProxiesManagerDialog::_clear_invalid_button_pressed)); hboxcontainer->add_child(clear_invalid_button); Button *clear_all_button = memnew(Button); clear_all_button->set_text(TTR("Clear All")); clear_all_button->set_h_size_flags(Control::SIZE_SHRINK_CENTER); - clear_all_button->connect("pressed", callable_mp(this, &TileProxiesManagerDialog::_clear_all_button_pressed)); + clear_all_button->connect(SceneStringName(pressed), callable_mp(this, &TileProxiesManagerDialog::_clear_all_button_pressed)); hboxcontainer->add_child(clear_all_button); h_separator = memnew(HSeparator); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 0fffd1e9c9..e4fd32a637 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -1000,8 +1000,8 @@ void TileSetAtlasSourceEditor::_update_atlas_view() { button->add_theme_style_override("normal", memnew(StyleBoxEmpty)); button->add_theme_style_override("hover", memnew(StyleBoxEmpty)); button->add_theme_style_override("focus", memnew(StyleBoxEmpty)); - button->add_theme_style_override("pressed", memnew(StyleBoxEmpty)); - button->connect("pressed", callable_mp(tile_set_atlas_source, &TileSetAtlasSource::create_alternative_tile).bind(tile_id, TileSetSource::INVALID_TILE_ALTERNATIVE)); + button->add_theme_style_override(SceneStringName(pressed), memnew(StyleBoxEmpty)); + button->connect(SceneStringName(pressed), callable_mp(tile_set_atlas_source, &TileSetAtlasSource::create_alternative_tile).bind(tile_id, TileSetSource::INVALID_TILE_ALTERNATIVE)); button->set_rect(Rect2(Vector2(pos.x, pos.y + (y_increment - texture_region_base_size.y) / 2.0), Vector2(texture_region_base_size_min, texture_region_base_size_min))); button->set_expand_icon(true); alternative_tiles_control->add_child(button); @@ -2510,14 +2510,14 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { // -- Toolbox -- tools_button_group.instantiate(); - tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_fix_selected_and_hovered_tiles).unbind(1)); - tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_id_label).unbind(1)); - tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_atlas_source_inspector).unbind(1)); - tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_inspector).unbind(1)); - tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_data_editors).unbind(1)); - tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_current_tile_data_editor).unbind(1)); - tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_atlas_view).unbind(1)); - tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_toolbar).unbind(1)); + tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_fix_selected_and_hovered_tiles).unbind(1)); + tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_id_label).unbind(1)); + tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_atlas_source_inspector).unbind(1)); + tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_inspector).unbind(1)); + tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_data_editors).unbind(1)); + tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_current_tile_data_editor).unbind(1)); + tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_atlas_view).unbind(1)); + tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_toolbar).unbind(1)); HBoxContainer *toolbox = memnew(HBoxContainer); middle_vbox_container->add_child(toolbox); @@ -2586,7 +2586,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tile_data_editor_dropdown_button = memnew(Button); tile_data_editor_dropdown_button->connect(SceneStringName(draw), callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editor_dropdown_button_draw)); - tile_data_editor_dropdown_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editor_dropdown_button_pressed)); + tile_data_editor_dropdown_button->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editor_dropdown_button_pressed)); tile_data_editors_vbox->add_child(tile_data_editor_dropdown_button); tile_data_editor_dropdown_button->add_child(tile_data_editors_popup); diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index 00228cb649..0efed44ac7 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -877,7 +877,7 @@ TileSetEditor::TileSetEditor() { sources_delete_button = memnew(Button); sources_delete_button->set_theme_type_variation("FlatButton"); sources_delete_button->set_disabled(true); - sources_delete_button->connect("pressed", callable_mp(this, &TileSetEditor::_source_delete_pressed)); + sources_delete_button->connect(SceneStringName(pressed), callable_mp(this, &TileSetEditor::_source_delete_pressed)); sources_bottom_actions->add_child(sources_delete_button); sources_add_button = memnew(MenuButton); @@ -1019,7 +1019,7 @@ bool TileSourceInspectorPlugin::parse_property(Object *p_object, const Variant:: Button *button = memnew(Button(TTR("Edit"))); button->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbox->add_child(button); - button->connect("pressed", callable_mp(this, &TileSourceInspectorPlugin::_show_id_edit_dialog).bind(p_object)); + button->connect(SceneStringName(pressed), callable_mp(this, &TileSourceInspectorPlugin::_show_id_edit_dialog).bind(p_object)); ep->add_child(hbox); add_property_editor(p_path, ep); diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp index 4a2301e513..88c117272c 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -573,13 +573,13 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() { scene_tile_add_button = memnew(Button); scene_tile_add_button->set_theme_type_variation("FlatButton"); - scene_tile_add_button->connect("pressed", callable_mp(this, &TileSetScenesCollectionSourceEditor::_source_add_pressed)); + scene_tile_add_button->connect(SceneStringName(pressed), callable_mp(this, &TileSetScenesCollectionSourceEditor::_source_add_pressed)); scenes_bottom_actions->add_child(scene_tile_add_button); scene_tile_delete_button = memnew(Button); scene_tile_delete_button->set_theme_type_variation("FlatButton"); scene_tile_delete_button->set_disabled(true); - scene_tile_delete_button->connect("pressed", callable_mp(this, &TileSetScenesCollectionSourceEditor::_source_delete_pressed)); + scene_tile_delete_button->connect(SceneStringName(pressed), callable_mp(this, &TileSetScenesCollectionSourceEditor::_source_delete_pressed)); scenes_bottom_actions->add_child(scene_tile_delete_button); } diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index b48b649488..beed89ea10 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -941,7 +941,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { metadata_dialog = memnew(ConfirmationDialog); metadata_dialog->set_title(TTR("Create Version Control Metadata")); metadata_dialog->set_min_size(Size2(200, 40)); - metadata_dialog->get_ok_button()->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_create_vcs_metadata_files)); + metadata_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_create_vcs_metadata_files)); EditorInterface::get_singleton()->get_base_control()->add_child(metadata_dialog); VBoxContainer *metadata_vb = memnew(VBoxContainer); @@ -975,7 +975,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { Button *set_up_apply_button = set_up_dialog->get_ok_button(); set_up_apply_button->set_text(TTR("Apply")); - set_up_apply_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_set_credentials)); + set_up_apply_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_set_credentials)); set_up_vbc = memnew(VBoxContainer); set_up_vbc->set_alignment(BoxContainer::ALIGNMENT_CENTER); @@ -1082,7 +1082,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { Button *select_public_path_button = memnew(Button); select_public_path_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_editor_theme_icon("Folder")); - select_public_path_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_file_dialog).bind(set_up_ssh_public_key_file_dialog)); + select_public_path_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_popup_file_dialog).bind(set_up_ssh_public_key_file_dialog)); select_public_path_button->set_tooltip_text(TTR("Select SSH public key path")); set_up_ssh_public_key_input_hbc->add_child(select_public_path_button); @@ -1115,7 +1115,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { Button *select_private_path_button = memnew(Button); select_private_path_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_editor_theme_icon("Folder")); - select_private_path_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_file_dialog).bind(set_up_ssh_private_key_file_dialog)); + select_private_path_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_popup_file_dialog).bind(set_up_ssh_private_key_file_dialog)); select_private_path_button->set_tooltip_text(TTR("Select SSH private key path")); set_up_ssh_private_key_input_hbc->add_child(select_private_path_button); @@ -1160,10 +1160,10 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { refresh_button->set_tooltip_text(TTR("Detect new changes")); refresh_button->set_theme_type_variation("FlatButton"); refresh_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Reload"), EditorStringName(EditorIcons))); - refresh_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_stage_area)); - refresh_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_commit_list)); - refresh_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list)); - refresh_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list)); + refresh_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_stage_area)); + refresh_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_commit_list)); + refresh_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list)); + refresh_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list)); unstage_title->add_child(refresh_button); discard_all_confirm = memnew(AcceptDialog); @@ -1175,12 +1175,12 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { discard_all_confirm->add_cancel_button(); version_commit_dock->add_child(discard_all_confirm); - discard_all_confirm->get_ok_button()->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_discard_all)); + discard_all_confirm->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_discard_all)); discard_all_button = memnew(Button); discard_all_button->set_tooltip_text(TTR("Discard all changes")); discard_all_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Close"), EditorStringName(EditorIcons))); - discard_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_confirm_discard_all)); + discard_all_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_confirm_discard_all)); discard_all_button->set_theme_type_variation("FlatButton"); unstage_title->add_child(discard_all_button); @@ -1232,8 +1232,8 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { stage_area->add_child(staged_files); // Editor crashes if bind is null - unstage_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(staged_files)); - stage_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(unstaged_files)); + unstage_all_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(staged_files)); + stage_all_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(unstaged_files)); version_commit_dock->add_child(memnew(HSeparator)); @@ -1260,7 +1260,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { commit_button = memnew(Button); commit_button->set_text(TTR("Commit Changes")); commit_button->set_disabled(true); - commit_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_commit)); + commit_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_commit)); commit_area->add_child(commit_button); version_commit_dock->add_child(memnew(HSeparator)); @@ -1308,7 +1308,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { branch_select->set_tooltip_text(TTR("Branches")); branch_select->set_h_size_flags(Control::SIZE_EXPAND_FILL); branch_select->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_branch_item_selected)); - branch_select->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list)); + branch_select->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list)); menu_bar->add_child(branch_select); branch_create_confirm = memnew(AcceptDialog); @@ -1320,7 +1320,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { branch_create_ok = branch_create_confirm->get_ok_button(); branch_create_ok->set_text(TTR("Create")); branch_create_ok->set_disabled(true); - branch_create_ok->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_create_branch)); + branch_create_ok->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_create_branch)); branch_remove_confirm = memnew(AcceptDialog); branch_remove_confirm->set_title(TTR("Remove Branch")); @@ -1329,7 +1329,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { Button *branch_remove_ok = branch_remove_confirm->get_ok_button(); branch_remove_ok->set_text(TTR("Remove")); - branch_remove_ok->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_remove_branch)); + branch_remove_ok->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_remove_branch)); VBoxContainer *branch_create_vbc = memnew(VBoxContainer); branch_create_vbc->set_alignment(BoxContainer::ALIGNMENT_CENTER); @@ -1353,7 +1353,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { remote_select->set_tooltip_text(TTR("Remotes")); remote_select->set_h_size_flags(Control::SIZE_EXPAND_FILL); remote_select->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_remote_selected)); - remote_select->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list)); + remote_select->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list)); menu_bar->add_child(remote_select); remote_create_confirm = memnew(AcceptDialog); @@ -1365,7 +1365,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { remote_create_ok = remote_create_confirm->get_ok_button(); remote_create_ok->set_text(TTR("Create")); remote_create_ok->set_disabled(true); - remote_create_ok->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_create_remote)); + remote_create_ok->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_create_remote)); remote_remove_confirm = memnew(AcceptDialog); remote_remove_confirm->set_title(TTR("Remove Remote")); @@ -1374,7 +1374,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { Button *remote_remove_ok = remote_remove_confirm->get_ok_button(); remote_remove_ok->set_text(TTR("Remove")); - remote_remove_ok->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_remove_remote)); + remote_remove_ok->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_remove_remote)); VBoxContainer *remote_create_vbc = memnew(VBoxContainer); remote_create_vbc->set_alignment(BoxContainer::ALIGNMENT_CENTER); @@ -1412,21 +1412,21 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { fetch_button->set_theme_type_variation("FlatButton"); fetch_button->set_tooltip_text(TTR("Fetch")); fetch_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Reload"), EditorStringName(EditorIcons))); - fetch_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_fetch)); + fetch_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_fetch)); menu_bar->add_child(fetch_button); pull_button = memnew(Button); pull_button->set_theme_type_variation("FlatButton"); pull_button->set_tooltip_text(TTR("Pull")); pull_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("MoveDown"), EditorStringName(EditorIcons))); - pull_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_pull)); + pull_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_pull)); menu_bar->add_child(pull_button); push_button = memnew(Button); push_button->set_theme_type_variation("FlatButton"); push_button->set_tooltip_text(TTR("Push")); push_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("MoveUp"), EditorStringName(EditorIcons))); - push_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_push)); + push_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_push)); menu_bar->add_child(push_button); extra_options = memnew(MenuButton); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 41f05d7c13..01551a52c2 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -978,14 +978,14 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool Button *add_input_btn = memnew(Button); add_input_btn->set_text(TTR("Add Input")); - add_input_btn->connect("pressed", callable_mp(editor, &VisualShaderEditor::_add_input_port).bind(p_id, group_node->get_free_input_port_id(), VisualShaderNode::PORT_TYPE_VECTOR_3D, input_port_name), CONNECT_DEFERRED); + add_input_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_add_input_port).bind(p_id, group_node->get_free_input_port_id(), VisualShaderNode::PORT_TYPE_VECTOR_3D, input_port_name), CONNECT_DEFERRED); hb2->add_child(add_input_btn); hb2->add_spacer(); Button *add_output_btn = memnew(Button); add_output_btn->set_text(TTR("Add Output")); - add_output_btn->connect("pressed", callable_mp(editor, &VisualShaderEditor::_add_output_port).bind(p_id, group_node->get_free_output_port_id(), VisualShaderNode::PORT_TYPE_VECTOR_3D, output_port_name), CONNECT_DEFERRED); + add_output_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_add_output_port).bind(p_id, group_node->get_free_output_port_id(), VisualShaderNode::PORT_TYPE_VECTOR_3D, output_port_name), CONNECT_DEFERRED); hb2->add_child(add_output_btn); node->add_child(hb2); @@ -1094,7 +1094,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool Button *button = memnew(Button); hb->add_child(button); register_default_input_button(p_id, j, button); - button->connect("pressed", callable_mp(editor, &VisualShaderEditor::_edit_port_default_input).bind(button, p_id, j)); + button->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_edit_port_default_input).bind(button, p_id, j)); if (default_value.get_type() != Variant::NIL) { // only a label set_input_port_default_value(p_type, p_id, j, default_value); } else { @@ -1133,7 +1133,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool Button *remove_btn = memnew(Button); remove_btn->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Remove"), EditorStringName(EditorIcons))); remove_btn->set_tooltip_text(TTR("Remove") + " " + name_left); - remove_btn->connect("pressed", callable_mp(editor, &VisualShaderEditor::_remove_input_port).bind(p_id, j), CONNECT_DEFERRED); + remove_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_remove_input_port).bind(p_id, j), CONNECT_DEFERRED); hb->add_child(remove_btn); } else { Label *label = memnew(Label); @@ -1161,7 +1161,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool Button *remove_btn = memnew(Button); remove_btn->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Remove"), EditorStringName(EditorIcons))); remove_btn->set_tooltip_text(TTR("Remove") + " " + name_left); - remove_btn->connect("pressed", callable_mp(editor, &VisualShaderEditor::_remove_output_port).bind(p_id, i), CONNECT_DEFERRED); + remove_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_remove_output_port).bind(p_id, i), CONNECT_DEFERRED); hb->add_child(remove_btn); LineEdit *name_box = memnew(LineEdit); @@ -1203,7 +1203,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool expand->set_texture_pressed(editor->get_editor_theme_icon(SNAME("GuiTreeArrowDown"))); expand->set_v_size_flags(Control::SIZE_SHRINK_CENTER); expand->set_pressed(vsnode->_is_output_port_expanded(i)); - expand->connect("pressed", callable_mp(editor, &VisualShaderEditor::_expand_output_port).bind(p_id, i, !vsnode->_is_output_port_expanded(i)), CONNECT_DEFERRED); + expand->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_expand_output_port).bind(p_id, i, !vsnode->_is_output_port_expanded(i)), CONNECT_DEFERRED); hb->add_child(expand); } if (vsnode->has_output_port_preview(i) && port_right != VisualShaderNode::PORT_TYPE_TRANSFORM && port_right != VisualShaderNode::PORT_TYPE_SAMPLER) { @@ -1215,7 +1215,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool register_output_port(p_id, j, preview); - preview->connect("pressed", callable_mp(editor, &VisualShaderEditor::_preview_select_port).bind(p_id, j), CONNECT_DEFERRED); + preview->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_preview_select_port).bind(p_id, j), CONNECT_DEFERRED); hb->add_child(preview); } } @@ -6183,7 +6183,7 @@ VisualShaderEditor::VisualShaderEditor() { add_node->set_text(TTR("Add Node...")); graph->get_menu_hbox()->add_child(add_node); graph->get_menu_hbox()->move_child(add_node, 0); - add_node->connect("pressed", callable_mp(this, &VisualShaderEditor::_show_members_dialog).bind(false, VisualShaderNode::PORT_TYPE_MAX, VisualShaderNode::PORT_TYPE_MAX)); + add_node->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_show_members_dialog).bind(false, VisualShaderNode::PORT_TYPE_MAX, VisualShaderNode::PORT_TYPE_MAX)); graph->connect("graph_elements_linked_to_frame_request", callable_mp(this, &VisualShaderEditor::_nodes_linked_to_frame_request)); graph->connect("frame_rect_changed", callable_mp(this, &VisualShaderEditor::_frame_rect_changed)); @@ -6203,7 +6203,7 @@ VisualShaderEditor::VisualShaderEditor() { preview_shader->set_toggle_mode(true); preview_shader->set_tooltip_text(TTR("Show generated shader code.")); graph->get_menu_hbox()->add_child(preview_shader); - preview_shader->connect("pressed", callable_mp(this, &VisualShaderEditor::_show_preview_text)); + preview_shader->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_show_preview_text)); /////////////////////////////////////// // PREVIEW WINDOW @@ -6326,7 +6326,7 @@ VisualShaderEditor::VisualShaderEditor() { members_dialog->set_exclusive(true); members_dialog->add_child(members_vb); members_dialog->set_ok_button_text(TTR("Create")); - members_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_member_create)); + members_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_member_create)); members_dialog->get_ok_button()->set_disabled(true); members_dialog->connect("canceled", callable_mp(this, &VisualShaderEditor::_member_cancel)); add_child(members_dialog); @@ -6337,7 +6337,7 @@ VisualShaderEditor::VisualShaderEditor() { add_varying_dialog->set_title(TTR("Create Shader Varying")); add_varying_dialog->set_exclusive(true); add_varying_dialog->set_ok_button_text(TTR("Create")); - add_varying_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_varying_create)); + add_varying_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_varying_create)); add_varying_dialog->get_ok_button()->set_disabled(true); add_child(add_varying_dialog); @@ -6383,7 +6383,7 @@ VisualShaderEditor::VisualShaderEditor() { remove_varying_dialog->set_title(TTR("Delete Shader Varying")); remove_varying_dialog->set_exclusive(true); remove_varying_dialog->set_ok_button_text(TTR("Delete")); - remove_varying_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_varying_deleted)); + remove_varying_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_varying_deleted)); add_child(remove_varying_dialog); VBoxContainer *vb = memnew(VBoxContainer); @@ -6433,7 +6433,7 @@ VisualShaderEditor::VisualShaderEditor() { Button *frame_tint_color_confirm_button = memnew(Button); frame_tint_color_confirm_button->set_text(TTR("OK")); frame_popup_item_tint_color_editor->add_child(frame_tint_color_confirm_button); - frame_tint_color_confirm_button->connect("pressed", callable_mp(this, &VisualShaderEditor::_frame_color_confirm)); + frame_tint_color_confirm_button->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_frame_color_confirm)); frame_tint_color_pick_popup->connect("popup_hide", callable_mp(this, &VisualShaderEditor::_frame_color_popup_hide)); add_child(frame_tint_color_pick_popup); diff --git a/editor/plugins/voxel_gi_editor_plugin.cpp b/editor/plugins/voxel_gi_editor_plugin.cpp index 5129fae176..e7b2435567 100644 --- a/editor/plugins/voxel_gi_editor_plugin.cpp +++ b/editor/plugins/voxel_gi_editor_plugin.cpp @@ -190,7 +190,7 @@ VoxelGIEditorPlugin::VoxelGIEditorPlugin() { // when the editor theme updates. bake->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Bake"), EditorStringName(EditorIcons))); bake->set_text(TTR("Bake VoxelGI")); - bake->connect("pressed", callable_mp(this, &VoxelGIEditorPlugin::_bake)); + bake->connect(SceneStringName(pressed), callable_mp(this, &VoxelGIEditorPlugin::_bake)); bake_hb->add_child(bake); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake_hb); diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index ff8343fbeb..746b244bed 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -250,5 +250,5 @@ ProgressDialog::ProgressDialog() { cancel_hb->add_child(cancel); cancel->set_text(TTR("Cancel")); cancel_hb->add_spacer(); - cancel->connect("pressed", callable_mp(this, &ProgressDialog::_cancel_pressed)); + cancel->connect(SceneStringName(pressed), callable_mp(this, &ProgressDialog::_cancel_pressed)); } diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 3a5fc8474e..00aa78f342 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -289,7 +289,7 @@ Button *ProjectManager::_add_main_view(MainViewTab p_id, const String &p_name, c toggle_button->set_toggle_mode(true); toggle_button->set_button_group(main_view_toggles_group); toggle_button->set_text(p_name); - toggle_button->connect("pressed", callable_mp(this, &ProjectManager::_select_main_view).bind((int)p_id)); + toggle_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_select_main_view).bind((int)p_id)); main_view_toggles->add_child(toggle_button); main_view_toggle_map[p_id] = toggle_button; @@ -1153,7 +1153,7 @@ ProjectManager::ProjectManager() { title_bar_logo = memnew(Button); title_bar_logo->set_flat(true); left_hbox->add_child(title_bar_logo); - title_bar_logo->connect("pressed", callable_mp(this, &ProjectManager::_show_about)); + title_bar_logo->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_show_about)); if (can_expand) { // Spacer to center main toggles. @@ -1187,7 +1187,7 @@ ProjectManager::ProjectManager() { quick_settings_button->set_flat(true); quick_settings_button->set_text(TTR("Settings")); right_hbox->add_child(quick_settings_button); - quick_settings_button->connect("pressed", callable_mp(this, &ProjectManager::_show_quick_settings)); + quick_settings_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_show_quick_settings)); if (can_expand) { // Add spacer to avoid other controls under the window minimize/maximize/close buttons (right side). @@ -1216,19 +1216,19 @@ ProjectManager::ProjectManager() { create_btn = memnew(Button); create_btn->set_text(TTR("Create")); create_btn->set_shortcut(ED_SHORTCUT("project_manager/new_project", TTR("New Project"), KeyModifierMask::CMD_OR_CTRL | Key::N)); - create_btn->connect("pressed", callable_mp(this, &ProjectManager::_new_project)); + create_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_new_project)); hb->add_child(create_btn); import_btn = memnew(Button); import_btn->set_text(TTR("Import")); import_btn->set_shortcut(ED_SHORTCUT("project_manager/import_project", TTR("Import Project"), KeyModifierMask::CMD_OR_CTRL | Key::I)); - import_btn->connect("pressed", callable_mp(this, &ProjectManager::_import_project)); + import_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_import_project)); hb->add_child(import_btn); scan_btn = memnew(Button); scan_btn->set_text(TTR("Scan")); scan_btn->set_shortcut(ED_SHORTCUT("project_manager/scan_projects", TTR("Scan Projects"), KeyModifierMask::CMD_OR_CTRL | Key::S)); - scan_btn->connect("pressed", callable_mp(this, &ProjectManager::_scan_projects)); + scan_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_scan_projects)); hb->add_child(scan_btn); loading_label = memnew(Label(TTR("Loading, please wait..."))); @@ -1312,19 +1312,19 @@ ProjectManager::ProjectManager() { empty_list_create_project->set_text(TTR("Create New Project")); empty_list_create_project->set_theme_type_variation("PanelBackgroundButton"); empty_list_actions->add_child(empty_list_create_project); - empty_list_create_project->connect("pressed", callable_mp(this, &ProjectManager::_new_project)); + empty_list_create_project->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_new_project)); empty_list_import_project = memnew(Button); empty_list_import_project->set_text(TTR("Import Existing Project")); empty_list_import_project->set_theme_type_variation("PanelBackgroundButton"); empty_list_actions->add_child(empty_list_import_project); - empty_list_import_project->connect("pressed", callable_mp(this, &ProjectManager::_import_project)); + empty_list_import_project->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_import_project)); empty_list_open_assetlib = memnew(Button); empty_list_open_assetlib->set_text(TTR("Open Asset Library")); empty_list_open_assetlib->set_theme_type_variation("PanelBackgroundButton"); empty_list_actions->add_child(empty_list_open_assetlib); - empty_list_open_assetlib->connect("pressed", callable_mp(this, &ProjectManager::_open_asset_library_confirmed)); + empty_list_open_assetlib->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_open_asset_library_confirmed)); empty_list_online_warning = memnew(Label); empty_list_online_warning->set_horizontal_alignment(HorizontalAlignment::HORIZONTAL_ALIGNMENT_CENTER); @@ -1345,20 +1345,20 @@ ProjectManager::ProjectManager() { open_btn = memnew(Button); open_btn->set_text(TTR("Edit")); open_btn->set_shortcut(ED_SHORTCUT("project_manager/edit_project", TTR("Edit Project"), KeyModifierMask::CMD_OR_CTRL | Key::E)); - open_btn->connect("pressed", callable_mp(this, &ProjectManager::_open_selected_projects_ask)); + open_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_open_selected_projects_ask)); project_list_sidebar->add_child(open_btn); run_btn = memnew(Button); run_btn->set_text(TTR("Run")); run_btn->set_shortcut(ED_SHORTCUT("project_manager/run_project", TTR("Run Project"), KeyModifierMask::CMD_OR_CTRL | Key::R)); - run_btn->connect("pressed", callable_mp(this, &ProjectManager::_run_project)); + run_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_run_project)); project_list_sidebar->add_child(run_btn); rename_btn = memnew(Button); rename_btn->set_text(TTR("Rename")); // The F2 shortcut isn't overridden with Enter on macOS as Enter is already used to edit a project. rename_btn->set_shortcut(ED_SHORTCUT("project_manager/rename_project", TTR("Rename Project"), Key::F2)); - rename_btn->connect("pressed", callable_mp(this, &ProjectManager::_rename_project)); + rename_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_rename_project)); project_list_sidebar->add_child(rename_btn); manage_tags_btn = memnew(Button); @@ -1368,7 +1368,7 @@ ProjectManager::ProjectManager() { erase_btn = memnew(Button); erase_btn->set_text(TTR("Remove")); erase_btn->set_shortcut(ED_SHORTCUT("project_manager/remove_project", TTR("Remove Project"), Key::KEY_DELETE)); - erase_btn->connect("pressed", callable_mp(this, &ProjectManager::_erase_project)); + erase_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_erase_project)); project_list_sidebar->add_child(erase_btn); Control *filler = memnew(Control); @@ -1377,7 +1377,7 @@ ProjectManager::ProjectManager() { erase_missing_btn = memnew(Button); erase_missing_btn->set_text(TTR("Remove Missing")); - erase_missing_btn->connect("pressed", callable_mp(this, &ProjectManager::_erase_missing_projects)); + erase_missing_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_erase_missing_projects)); project_list_sidebar->add_child(erase_missing_btn); } } @@ -1425,7 +1425,7 @@ ProjectManager::ProjectManager() { build_date = TTR("(unknown)"); } version_btn->set_tooltip_text(vformat(TTR("Git commit date: %s\nClick to copy the version information."), build_date)); - version_btn->connect("pressed", callable_mp(this, &ProjectManager::_version_button_pressed)); + version_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_version_button_pressed)); footer_bar->add_child(version_btn); } @@ -1446,12 +1446,12 @@ ProjectManager::ProjectManager() { erase_missing_ask = memnew(ConfirmationDialog); erase_missing_ask->set_ok_button_text(TTR("Remove All")); - erase_missing_ask->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_erase_missing_projects_confirm)); + erase_missing_ask->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_erase_missing_projects_confirm)); add_child(erase_missing_ask); erase_ask = memnew(ConfirmationDialog); erase_ask->set_ok_button_text(TTR("Remove")); - erase_ask->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_erase_project_confirm)); + erase_ask->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_erase_project_confirm)); add_child(erase_ask); VBoxContainer *erase_ask_vb = memnew(VBoxContainer); @@ -1468,19 +1468,19 @@ ProjectManager::ProjectManager() { multi_open_ask = memnew(ConfirmationDialog); multi_open_ask->set_ok_button_text(TTR("Edit")); - multi_open_ask->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_open_selected_projects)); + multi_open_ask->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_open_selected_projects)); add_child(multi_open_ask); multi_run_ask = memnew(ConfirmationDialog); multi_run_ask->set_ok_button_text(TTR("Run")); - multi_run_ask->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_run_project_confirm)); + multi_run_ask->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_run_project_confirm)); add_child(multi_run_ask); ask_update_settings = memnew(ConfirmationDialog); ask_update_settings->set_autowrap(true); - ask_update_settings->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_open_selected_projects)); + ask_update_settings->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_open_selected_projects)); full_convert_button = ask_update_settings->add_button(TTR("Convert Full Project"), !GLOBAL_GET("gui/common/swap_cancel_ok")); - full_convert_button->connect("pressed", callable_mp(this, &ProjectManager::_full_convert_button_pressed)); + full_convert_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_full_convert_button_pressed)); add_child(ask_update_settings); ask_full_convert_dialog = memnew(ConfirmationDialog); @@ -1507,8 +1507,8 @@ ProjectManager::ProjectManager() { tag_manage_dialog = memnew(ConfirmationDialog); add_child(tag_manage_dialog); tag_manage_dialog->set_title(TTR("Manage Project Tags")); - tag_manage_dialog->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_apply_project_tags)); - manage_tags_btn->connect("pressed", callable_mp(this, &ProjectManager::_manage_project_tags)); + tag_manage_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_apply_project_tags)); + manage_tags_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_manage_project_tags)); VBoxContainer *tag_vb = memnew(VBoxContainer); tag_manage_dialog->add_child(tag_vb); @@ -1548,7 +1548,7 @@ ProjectManager::ProjectManager() { create_tag_dialog = memnew(ConfirmationDialog); tag_manage_dialog->add_child(create_tag_dialog); create_tag_dialog->set_title(TTR("Create New Tag")); - create_tag_dialog->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_create_new_tag)); + create_tag_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_create_new_tag)); tag_vb = memnew(VBoxContainer); create_tag_dialog->add_child(tag_vb); @@ -1568,7 +1568,7 @@ ProjectManager::ProjectManager() { create_tag_btn = memnew(Button); all_tags->add_child(create_tag_btn); - create_tag_btn->connect("pressed", callable_mp((Window *)create_tag_dialog, &Window::popup_centered).bind(Vector2i(500, 0) * EDSCALE)); + create_tag_btn->connect(SceneStringName(pressed), callable_mp((Window *)create_tag_dialog, &Window::popup_centered).bind(Vector2i(500, 0) * EDSCALE)); } // Initialize project list. diff --git a/editor/project_manager/project_dialog.cpp b/editor/project_manager/project_dialog.cpp index 81fdf9c369..99aa83a09c 100644 --- a/editor/project_manager/project_dialog.cpp +++ b/editor/project_manager/project_dialog.cpp @@ -462,7 +462,7 @@ void ProjectDialog::ok_pressed() { ConfirmationDialog *cd = memnew(ConfirmationDialog); cd->set_title(TTR("Warning: This folder is not empty")); cd->set_text(TTR("You are about to create a Godot project in a non-empty folder.\nThe entire contents of this folder will be imported as project resources!\n\nAre you sure you wish to continue?")); - cd->get_ok_button()->connect("pressed", callable_mp(this, &ProjectDialog::_nonempty_confirmation_ok_pressed)); + cd->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_nonempty_confirmation_ok_pressed)); get_parent()->add_child(cd); cd->popup_centered(); return; @@ -855,7 +855,7 @@ ProjectDialog::ProjectDialog() { project_browse = memnew(Button); project_browse->set_text(TTR("Browse")); - project_browse->connect("pressed", callable_mp(this, &ProjectDialog::_browse_project_path)); + project_browse->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_browse_project_path)); pphb->add_child(project_browse); // install status icon @@ -865,7 +865,7 @@ ProjectDialog::ProjectDialog() { install_browse = memnew(Button); install_browse->set_text(TTR("Browse")); - install_browse->connect("pressed", callable_mp(this, &ProjectDialog::_browse_install_path)); + install_browse->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_browse_install_path)); iphb->add_child(install_browse); msg = memnew(Label); @@ -900,7 +900,7 @@ ProjectDialog::ProjectDialog() { rs_button->set_disabled(true); #endif rs_button->set_meta(SNAME("rendering_method"), "forward_plus"); - rs_button->connect("pressed", callable_mp(this, &ProjectDialog::_renderer_selected)); + rs_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_renderer_selected)); rvb->add_child(rs_button); if (default_renderer_type == "forward_plus") { rs_button->set_pressed(true); @@ -912,7 +912,7 @@ ProjectDialog::ProjectDialog() { rs_button->set_disabled(true); #endif rs_button->set_meta(SNAME("rendering_method"), "mobile"); - rs_button->connect("pressed", callable_mp(this, &ProjectDialog::_renderer_selected)); + rs_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_renderer_selected)); rvb->add_child(rs_button); if (default_renderer_type == "mobile") { rs_button->set_pressed(true); @@ -924,7 +924,7 @@ ProjectDialog::ProjectDialog() { rs_button->set_disabled(true); #endif rs_button->set_meta(SNAME("rendering_method"), "gl_compatibility"); - rs_button->connect("pressed", callable_mp(this, &ProjectDialog::_renderer_selected)); + rs_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_renderer_selected)); rvb->add_child(rs_button); #if defined(GLES3_ENABLED) if (default_renderer_type == "gl_compatibility") { diff --git a/editor/project_manager/project_list.cpp b/editor/project_manager/project_list.cpp index 00f94a7e76..32f088ec60 100644 --- a/editor/project_manager/project_list.cpp +++ b/editor/project_manager/project_list.cpp @@ -216,7 +216,7 @@ ProjectListItemControl::ProjectListItemControl() { // This makes the project's "hover" style display correctly when hovering the favorite icon. favorite_button->set_mouse_filter(MOUSE_FILTER_PASS); favorite_box->add_child(favorite_button); - favorite_button->connect("pressed", callable_mp(this, &ProjectListItemControl::_favorite_button_pressed)); + favorite_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectListItemControl::_favorite_button_pressed)); project_icon = memnew(TextureRect); project_icon->set_name("ProjectIcon"); @@ -262,7 +262,7 @@ ProjectListItemControl::ProjectListItemControl() { explore_button->set_name("ExploreButton"); explore_button->set_flat(true); path_hb->add_child(explore_button); - explore_button->connect("pressed", callable_mp(this, &ProjectListItemControl::_explore_button_pressed)); + explore_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectListItemControl::_explore_button_pressed)); project_path = memnew(Label); project_path->set_name("ProjectPath"); diff --git a/editor/project_manager/project_tag.cpp b/editor/project_manager/project_tag.cpp index 8fb05b549e..618b6555d4 100644 --- a/editor/project_manager/project_tag.cpp +++ b/editor/project_manager/project_tag.cpp @@ -41,7 +41,7 @@ void ProjectTag::_notification(int p_what) { } void ProjectTag::connect_button_to(const Callable &p_callable) { - button->connect(SNAME("pressed"), p_callable, CONNECT_DEFERRED); + button->connect(SceneStringName(pressed), p_callable, CONNECT_DEFERRED); } const String ProjectTag::get_tag() const { diff --git a/editor/project_manager/quick_settings_dialog.cpp b/editor/project_manager/quick_settings_dialog.cpp index 255b15f7f6..63fe423b1f 100644 --- a/editor/project_manager/quick_settings_dialog.cpp +++ b/editor/project_manager/quick_settings_dialog.cpp @@ -165,7 +165,7 @@ void QuickSettingsDialog::_set_setting_value(const String &p_setting, const Vari if (!restart_required_button) { restart_required_button = add_button(TTR("Restart Now"), !GLOBAL_GET("gui/common/swap_cancel_ok")); - restart_required_button->connect("pressed", callable_mp(this, &QuickSettingsDialog::_request_restart)); + restart_required_button->connect(SceneStringName(pressed), callable_mp(this, &QuickSettingsDialog::_request_restart)); } } } diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index c4aeac434b..cff95cadc8 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -683,13 +683,13 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { add_button = memnew(Button); add_button->set_text(TTR("Add")); add_button->set_disabled(true); - add_button->connect("pressed", callable_mp(this, &ProjectSettingsEditor::_add_setting)); + add_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectSettingsEditor::_add_setting)); custom_properties->add_child(add_button); del_button = memnew(Button); del_button->set_text(TTR("Delete")); del_button->set_disabled(true); - del_button->connect("pressed", callable_mp(this, &ProjectSettingsEditor::_delete_setting)); + del_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectSettingsEditor::_delete_setting)); custom_properties->add_child(del_button); general_settings_inspector = memnew(SectionedInspector); @@ -718,13 +718,13 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { restart_hb->add_spacer(); Button *restart_button = memnew(Button); - restart_button->connect("pressed", callable_mp(this, &ProjectSettingsEditor::_editor_restart)); + restart_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectSettingsEditor::_editor_restart)); restart_hb->add_child(restart_button); restart_button->set_text(TTR("Save & Restart")); restart_close_button = memnew(Button); restart_close_button->set_flat(true); - restart_close_button->connect("pressed", callable_mp(this, &ProjectSettingsEditor::_editor_restart_close)); + restart_close_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectSettingsEditor::_editor_restart_close)); restart_hb->add_child(restart_close_button); action_map_editor = memnew(ActionMapEditor); diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index c08d8a9765..51f9d319a6 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -145,7 +145,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) { but_insert_name->set_text("NAME"); but_insert_name->set_tooltip_text(String("${NAME}\n") + TTR("Node name.")); but_insert_name->set_focus_mode(Control::FOCUS_NONE); - but_insert_name->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${NAME}")); + but_insert_name->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${NAME}")); but_insert_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_name); @@ -155,7 +155,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) { but_insert_parent->set_text("PARENT"); but_insert_parent->set_tooltip_text(String("${PARENT}\n") + TTR("Node's parent name, if available.")); but_insert_parent->set_focus_mode(Control::FOCUS_NONE); - but_insert_parent->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${PARENT}")); + but_insert_parent->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${PARENT}")); but_insert_parent->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_parent); @@ -165,7 +165,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) { but_insert_type->set_text("TYPE"); but_insert_type->set_tooltip_text(String("${TYPE}\n") + TTR("Node type.")); but_insert_type->set_focus_mode(Control::FOCUS_NONE); - but_insert_type->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${TYPE}")); + but_insert_type->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${TYPE}")); but_insert_type->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_type); @@ -175,7 +175,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) { but_insert_scene->set_text("SCENE"); but_insert_scene->set_tooltip_text(String("${SCENE}\n") + TTR("Current scene name.")); but_insert_scene->set_focus_mode(Control::FOCUS_NONE); - but_insert_scene->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${SCENE}")); + but_insert_scene->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${SCENE}")); but_insert_scene->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_scene); @@ -185,7 +185,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) { but_insert_root->set_text("ROOT"); but_insert_root->set_tooltip_text(String("${ROOT}\n") + TTR("Root node name.")); but_insert_root->set_focus_mode(Control::FOCUS_NONE); - but_insert_root->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${ROOT}")); + but_insert_root->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${ROOT}")); but_insert_root->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_root); @@ -195,7 +195,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) { but_insert_count->set_text("COUNTER"); but_insert_count->set_tooltip_text(String("${COUNTER}\n") + TTR("Sequential integer counter.\nCompare counter options.")); but_insert_count->set_focus_mode(Control::FOCUS_NONE); - but_insert_count->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${COUNTER}")); + but_insert_count->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${COUNTER}")); but_insert_count->set_h_size_flags(Control::SIZE_EXPAND_FILL); grd_substitute->add_child(but_insert_count); @@ -327,11 +327,11 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) { spn_count_padding->connect("value_changed", callable_mp(this, &RenameDialog::_update_preview_int)); opt_style->connect("item_selected", callable_mp(this, &RenameDialog::_update_preview_int)); opt_case->connect("item_selected", callable_mp(this, &RenameDialog::_update_preview_int)); - cbut_substitute->connect("pressed", callable_mp(this, &RenameDialog::_update_preview).bind("")); - cbut_regex->connect("pressed", callable_mp(this, &RenameDialog::_update_preview).bind("")); - cbut_process->connect("pressed", callable_mp(this, &RenameDialog::_update_preview).bind("")); + cbut_substitute->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_update_preview).bind("")); + cbut_regex->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_update_preview).bind("")); + cbut_process->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_update_preview).bind("")); - but_reset->connect("pressed", callable_mp(this, &RenameDialog::reset)); + but_reset->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::reset)); reset(); _features_toggled(false); diff --git a/editor/run_instances_dialog.cpp b/editor/run_instances_dialog.cpp index d8733288b2..e15d578cb5 100644 --- a/editor/run_instances_dialog.cpp +++ b/editor/run_instances_dialog.cpp @@ -281,7 +281,7 @@ RunInstancesDialog::RunInstancesDialog() { enable_multiple_instances_checkbox->set_text(TTR("Enable Multiple Instances")); enable_multiple_instances_checkbox->set_pressed(EditorSettings::get_singleton()->get_project_metadata("debug_options", "multiple_instances_enabled", false)); args_gc->add_child(enable_multiple_instances_checkbox); - enable_multiple_instances_checkbox->connect("pressed", callable_mp(this, &RunInstancesDialog::_start_main_timer)); + enable_multiple_instances_checkbox->connect(SceneStringName(pressed), callable_mp(this, &RunInstancesDialog::_start_main_timer)); { Label *l = memnew(Label); diff --git a/editor/scene_create_dialog.cpp b/editor/scene_create_dialog.cpp index 4c22b37d9d..fe773378b0 100644 --- a/editor/scene_create_dialog.cpp +++ b/editor/scene_create_dialog.cpp @@ -241,7 +241,7 @@ SceneCreateDialog::SceneCreateDialog() { select_node_button = memnew(Button); hb->add_child(select_node_button); - select_node_button->connect("pressed", callable_mp(this, &SceneCreateDialog::browse_types)); + select_node_button->connect(SceneStringName(pressed), callable_mp(this, &SceneCreateDialog::browse_types)); } { @@ -291,7 +291,7 @@ SceneCreateDialog::SceneCreateDialog() { validation_panel->set_update_callback(callable_mp(this, &SceneCreateDialog::update_dialog)); validation_panel->set_accept_button(get_ok_button()); - node_type_group->connect("pressed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); + node_type_group->connect(SceneStringName(pressed), callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); scene_name_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); root_name_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 628451ca0c..c2d6acd140 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1470,7 +1470,7 @@ void SceneTreeDock::_notification(int p_what) { node_shortcuts_toggle->set_tooltip_text(TTR("Toggle the display of favorite nodes.")); node_shortcuts_toggle->set_pressed(EDITOR_GET("_use_favorites_root_selection")); node_shortcuts_toggle->set_anchors_and_offsets_preset(Control::PRESET_CENTER_RIGHT); - node_shortcuts_toggle->connect("pressed", callable_mp(this, &SceneTreeDock::_update_create_root_dialog)); + node_shortcuts_toggle->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_update_create_root_dialog)); top_row->add_child(node_shortcuts_toggle); create_root_dialog->add_child(top_row); @@ -1491,19 +1491,19 @@ void SceneTreeDock::_notification(int p_what) { beginner_node_shortcuts->add_child(button_2d); button_2d->set_text(TTR("2D Scene")); button_2d->set_icon(get_editor_theme_icon(SNAME("Node2D"))); - button_2d->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_2D_SCENE, false)); + button_2d->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_2D_SCENE, false)); button_3d = memnew(Button); beginner_node_shortcuts->add_child(button_3d); button_3d->set_text(TTR("3D Scene")); button_3d->set_icon(get_editor_theme_icon(SNAME("Node3D"))); - button_3d->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_3D_SCENE, false)); + button_3d->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_3D_SCENE, false)); button_ui = memnew(Button); beginner_node_shortcuts->add_child(button_ui); button_ui->set_text(TTR("User Interface")); button_ui->set_icon(get_editor_theme_icon(SNAME("Control"))); - button_ui->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_USER_INTERFACE, false)); + button_ui->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_USER_INTERFACE, false)); favorite_node_shortcuts = memnew(VBoxContainer); node_shortcuts->add_child(favorite_node_shortcuts); @@ -1512,13 +1512,13 @@ void SceneTreeDock::_notification(int p_what) { node_shortcuts->add_child(button_custom); button_custom->set_text(TTR("Other Node")); button_custom->set_icon(get_editor_theme_icon(SNAME("Add"))); - button_custom->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_NEW, false)); + button_custom->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_NEW, false)); button_clipboard = memnew(Button); node_shortcuts->add_child(button_clipboard); button_clipboard->set_text(TTR("Paste From Clipboard")); button_clipboard->set_icon(get_editor_theme_icon(SNAME("ActionPaste"))); - button_clipboard->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_PASTE, false)); + button_clipboard->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_PASTE, false)); _update_create_root_dialog(); } break; @@ -3982,7 +3982,7 @@ void SceneTreeDock::_update_create_root_dialog() { name = ScriptServer::get_global_class_native_base(name); } button->set_icon(EditorNode::get_singleton()->get_class_icon(name)); - button->connect("pressed", callable_mp(this, &SceneTreeDock::_favorite_root_selected).bind(l)); + button->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_favorite_root_selected).bind(l)); } } } @@ -4266,14 +4266,14 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec button_add = memnew(Button); button_add->set_theme_type_variation("FlatMenuButton"); - button_add->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_NEW, false)); + button_add->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_NEW, false)); button_add->set_tooltip_text(TTR("Add/Create a New Node.")); button_add->set_shortcut(ED_GET_SHORTCUT("scene_tree/add_child_node")); filter_hbc->add_child(button_add); button_instance = memnew(Button); button_instance->set_theme_type_variation("FlatMenuButton"); - button_instance->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_INSTANTIATE, false)); + button_instance->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_INSTANTIATE, false)); button_instance->set_tooltip_text(TTR("Instantiate a scene file as a Node. Creates an inherited scene if no root node exists.")); button_instance->set_shortcut(ED_GET_SHORTCUT("scene_tree/instantiate_scene")); filter_hbc->add_child(button_instance); @@ -4298,7 +4298,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec button_create_script = memnew(Button); button_create_script->set_theme_type_variation("FlatMenuButton"); - button_create_script->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_ATTACH_SCRIPT, false)); + button_create_script->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_ATTACH_SCRIPT, false)); button_create_script->set_tooltip_text(TTR("Attach a new or existing script to the selected node.")); button_create_script->set_shortcut(ED_GET_SHORTCUT("scene_tree/attach_script")); filter_hbc->add_child(button_create_script); @@ -4306,7 +4306,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec button_detach_script = memnew(Button); button_detach_script->set_theme_type_variation("FlatMenuButton"); - button_detach_script->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_DETACH_SCRIPT, false)); + button_detach_script->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_DETACH_SCRIPT, false)); button_detach_script->set_tooltip_text(TTR("Detach the script from the selected node.")); button_detach_script->set_shortcut(ED_GET_SHORTCUT("scene_tree/detach_script")); filter_hbc->add_child(button_detach_script); @@ -4332,7 +4332,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec edit_remote->set_toggle_mode(true); edit_remote->set_tooltip_text(TTR("If selected, the Remote scene tree dock will cause the project to stutter every time it updates.\nSwitch back to the Local scene tree dock to improve performance.")); button_hb->add_child(edit_remote); - edit_remote->connect("pressed", callable_mp(this, &SceneTreeDock::_remote_tree_selected)); + edit_remote->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_remote_tree_selected)); edit_local = memnew(Button); edit_local->set_theme_type_variation("FlatButton"); @@ -4341,7 +4341,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec edit_local->set_toggle_mode(true); edit_local->set_pressed(true); button_hb->add_child(edit_local); - edit_local->connect("pressed", callable_mp(this, &SceneTreeDock::_local_tree_selected)); + edit_local->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_local_tree_selected)); remote_tree = nullptr; button_hb->hide(); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index c42d19395f..13fc5413b3 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -885,10 +885,10 @@ ScriptCreateDialog::ScriptCreateDialog() { hb->add_child(parent_name); register_text_enter(parent_name); parent_search_button = memnew(Button); - parent_search_button->connect("pressed", callable_mp(this, &ScriptCreateDialog::_browse_class_in_tree)); + parent_search_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_browse_class_in_tree)); hb->add_child(parent_search_button); parent_browse_button = memnew(Button); - parent_browse_button->connect("pressed", callable_mp(this, &ScriptCreateDialog::_browse_path).bind(true, false)); + parent_browse_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_browse_path).bind(true, false)); hb->add_child(parent_browse_button); gc->add_child(memnew(Label(TTR("Inherits:")))); gc->add_child(hb); @@ -900,7 +900,7 @@ ScriptCreateDialog::ScriptCreateDialog() { use_templates = memnew(CheckBox); use_templates->set_pressed(is_using_templates); - use_templates->connect("pressed", callable_mp(this, &ScriptCreateDialog::_use_template_pressed)); + use_templates->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_use_template_pressed)); template_hb->add_child(use_templates); template_inactive_message = ""; @@ -916,7 +916,7 @@ ScriptCreateDialog::ScriptCreateDialog() { built_in = memnew(CheckBox); built_in->set_text(TTR("On")); - built_in->connect("pressed", callable_mp(this, &ScriptCreateDialog::_built_in_pressed)); + built_in->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_built_in_pressed)); gc->add_child(memnew(Label(TTR("Built-in Script:")))); gc->add_child(built_in); @@ -930,7 +930,7 @@ ScriptCreateDialog::ScriptCreateDialog() { hb->add_child(file_path); register_text_enter(file_path); path_button = memnew(Button); - path_button->connect("pressed", callable_mp(this, &ScriptCreateDialog::_browse_path).bind(false, true)); + path_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_browse_path).bind(false, true)); hb->add_child(path_button); Label *label = memnew(Label(TTR("Path:"))); gc->add_child(label); diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp index 0b9915ca2b..6657aa6121 100644 --- a/editor/shader_create_dialog.cpp +++ b/editor/shader_create_dialog.cpp @@ -644,7 +644,7 @@ ShaderCreateDialog::ShaderCreateDialog() { hb->add_child(file_path); register_text_enter(file_path); path_button = memnew(Button); - path_button->connect("pressed", callable_mp(this, &ShaderCreateDialog::_browse_path)); + path_button->connect(SceneStringName(pressed), callable_mp(this, &ShaderCreateDialog::_browse_path)); hb->add_child(path_button); gc->add_child(memnew(Label(TTR("Path:")))); gc->add_child(hb); diff --git a/editor/shader_globals_editor.cpp b/editor/shader_globals_editor.cpp index 216ccd71ab..bd9b80590e 100644 --- a/editor/shader_globals_editor.cpp +++ b/editor/shader_globals_editor.cpp @@ -473,7 +473,7 @@ ShaderGlobalsEditor::ShaderGlobalsEditor() { variable_add = memnew(Button(TTR("Add"))); variable_add->set_disabled(true); add_menu_hb->add_child(variable_add); - variable_add->connect("pressed", callable_mp(this, &ShaderGlobalsEditor::_variable_added)); + variable_add->connect(SceneStringName(pressed), callable_mp(this, &ShaderGlobalsEditor::_variable_added)); inspector = memnew(EditorInspector); inspector->set_v_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp index 498ade7b5d..d56094b0f3 100644 --- a/editor/themes/editor_theme_manager.cpp +++ b/editor/themes/editor_theme_manager.cpp @@ -706,7 +706,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the p_theme->set_stylebox("normal", "Button", p_config.button_style); p_theme->set_stylebox("hover", "Button", p_config.button_style_hover); - p_theme->set_stylebox("pressed", "Button", p_config.button_style_pressed); + p_theme->set_stylebox(SceneStringName(pressed), "Button", p_config.button_style_pressed); p_theme->set_stylebox("focus", "Button", p_config.button_style_focus); p_theme->set_stylebox("disabled", "Button", p_config.button_style_disabled); @@ -732,7 +732,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the p_theme->set_stylebox("normal", "MenuButton", p_config.panel_container_style); p_theme->set_stylebox("hover", "MenuButton", p_config.button_style_hover); - p_theme->set_stylebox("pressed", "MenuButton", p_config.panel_container_style); + p_theme->set_stylebox(SceneStringName(pressed), "MenuButton", p_config.panel_container_style); p_theme->set_stylebox("focus", "MenuButton", p_config.panel_container_style); p_theme->set_stylebox("disabled", "MenuButton", p_config.panel_container_style); @@ -748,7 +748,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the p_theme->set_stylebox("normal", "MenuBar", p_config.button_style); p_theme->set_stylebox("hover", "MenuBar", p_config.button_style_hover); - p_theme->set_stylebox("pressed", "MenuBar", p_config.button_style_pressed); + p_theme->set_stylebox(SceneStringName(pressed), "MenuBar", p_config.button_style_pressed); p_theme->set_stylebox("disabled", "MenuBar", p_config.button_style_disabled); p_theme->set_color("font_color", "MenuBar", p_config.font_color); @@ -785,7 +785,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the p_theme->set_stylebox("focus", "OptionButton", option_button_focus_style); p_theme->set_stylebox("normal", "OptionButton", p_config.button_style); p_theme->set_stylebox("hover", "OptionButton", p_config.button_style_hover); - p_theme->set_stylebox("pressed", "OptionButton", p_config.button_style_pressed); + p_theme->set_stylebox(SceneStringName(pressed), "OptionButton", p_config.button_style_pressed); p_theme->set_stylebox("disabled", "OptionButton", p_config.button_style_disabled); p_theme->set_stylebox("normal_mirrored", "OptionButton", option_button_normal_style); @@ -817,7 +817,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the // CheckButton. p_theme->set_stylebox("normal", "CheckButton", p_config.panel_container_style); - p_theme->set_stylebox("pressed", "CheckButton", p_config.panel_container_style); + p_theme->set_stylebox(SceneStringName(pressed), "CheckButton", p_config.panel_container_style); p_theme->set_stylebox("disabled", "CheckButton", p_config.panel_container_style); p_theme->set_stylebox("hover", "CheckButton", p_config.panel_container_style); p_theme->set_stylebox("hover_pressed", "CheckButton", p_config.panel_container_style); @@ -856,7 +856,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the checkbox_style->set_content_margin_all(p_config.base_margin * EDSCALE); p_theme->set_stylebox("normal", "CheckBox", checkbox_style); - p_theme->set_stylebox("pressed", "CheckBox", checkbox_style); + p_theme->set_stylebox(SceneStringName(pressed), "CheckBox", checkbox_style); p_theme->set_stylebox("disabled", "CheckBox", checkbox_style); p_theme->set_stylebox("hover", "CheckBox", checkbox_style); p_theme->set_stylebox("hover_pressed", "CheckBox", checkbox_style); @@ -1744,7 +1744,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0); tag->set_corner_radius(CORNER_TOP_RIGHT, 4); tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4); - p_theme->set_stylebox("pressed", "ProjectTag", tag); + p_theme->set_stylebox(SceneStringName(pressed), "ProjectTag", tag); } } @@ -1810,20 +1810,20 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme main_screen_button_hover->set_content_margin((Side)i, p_config.button_style_hover->get_content_margin((Side)i)); } p_theme->set_stylebox("normal", "MainScreenButton", menu_transparent_style); - p_theme->set_stylebox("pressed", "MainScreenButton", menu_transparent_style); + p_theme->set_stylebox(SceneStringName(pressed), "MainScreenButton", menu_transparent_style); p_theme->set_stylebox("hover", "MainScreenButton", main_screen_button_hover); p_theme->set_stylebox("hover_pressed", "MainScreenButton", main_screen_button_hover); p_theme->set_type_variation("MainMenuBar", "FlatMenuButton"); p_theme->set_stylebox("normal", "MainMenuBar", menu_transparent_style); - p_theme->set_stylebox("pressed", "MainMenuBar", main_screen_button_hover); + p_theme->set_stylebox(SceneStringName(pressed), "MainMenuBar", main_screen_button_hover); p_theme->set_stylebox("hover", "MainMenuBar", main_screen_button_hover); p_theme->set_stylebox("hover_pressed", "MainMenuBar", main_screen_button_hover); // Run bar. p_theme->set_type_variation("RunBarButton", "FlatMenuButton"); p_theme->set_stylebox("disabled", "RunBarButton", menu_transparent_style); - p_theme->set_stylebox("pressed", "RunBarButton", menu_transparent_style); + p_theme->set_stylebox(SceneStringName(pressed), "RunBarButton", menu_transparent_style); // Bottom panel. Ref<StyleBoxFlat> style_bottom_panel = p_config.content_panel_style->duplicate(); @@ -1831,7 +1831,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme p_theme->set_stylebox("BottomPanel", EditorStringName(EditorStyles), style_bottom_panel); p_theme->set_type_variation("BottomPanelButton", "FlatMenuButton"); p_theme->set_stylebox("normal", "BottomPanelButton", menu_transparent_style); - p_theme->set_stylebox("pressed", "BottomPanelButton", menu_transparent_style); + p_theme->set_stylebox(SceneStringName(pressed), "BottomPanelButton", menu_transparent_style); p_theme->set_stylebox("hover_pressed", "BottomPanelButton", main_screen_button_hover); p_theme->set_stylebox("hover", "BottomPanelButton", main_screen_button_hover); } @@ -1902,12 +1902,12 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme p_theme->set_stylebox("normal", "FlatButton", style_flat_button); p_theme->set_stylebox("hover", "FlatButton", style_flat_button_hover); - p_theme->set_stylebox("pressed", "FlatButton", style_flat_button_pressed); + p_theme->set_stylebox(SceneStringName(pressed), "FlatButton", style_flat_button_pressed); p_theme->set_stylebox("disabled", "FlatButton", style_flat_button); p_theme->set_stylebox("normal", "FlatMenuButton", style_flat_button); p_theme->set_stylebox("hover", "FlatMenuButton", style_flat_button_hover); - p_theme->set_stylebox("pressed", "FlatMenuButton", style_flat_button_pressed); + p_theme->set_stylebox(SceneStringName(pressed), "FlatMenuButton", style_flat_button_pressed); p_theme->set_stylebox("disabled", "FlatMenuButton", style_flat_button); // Variation for Editor Log filter buttons. @@ -1932,7 +1932,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme } p_theme->set_stylebox("normal", "EditorLogFilterButton", style_flat_button); p_theme->set_stylebox("hover", "EditorLogFilterButton", style_flat_button_hover); - p_theme->set_stylebox("pressed", "EditorLogFilterButton", editor_log_button_pressed); + p_theme->set_stylebox(SceneStringName(pressed), "EditorLogFilterButton", editor_log_button_pressed); } // Buttons styles that stand out against the panel background (e.g. AssetLib). @@ -1953,7 +1953,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme p_theme->set_stylebox("normal", "PanelBackgroundButton", panel_button_style); p_theme->set_stylebox("hover", "PanelBackgroundButton", panel_button_style_hover); - p_theme->set_stylebox("pressed", "PanelBackgroundButton", panel_button_style_pressed); + p_theme->set_stylebox(SceneStringName(pressed), "PanelBackgroundButton", panel_button_style_pressed); p_theme->set_stylebox("disabled", "PanelBackgroundButton", panel_button_style_disabled); } @@ -1994,7 +1994,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme style_inspector_action = p_config.button_style_pressed->duplicate(); style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin); - p_theme->set_stylebox("pressed", "InspectorActionButton", style_inspector_action); + p_theme->set_stylebox(SceneStringName(pressed), "InspectorActionButton", style_inspector_action); style_inspector_action = p_config.button_style_disabled->duplicate(); style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin); @@ -2019,7 +2019,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme p_theme->set_stylebox("normal", "PreviewLightButton", sb_empty_borderless); p_theme->set_stylebox("hover", "PreviewLightButton", sb_empty_borderless); p_theme->set_stylebox("focus", "PreviewLightButton", sb_empty_borderless); - p_theme->set_stylebox("pressed", "PreviewLightButton", sb_empty_borderless); + p_theme->set_stylebox(SceneStringName(pressed), "PreviewLightButton", sb_empty_borderless); } // TabContainerOdd variation. diff --git a/editor/window_wrapper.cpp b/editor/window_wrapper.cpp index 768b0c6efe..b964a07285 100644 --- a/editor/window_wrapper.cpp +++ b/editor/window_wrapper.cpp @@ -368,9 +368,9 @@ void ScreenSelect::_build_advanced_menu() { button->add_theme_color_override("font_color", accent_color); } - button->connect("pressed", callable_mp(this, &ScreenSelect::_emit_screen_signal).bind(i)); - button->connect("pressed", callable_mp(static_cast<BaseButton *>(this), &ScreenSelect::set_pressed).bind(false)); - button->connect("pressed", callable_mp(static_cast<Window *>(popup), &Popup::hide)); + button->connect(SceneStringName(pressed), callable_mp(this, &ScreenSelect::_emit_screen_signal).bind(i)); + button->connect(SceneStringName(pressed), callable_mp(static_cast<BaseButton *>(this), &ScreenSelect::set_pressed).bind(false)); + button->connect(SceneStringName(pressed), callable_mp(static_cast<Window *>(popup), &Popup::hide)); } } diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp index 42c3ecc7cb..ccf347e03e 100644 --- a/modules/gltf/editor/editor_scene_importer_blend.cpp +++ b/modules/gltf/editor/editor_scene_importer_blend.cpp @@ -493,7 +493,7 @@ bool EditorFileSystemImportFormatSupportQueryBlend::query() { blender_path_browse = memnew(Button); blender_path_browse->set_text(TTR("Browse")); - blender_path_browse->connect("pressed", callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_browse_install)); + blender_path_browse->connect(SceneStringName(pressed), callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_browse_install)); hb->add_child(blender_path_browse); hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index 0cb3ec2d5e..27c74421db 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -1294,14 +1294,14 @@ GridMapEditor::GridMapEditor() { mode_thumbnail->set_toggle_mode(true); mode_thumbnail->set_pressed(true); hb->add_child(mode_thumbnail); - mode_thumbnail->connect("pressed", callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_THUMBNAIL)); + mode_thumbnail->connect(SceneStringName(pressed), callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_THUMBNAIL)); mode_list = memnew(Button); mode_list->set_theme_type_variation("FlatButton"); mode_list->set_toggle_mode(true); mode_list->set_pressed(false); hb->add_child(mode_list); - mode_list->connect("pressed", callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_LIST)); + mode_list->connect(SceneStringName(pressed), callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_LIST)); size_slider = memnew(HSlider); size_slider->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp index 2739e66e9e..cd3814879a 100644 --- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp +++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp @@ -342,7 +342,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor() transition_enabled = memnew(CheckBox); transition_enabled->set_text(TTR("Enabled")); edit_vb->add_margin_child(TTR("Use Transition:"), transition_enabled); - transition_enabled->connect("pressed", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited)); + transition_enabled->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited)); transition_from = memnew(OptionButton); edit_vb->add_margin_child(TTR("Transition From:"), transition_from); @@ -377,7 +377,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor() hold_previous = memnew(CheckBox); hold_previous->set_text(TTR("Enabled")); - hold_previous->connect("pressed", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited)); + hold_previous->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited)); edit_vb->add_margin_child(TTR("Hold Previous:"), hold_previous); set_exclusive(true); @@ -397,7 +397,7 @@ void EditorInspectorPluginAudioStreamInteractive::parse_end(Object *p_object) { if (Object::cast_to<AudioStreamInteractive>(p_object)) { Button *button = EditorInspector::create_inspector_action_button(TTR("Edit Transitions")); button->set_icon(audio_stream_interactive_transition_editor->get_editor_theme_icon(SNAME("Blend"))); - button->connect("pressed", callable_mp(this, &EditorInspectorPluginAudioStreamInteractive::_edit).bind(p_object)); + button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorPluginAudioStreamInteractive::_edit).bind(p_object)); add_custom_control(button); } } diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp index a45e5ffdc0..75941207c7 100644 --- a/modules/multiplayer/editor/editor_network_profiler.cpp +++ b/modules/multiplayer/editor/editor_network_profiler.cpp @@ -260,12 +260,12 @@ EditorNetworkProfiler::EditorNetworkProfiler() { activate = memnew(Button); activate->set_toggle_mode(true); activate->set_text(TTR("Start")); - activate->connect("pressed", callable_mp(this, &EditorNetworkProfiler::_activate_pressed)); + activate->connect(SceneStringName(pressed), callable_mp(this, &EditorNetworkProfiler::_activate_pressed)); hb->add_child(activate); clear_button = memnew(Button); clear_button->set_text(TTR("Clear")); - clear_button->connect("pressed", callable_mp(this, &EditorNetworkProfiler::_clear_pressed)); + clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorNetworkProfiler::_clear_pressed)); hb->add_child(clear_button); hb->add_spacer(); diff --git a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp index 29ebc38edf..a496f5dfa2 100644 --- a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp +++ b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp @@ -116,7 +116,7 @@ MultiplayerEditorPlugin::MultiplayerEditorPlugin() { repl_editor = memnew(ReplicationEditor); button = EditorNode::get_bottom_panel()->add_item(TTR("Replication"), repl_editor, ED_SHORTCUT_AND_COMMAND("bottom_panels/toggle_replication_bottom_panel", TTR("Toggle Replication Bottom Panel"))); button->hide(); - repl_editor->get_pin()->connect("pressed", callable_mp(this, &MultiplayerEditorPlugin::_pinned)); + repl_editor->get_pin()->connect(SceneStringName(pressed), callable_mp(this, &MultiplayerEditorPlugin::_pinned)); debugger.instantiate(); debugger->connect("open_request", callable_mp(this, &MultiplayerEditorPlugin::_open_request)); } diff --git a/modules/multiplayer/editor/replication_editor.cpp b/modules/multiplayer/editor/replication_editor.cpp index 08e7ba360a..3cc0a5ae53 100644 --- a/modules/multiplayer/editor/replication_editor.cpp +++ b/modules/multiplayer/editor/replication_editor.cpp @@ -244,7 +244,7 @@ ReplicationEditor::ReplicationEditor() { vb->add_child(hb); add_pick_button = memnew(Button); - add_pick_button->connect("pressed", callable_mp(this, &ReplicationEditor::_pick_new_property)); + add_pick_button->connect(SceneStringName(pressed), callable_mp(this, &ReplicationEditor::_pick_new_property)); add_pick_button->set_text(TTR("Add property to sync...")); hb->add_child(add_pick_button); @@ -260,7 +260,7 @@ ReplicationEditor::ReplicationEditor() { hb->add_child(np_line_edit); add_from_path_button = memnew(Button); - add_from_path_button->connect("pressed", callable_mp(this, &ReplicationEditor::_add_pressed)); + add_from_path_button->connect(SceneStringName(pressed), callable_mp(this, &ReplicationEditor::_add_pressed)); add_from_path_button->set_text(TTR("Add from path")); hb->add_child(add_from_path_button); diff --git a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp index d7bf1cdd38..d07d3cdff5 100644 --- a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp +++ b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp @@ -138,14 +138,14 @@ NavigationMeshEditor::NavigationMeshEditor() { button_bake->set_toggle_mode(true); button_bake->set_text(TTR("Bake NavigationMesh")); button_bake->set_tooltip_text(TTR("Bakes the NavigationMesh by first parsing the scene for source geometry and then creating the navigation mesh vertices and polygons.")); - button_bake->connect("pressed", callable_mp(this, &NavigationMeshEditor::_bake_pressed)); + button_bake->connect(SceneStringName(pressed), callable_mp(this, &NavigationMeshEditor::_bake_pressed)); button_reset = memnew(Button); button_reset->set_theme_type_variation("FlatButton"); bake_hbox->add_child(button_reset); button_reset->set_text(TTR("Clear NavigationMesh")); button_reset->set_tooltip_text(TTR("Clears the internal NavigationMesh vertices and polygons.")); - button_reset->connect("pressed", callable_mp(this, &NavigationMeshEditor::_clear_pressed)); + button_reset->connect(SceneStringName(pressed), callable_mp(this, &NavigationMeshEditor::_clear_pressed)); bake_info = memnew(Label); bake_hbox->add_child(bake_info); diff --git a/modules/noise/editor/noise_editor_plugin.cpp b/modules/noise/editor/noise_editor_plugin.cpp index 917fa0cd15..200f31cca1 100644 --- a/modules/noise/editor/noise_editor_plugin.cpp +++ b/modules/noise/editor/noise_editor_plugin.cpp @@ -67,7 +67,7 @@ public: _3d_space_switch->set_toggle_mode(true); _3d_space_switch->set_offset(SIDE_LEFT, PADDING_3D_SPACE_SWITCH); _3d_space_switch->set_offset(SIDE_TOP, PADDING_3D_SPACE_SWITCH); - _3d_space_switch->connect("pressed", callable_mp(this, &NoisePreview::_on_3d_button_pressed)); + _3d_space_switch->connect(SceneStringName(pressed), callable_mp(this, &NoisePreview::_on_3d_button_pressed)); add_child(_3d_space_switch); } diff --git a/modules/openxr/editor/openxr_action_editor.cpp b/modules/openxr/editor/openxr_action_editor.cpp index 4b188471a0..06d2e8dcc9 100644 --- a/modules/openxr/editor/openxr_action_editor.cpp +++ b/modules/openxr/editor/openxr_action_editor.cpp @@ -159,7 +159,7 @@ OpenXRActionEditor::OpenXRActionEditor(Ref<OpenXRAction> p_action) { rem_action = memnew(Button); rem_action->set_tooltip_text(TTR("Remove action")); - rem_action->connect("pressed", callable_mp(this, &OpenXRActionEditor::_on_remove_action)); + rem_action->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionEditor::_on_remove_action)); rem_action->set_flat(true); add_child(rem_action); } diff --git a/modules/openxr/editor/openxr_action_map_editor.cpp b/modules/openxr/editor/openxr_action_map_editor.cpp index 5dd737756a..62b4a427b9 100644 --- a/modules/openxr/editor/openxr_action_map_editor.cpp +++ b/modules/openxr/editor/openxr_action_map_editor.cpp @@ -402,13 +402,13 @@ OpenXRActionMapEditor::OpenXRActionMapEditor() { add_action_set = memnew(Button); add_action_set->set_text(TTR("Add Action Set")); add_action_set->set_tooltip_text(TTR("Add an action set.")); - add_action_set->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_add_action_set)); + add_action_set->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_add_action_set)); top_hb->add_child(add_action_set); add_interaction_profile = memnew(Button); add_interaction_profile->set_text(TTR("Add profile")); add_interaction_profile->set_tooltip_text(TTR("Add an interaction profile.")); - add_interaction_profile->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_add_interaction_profile)); + add_interaction_profile->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_add_interaction_profile)); top_hb->add_child(add_interaction_profile); VSeparator *vseparator = memnew(VSeparator); @@ -417,13 +417,13 @@ OpenXRActionMapEditor::OpenXRActionMapEditor() { save_as = memnew(Button); save_as->set_text(TTR("Save")); save_as->set_tooltip_text(TTR("Save this OpenXR action map.")); - save_as->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_save_action_map)); + save_as->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_save_action_map)); top_hb->add_child(save_as); _default = memnew(Button); _default->set_text(TTR("Reset to Default")); _default->set_tooltip_text(TTR("Reset to default OpenXR action map.")); - _default->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_reset_to_default_layout)); + _default->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_reset_to_default_layout)); top_hb->add_child(_default); tabs = memnew(TabContainer); diff --git a/modules/openxr/editor/openxr_action_set_editor.cpp b/modules/openxr/editor/openxr_action_set_editor.cpp index 8b4a0e989c..5d9a3155fb 100644 --- a/modules/openxr/editor/openxr_action_set_editor.cpp +++ b/modules/openxr/editor/openxr_action_set_editor.cpp @@ -229,7 +229,7 @@ OpenXRActionSetEditor::OpenXRActionSetEditor(Ref<OpenXRActionMap> p_action_map, fold_btn = memnew(Button); fold_btn->set_v_size_flags(Control::SIZE_SHRINK_BEGIN); - fold_btn->connect("pressed", callable_mp(this, &OpenXRActionSetEditor::_on_toggle_expand)); + fold_btn->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionSetEditor::_on_toggle_expand)); fold_btn->set_flat(true); panel_hb->add_child(fold_btn); @@ -262,13 +262,13 @@ OpenXRActionSetEditor::OpenXRActionSetEditor(Ref<OpenXRActionMap> p_action_map, add_action = memnew(Button); add_action->set_tooltip_text(TTR("Add action.")); - add_action->connect("pressed", callable_mp(this, &OpenXRActionSetEditor::_on_add_action)); + add_action->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionSetEditor::_on_add_action)); add_action->set_flat(true); action_set_hb->add_child(add_action); rem_action_set = memnew(Button); rem_action_set->set_tooltip_text(TTR("Remove action set.")); - rem_action_set->connect("pressed", callable_mp(this, &OpenXRActionSetEditor::_on_remove_action_set)); + rem_action_set->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionSetEditor::_on_remove_action_set)); rem_action_set->set_flat(true); action_set_hb->add_child(rem_action_set); diff --git a/modules/openxr/editor/openxr_interaction_profile_editor.cpp b/modules/openxr/editor/openxr_interaction_profile_editor.cpp index da6a9eed70..ab36c0744e 100644 --- a/modules/openxr/editor/openxr_interaction_profile_editor.cpp +++ b/modules/openxr/editor/openxr_interaction_profile_editor.cpp @@ -222,7 +222,7 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co Button *path_add = memnew(Button); path_add->set_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); path_add->set_flat(true); - path_add->connect("pressed", callable_mp(this, &OpenXRInteractionProfileEditor::select_action_for).bind(String(p_io_path->openxr_path))); + path_add->connect(SceneStringName(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()) { @@ -249,7 +249,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"), EditorStringName(EditorIcons))); - action_rem->connect("pressed", callable_mp((OpenXRInteractionProfileEditor *)this, &OpenXRInteractionProfileEditor::_on_remove_pressed).bind(action->get_name_with_set(), String(p_io_path->openxr_path))); + action_rem->connect(SceneStringName(pressed), callable_mp((OpenXRInteractionProfileEditor *)this, &OpenXRInteractionProfileEditor::_on_remove_pressed).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 8eec54be63..de0ab40f9e 100644 --- a/modules/openxr/editor/openxr_select_action_dialog.cpp +++ b/modules/openxr/editor/openxr_select_action_dialog.cpp @@ -97,7 +97,7 @@ void OpenXRSelectActionDialog::open() { String action_name = action->get_name_with_set(); 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).bind(action_name)); + action_button->connect(SceneStringName(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 8fd66fac04..e6705d5c82 100644 --- a/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp +++ b/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp @@ -82,7 +82,7 @@ void OpenXRSelectInteractionProfileDialog::open(PackedStringArray p_do_not_inclu Button *ip_button = memnew(Button); ip_button->set_flat(true); ip_button->set_text(OpenXRInteractionProfileMetadata::get_singleton()->get_profile(path)->display_name); - ip_button->connect("pressed", callable_mp(this, &OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile).bind(path)); + ip_button->connect(SceneStringName(pressed), callable_mp(this, &OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile).bind(path)); main_vb->add_child(ip_button); ip_buttons[path] = ip_button->get_path(); diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index f682471a48..ff409272c5 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -305,7 +305,7 @@ void TouchScreenButton::_press(int p_finger_pressed) { get_viewport()->push_input(iea, true); } - emit_signal(SNAME("pressed")); + emit_signal(SceneStringName(pressed)); queue_redraw(); } @@ -373,7 +373,7 @@ bool TouchScreenButton::_set(const StringName &p_name, const Variant &p_value) { if (p_name == CoreStringName(normal)) { // Compatibility with Godot 3.x. set_texture_normal(p_value); return true; - } else if (p_name == SNAME("pressed")) { // Compatibility with Godot 3.x. + } else if (p_name == SceneStringName(pressed)) { // Compatibility with Godot 3.x. set_texture_pressed(p_value); return true; } diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 21820d399c..01e3cce78b 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -134,7 +134,7 @@ void BaseButton::_notification(int p_what) { void BaseButton::_pressed() { GDVIRTUAL_CALL(_pressed); pressed(); - emit_signal(SNAME("pressed")); + emit_signal(SceneStringName(pressed)); } void BaseButton::_toggled(bool p_pressed) { @@ -161,7 +161,7 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) { status.pressed = !status.pressed; _unpress_group(); if (button_group.is_valid()) { - button_group->emit_signal(SNAME("pressed"), this); + button_group->emit_signal(SceneStringName(pressed), this); } _toggled(status.pressed); _pressed(); @@ -225,7 +225,7 @@ void BaseButton::set_pressed(bool p_pressed) { if (p_pressed) { _unpress_group(); if (button_group.is_valid()) { - button_group->emit_signal(SNAME("pressed"), this); + button_group->emit_signal(SceneStringName(pressed), this); } } _toggled(status.pressed); @@ -367,7 +367,7 @@ void BaseButton::shortcut_input(const Ref<InputEvent> &p_event) { _unpress_group(); if (button_group.is_valid()) { - button_group->emit_signal(SNAME("pressed"), this); + button_group->emit_signal(SceneStringName(pressed), this); } _toggled(status.pressed); diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 65f3bcdbe7..245a086dda 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -95,7 +95,7 @@ void ColorPicker::_notification(int p_what) { for (int i = 0; i < MODE_BUTTON_COUNT; i++) { mode_btns[i]->begin_bulk_theme_override(); - mode_btns[i]->add_theme_style_override(SNAME("pressed"), theme_cache.mode_button_pressed); + mode_btns[i]->add_theme_style_override(SceneStringName(pressed), theme_cache.mode_button_pressed); mode_btns[i]->add_theme_style_override(CoreStringName(normal), theme_cache.mode_button_normal); mode_btns[i]->add_theme_style_override(SNAME("hover"), theme_cache.mode_button_hover); mode_btns[i]->end_bulk_theme_override(); @@ -1836,11 +1836,11 @@ ColorPicker::ColorPicker() { sample_hbc->add_child(btn_pick); if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SCREEN_CAPTURE)) { btn_pick->set_tooltip_text(ETR("Pick a color from the screen.")); - btn_pick->connect(SNAME("pressed"), callable_mp(this, &ColorPicker::_pick_button_pressed)); + btn_pick->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_pick_button_pressed)); } else { // On unsupported platforms, use a legacy method for color picking. btn_pick->set_tooltip_text(ETR("Pick a color from the application window.")); - btn_pick->connect(SNAME("pressed"), callable_mp(this, &ColorPicker::_pick_button_pressed_legacy)); + btn_pick->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_pick_button_pressed_legacy)); } sample = memnew(TextureRect); @@ -1883,7 +1883,7 @@ ColorPicker::ColorPicker() { mode_btns[i]->set_toggle_mode(true); mode_btns[i]->set_text(modes[i]->get_name()); mode_btns[i]->set_button_group(mode_group); - mode_btns[i]->connect("pressed", callable_mp(this, &ColorPicker::set_color_mode).bind((ColorModeType)i)); + mode_btns[i]->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::set_color_mode).bind((ColorModeType)i)); } mode_btns[0]->set_pressed(true); @@ -1936,7 +1936,7 @@ ColorPicker::ColorPicker() { text_type->set_text("#"); text_type->set_tooltip_text(RTR("Switch between hexadecimal and code values.")); if (Engine::get_singleton()->is_editor_hint()) { - text_type->connect("pressed", callable_mp(this, &ColorPicker::_text_type_toggled)); + text_type->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_text_type_toggled)); } else { text_type->set_flat(true); text_type->set_mouse_filter(MOUSE_FILTER_IGNORE); @@ -2026,7 +2026,7 @@ ColorPicker::ColorPicker() { btn_add_preset = memnew(Button); btn_add_preset->set_icon_alignment(HORIZONTAL_ALIGNMENT_CENTER); btn_add_preset->set_tooltip_text(ETR("Add current color as a preset.")); - btn_add_preset->connect("pressed", callable_mp(this, &ColorPicker::_add_preset_pressed)); + btn_add_preset->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_add_preset_pressed)); preset_container->add_child(btn_add_preset); } diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 267096cd09..58961d370c 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -316,7 +316,7 @@ Button *AcceptDialog::add_button(const String &p_text, bool p_right, const Strin } if (!p_action.is_empty()) { - button->connect("pressed", callable_mp(this, &AcceptDialog::_custom_action).bind(p_action)); + button->connect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_custom_action).bind(p_action)); } return button; @@ -330,7 +330,7 @@ Button *AcceptDialog::add_cancel_button(const String &p_cancel) { Button *b = swap_cancel_ok ? add_button(c, true) : add_button(c); - b->connect("pressed", callable_mp(this, &AcceptDialog::_cancel_pressed)); + b->connect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_cancel_pressed)); return b; } @@ -346,11 +346,11 @@ void AcceptDialog::remove_button(Button *p_button) { } p_button->disconnect(SceneStringName(visibility_changed), callable_mp(this, &AcceptDialog::_custom_button_visibility_changed)); - if (p_button->is_connected("pressed", callable_mp(this, &AcceptDialog::_custom_action))) { - p_button->disconnect("pressed", callable_mp(this, &AcceptDialog::_custom_action)); + if (p_button->is_connected(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_custom_action))) { + p_button->disconnect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_custom_action)); } - if (p_button->is_connected("pressed", callable_mp(this, &AcceptDialog::_cancel_pressed))) { - p_button->disconnect("pressed", callable_mp(this, &AcceptDialog::_cancel_pressed)); + if (p_button->is_connected(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_cancel_pressed))) { + p_button->disconnect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_cancel_pressed)); } if (right_spacer) { @@ -433,7 +433,7 @@ AcceptDialog::AcceptDialog() { buttons_hbox->add_child(ok_button); buttons_hbox->add_spacer(); - ok_button->connect("pressed", callable_mp(this, &AcceptDialog::_ok_pressed)); + ok_button->connect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_ok_pressed)); set_title(ETR("Alert!")); } diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 91424c0ffd..0c146ce173 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -1409,9 +1409,9 @@ FileDialog::FileDialog() { hbc->add_child(dir_prev); hbc->add_child(dir_next); hbc->add_child(dir_up); - dir_prev->connect("pressed", callable_mp(this, &FileDialog::_go_back)); - dir_next->connect("pressed", callable_mp(this, &FileDialog::_go_forward)); - dir_up->connect("pressed", callable_mp(this, &FileDialog::_go_up)); + dir_prev->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::_go_back)); + dir_next->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::_go_forward)); + dir_up->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::_go_up)); hbc->add_child(memnew(Label(ETR("Path:")))); @@ -1430,7 +1430,7 @@ FileDialog::FileDialog() { refresh = memnew(Button); refresh->set_theme_type_variation("FlatButton"); refresh->set_tooltip_text(ETR("Refresh files.")); - refresh->connect("pressed", callable_mp(this, &FileDialog::update_file_list)); + refresh->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::update_file_list)); hbc->add_child(refresh); show_hidden = memnew(Button); @@ -1447,7 +1447,7 @@ FileDialog::FileDialog() { makedir = memnew(Button); makedir->set_theme_type_variation("FlatButton"); makedir->set_tooltip_text(ETR("Create a new folder.")); - makedir->connect("pressed", callable_mp(this, &FileDialog::_make_dir)); + makedir->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::_make_dir)); hbc->add_child(makedir); vbox->add_child(hbc); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 7878786716..d5ad258df8 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -2824,7 +2824,7 @@ GraphEdit::GraphEdit() { zoom_minus_button->set_tooltip_text(ETR("Zoom Out")); zoom_minus_button->set_focus_mode(FOCUS_NONE); menu_hbox->add_child(zoom_minus_button); - zoom_minus_button->connect("pressed", callable_mp(this, &GraphEdit::_zoom_minus)); + zoom_minus_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_zoom_minus)); zoom_reset_button = memnew(Button); zoom_reset_button->set_theme_type_variation("FlatButton"); @@ -2832,7 +2832,7 @@ GraphEdit::GraphEdit() { zoom_reset_button->set_tooltip_text(ETR("Zoom Reset")); zoom_reset_button->set_focus_mode(FOCUS_NONE); menu_hbox->add_child(zoom_reset_button); - zoom_reset_button->connect("pressed", callable_mp(this, &GraphEdit::_zoom_reset)); + zoom_reset_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_zoom_reset)); zoom_plus_button = memnew(Button); zoom_plus_button->set_theme_type_variation("FlatButton"); @@ -2840,7 +2840,7 @@ GraphEdit::GraphEdit() { zoom_plus_button->set_tooltip_text(ETR("Zoom In")); zoom_plus_button->set_focus_mode(FOCUS_NONE); menu_hbox->add_child(zoom_plus_button); - zoom_plus_button->connect("pressed", callable_mp(this, &GraphEdit::_zoom_plus)); + zoom_plus_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_zoom_plus)); // Grid controls. @@ -2852,7 +2852,7 @@ GraphEdit::GraphEdit() { toggle_grid_button->set_tooltip_text(ETR("Toggle the visual grid.")); toggle_grid_button->set_focus_mode(FOCUS_NONE); menu_hbox->add_child(toggle_grid_button); - toggle_grid_button->connect("pressed", callable_mp(this, &GraphEdit::_show_grid_toggled)); + toggle_grid_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_show_grid_toggled)); toggle_snapping_button = memnew(Button); toggle_snapping_button->set_theme_type_variation("FlatButton"); @@ -2862,7 +2862,7 @@ GraphEdit::GraphEdit() { toggle_snapping_button->set_pressed(snapping_enabled); toggle_snapping_button->set_focus_mode(FOCUS_NONE); menu_hbox->add_child(toggle_snapping_button); - toggle_snapping_button->connect("pressed", callable_mp(this, &GraphEdit::_snapping_toggled)); + toggle_snapping_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_snapping_toggled)); snapping_distance_spinbox = memnew(SpinBox); snapping_distance_spinbox->set_visible(show_grid_buttons); @@ -2884,12 +2884,12 @@ GraphEdit::GraphEdit() { minimap_button->set_pressed(show_grid); minimap_button->set_focus_mode(FOCUS_NONE); menu_hbox->add_child(minimap_button); - minimap_button->connect("pressed", callable_mp(this, &GraphEdit::_minimap_toggled)); + minimap_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_minimap_toggled)); arrange_button = memnew(Button); arrange_button->set_theme_type_variation("FlatButton"); arrange_button->set_visible(show_arrange_button); - arrange_button->connect("pressed", callable_mp(this, &GraphEdit::arrange_nodes)); + arrange_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::arrange_nodes)); arrange_button->set_focus_mode(FOCUS_NONE); menu_hbox->add_child(arrange_button); arrange_button->set_tooltip_text(ETR("Automatically arrange selected nodes.")); diff --git a/scene/main/status_indicator.cpp b/scene/main/status_indicator.cpp index 891974f68f..f0ba5db1a0 100644 --- a/scene/main/status_indicator.cpp +++ b/scene/main/status_indicator.cpp @@ -91,7 +91,7 @@ void StatusIndicator::_bind_methods() { } void StatusIndicator::_callback(MouseButton p_index, const Point2i &p_pos) { - emit_signal(SNAME("pressed"), p_index, p_pos); + emit_signal(SceneStringName(pressed), p_index, p_pos); } void StatusIndicator::set_icon(const Ref<Texture2D> &p_icon) { diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index c51b2cb327..4990b0cede 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -205,6 +205,8 @@ SceneStringNames::SceneStringNames() { shader_overrides_group = StaticCString::create("_shader_overrides_group_"); shader_overrides_group_active = StaticCString::create("_shader_overrides_group_active_"); + pressed = StaticCString::create("pressed"); + #ifndef DISABLE_DEPRECATED use_in_baked_light = StaticCString::create("use_in_baked_light"); use_dynamic_gi = StaticCString::create("use_dynamic_gi"); diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 38c50d2124..9544ce9b98 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -213,6 +213,8 @@ public: StringName shader_overrides_group; StringName shader_overrides_group_active; + StringName pressed; + #ifndef DISABLE_DEPRECATED StringName use_in_baked_light; StringName use_dynamic_gi; diff --git a/scene/theme/default_theme.cpp b/scene/theme/default_theme.cpp index c92d03feaa..aa4d669238 100644 --- a/scene/theme/default_theme.cpp +++ b/scene/theme/default_theme.cpp @@ -161,7 +161,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("normal", "Button", button_normal); theme->set_stylebox("hover", "Button", button_hover); - theme->set_stylebox("pressed", "Button", button_pressed); + theme->set_stylebox(SceneStringName(pressed), "Button", button_pressed); theme->set_stylebox("disabled", "Button", button_disabled); theme->set_stylebox("focus", "Button", focus); @@ -190,7 +190,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const // MenuBar theme->set_stylebox("normal", "MenuBar", button_normal); theme->set_stylebox("hover", "MenuBar", button_hover); - theme->set_stylebox("pressed", "MenuBar", button_pressed); + theme->set_stylebox(SceneStringName(pressed), "MenuBar", button_pressed); theme->set_stylebox("disabled", "MenuBar", button_disabled); theme->set_font("font", "MenuBar", Ref<Font>()); @@ -233,7 +233,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("normal", "OptionButton", sb_optbutton_normal); theme->set_stylebox("hover", "OptionButton", sb_optbutton_hover); - theme->set_stylebox("pressed", "OptionButton", sb_optbutton_pressed); + theme->set_stylebox(SceneStringName(pressed), "OptionButton", sb_optbutton_pressed); theme->set_stylebox("disabled", "OptionButton", sb_optbutton_disabled); Ref<StyleBox> sb_optbutton_normal_mirrored = make_flat_stylebox(style_normal_color, 2 * default_margin, default_margin, 2 * default_margin, default_margin); @@ -267,7 +267,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const // MenuButton theme->set_stylebox("normal", "MenuButton", button_normal); - theme->set_stylebox("pressed", "MenuButton", button_pressed); + theme->set_stylebox(SceneStringName(pressed), "MenuButton", button_pressed); theme->set_stylebox("hover", "MenuButton", button_hover); theme->set_stylebox("disabled", "MenuButton", button_disabled); theme->set_stylebox("focus", "MenuButton", focus); @@ -293,7 +293,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const cbx_focus->set_content_margin_all(Math::round(4 * scale)); theme->set_stylebox("normal", "CheckBox", cbx_empty); - theme->set_stylebox("pressed", "CheckBox", cbx_empty); + theme->set_stylebox(SceneStringName(pressed), "CheckBox", cbx_empty); theme->set_stylebox("disabled", "CheckBox", cbx_empty); theme->set_stylebox("hover", "CheckBox", cbx_empty); theme->set_stylebox("hover_pressed", "CheckBox", cbx_empty); @@ -329,7 +329,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const cb_empty->set_content_margin_individual(Math::round(6 * scale), Math::round(4 * scale), Math::round(6 * scale), Math::round(4 * scale)); theme->set_stylebox("normal", "CheckButton", cb_empty); - theme->set_stylebox("pressed", "CheckButton", cb_empty); + theme->set_stylebox(SceneStringName(pressed), "CheckButton", cb_empty); theme->set_stylebox("disabled", "CheckButton", cb_empty); theme->set_stylebox("hover", "CheckButton", cb_empty); theme->set_stylebox("hover_pressed", "CheckButton", cb_empty); @@ -374,12 +374,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("normal", "FlatButton", flat_button_normal); theme->set_stylebox("hover", "FlatButton", flat_button_normal); - theme->set_stylebox("pressed", "FlatButton", flat_button_pressed); + theme->set_stylebox(SceneStringName(pressed), "FlatButton", flat_button_pressed); theme->set_stylebox("disabled", "FlatButton", flat_button_normal); theme->set_stylebox("normal", "FlatMenuButton", flat_button_normal); theme->set_stylebox("hover", "FlatMenuButton", flat_button_normal); - theme->set_stylebox("pressed", "FlatMenuButton", flat_button_pressed); + theme->set_stylebox(SceneStringName(pressed), "FlatMenuButton", flat_button_pressed); theme->set_stylebox("disabled", "FlatMenuButton", flat_button_normal); // Label @@ -1051,7 +1051,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("bg", "ColorPickerButton", icons["mini_checkerboard"]); theme->set_stylebox("normal", "ColorPickerButton", button_normal); - theme->set_stylebox("pressed", "ColorPickerButton", button_pressed); + theme->set_stylebox(SceneStringName(pressed), "ColorPickerButton", button_pressed); theme->set_stylebox("hover", "ColorPickerButton", button_hover); theme->set_stylebox("disabled", "ColorPickerButton", button_disabled); theme->set_stylebox("focus", "ColorPickerButton", focus); |