diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 8e7d1e30cd3..fc9212ba18f 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -7314,7 +7314,7 @@ AnimationTrackEditor::AnimationTrackEditor() { snap_mode->add_item(TTR("Seconds")); snap_mode->add_item(TTR("FPS")); bottom_hb->add_child(snap_mode); - snap_mode->connect("item_selected", callable_mp(this, &AnimationTrackEditor::_snap_mode_changed)); + snap_mode->connect(SceneStringName(item_selected), callable_mp(this, &AnimationTrackEditor::_snap_mode_changed)); snap_mode->set_disabled(true); bottom_hb->add_child(memnew(VSeparator)); diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index b7afa1096b6..4cf3d27121c 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -776,7 +776,7 @@ ConnectDialog::ConnectDialog() { method_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); method_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); method_tree->set_hide_root(true); - method_tree->connect("item_selected", callable_mp(this, &ConnectDialog::_method_selected)); + method_tree->connect(SceneStringName(item_selected), callable_mp(this, &ConnectDialog::_method_selected)); method_tree->connect("item_activated", callable_mp((Window *)method_popup, &Window::hide)); empty_tree_label = memnew(Label(TTR("No method found matching given filters."))); @@ -1641,7 +1641,7 @@ ConnectionsDock::ConnectionsDock() { add_child(slot_menu); connect_dialog->connect("connected", callable_mp(this, &ConnectionsDock::_make_or_edit_connection)); - tree->connect("item_selected", callable_mp(this, &ConnectionsDock::_tree_item_selected)); + tree->connect(SceneStringName(item_selected), callable_mp(this, &ConnectionsDock::_tree_item_selected)); tree->connect("item_activated", callable_mp(this, &ConnectionsDock::_tree_item_activated)); tree->connect(SceneStringName(gui_input), callable_mp(this, &ConnectionsDock::_tree_gui_input)); diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 2b36b9254cc..3e77a08c0d9 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -777,7 +777,7 @@ CreateDialog::CreateDialog() { recent->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); rec_vb->add_margin_child(TTR("Recent:"), recent, true); recent->set_allow_reselect(true); - recent->connect("item_selected", callable_mp(this, &CreateDialog::_history_selected)); + recent->connect(SceneStringName(item_selected), callable_mp(this, &CreateDialog::_history_selected)); recent->connect("item_activated", callable_mp(this, &CreateDialog::_history_activated)); recent->add_theme_constant_override("draw_guides", 1); diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index 1a1817d69d3..4c4318a89ef 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -640,7 +640,7 @@ EditorProfiler::EditorProfiler() { display_mode->add_item(TTR("Average Time (ms)")); display_mode->add_item(TTR("Frame %")); display_mode->add_item(TTR("Physics Frame %")); - display_mode->connect("item_selected", callable_mp(this, &EditorProfiler::_combo_changed)); + display_mode->connect(SceneStringName(item_selected), callable_mp(this, &EditorProfiler::_combo_changed)); hb->add_child(display_mode); @@ -652,7 +652,7 @@ EditorProfiler::EditorProfiler() { // TRANSLATORS: This is an option in the profiler to display the time spent in a function, exincluding the time spent in other functions called by that function. display_time->add_item(TTR("Self")); display_time->set_tooltip_text(TTR("Inclusive: Includes time from other functions called by this function.\nUse this to spot bottlenecks.\n\nSelf: Only count the time spent in the function itself, not in other functions called by that function.\nUse this to find individual functions to optimize.")); - display_time->connect("item_selected", callable_mp(this, &EditorProfiler::_combo_changed)); + display_time->connect(SceneStringName(item_selected), callable_mp(this, &EditorProfiler::_combo_changed)); hb->add_child(display_time); diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 7e105c516a5..53c6cd748a9 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -750,7 +750,7 @@ EditorVisualProfiler::EditorVisualProfiler() { display_mode = memnew(OptionButton); display_mode->add_item(TTR("Frame Time (ms)")); display_mode->add_item(TTR("Frame %")); - display_mode->connect("item_selected", callable_mp(this, &EditorVisualProfiler::_combo_changed)); + display_mode->connect(SceneStringName(item_selected), callable_mp(this, &EditorVisualProfiler::_combo_changed)); hb->add_child(display_mode); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index ff9b4c73a66..b062b20000a 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -851,7 +851,7 @@ void ScriptEditorDebugger::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { 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(SceneStringName(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)); [[fallthrough]]; @@ -1886,7 +1886,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() { threads = memnew(OptionButton); thread_hb->add_child(threads); threads->set_h_size_flags(SIZE_EXPAND_FILL); - threads->connect("item_selected", callable_mp(this, &ScriptEditorDebugger::_select_thread)); + threads->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditorDebugger::_select_thread)); stack_dump = memnew(Tree); stack_dump->set_allow_reselect(true); diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 6893b2878b5..dc943fc783c 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -359,7 +359,7 @@ EditorAbout::EditorAbout() { _tpl_text->set_v_size_flags(Control::SIZE_EXPAND_FILL); tpl_hbc->add_child(_tpl_text); - _tpl_tree->connect("item_selected", callable_mp(this, &EditorAbout::_license_tree_selected)); + _tpl_tree->connect(SceneStringName(item_selected), callable_mp(this, &EditorAbout::_license_tree_selected)); tpl_ti_all->select(0); _tpl_text->set_text(tpl_ti_all->get_metadata(0)); } diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index db59606ffc6..4323b3d0af6 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -938,7 +938,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { send = memnew(OptionButton); send->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); send->set_clip_text(true); - send->connect("item_selected", callable_mp(this, &EditorAudioBus::_send_selected)); + send->connect(SceneStringName(item_selected), callable_mp(this, &EditorAudioBus::_send_selected)); vb->add_child(send); set_focus_mode(FOCUS_CLICK); diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index 9e100b6a674..7204ab81f0e 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -360,7 +360,7 @@ EditorCommandPalette::EditorCommandPalette() { search_options = memnew(Tree); search_options->connect("item_activated", callable_mp(this, &EditorCommandPalette::_confirmed)); - search_options->connect("item_selected", callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(false)); + search_options->connect(SceneStringName(item_selected), callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(false)); search_options->connect("nothing_selected", callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(true)); search_options->create_item(); search_options->set_hide_root(true); diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index ba04f36abe5..966bd7635e1 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -936,7 +936,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { profile_list->set_h_size_flags(Control::SIZE_EXPAND_FILL); profile_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); profiles_hbc->add_child(profile_list); - profile_list->connect("item_selected", callable_mp(this, &EditorFeatureProfileManager::_profile_selected)); + profile_list->connect(SceneStringName(item_selected), callable_mp(this, &EditorFeatureProfileManager::_profile_selected)); profile_actions[PROFILE_NEW] = memnew(Button(TTR("Create Profile"))); profiles_hbc->add_child(profile_actions[PROFILE_NEW]); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index f42cc62fe25..09cb7078cb3 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -351,7 +351,7 @@ EditorHelpSearch::EditorHelpSearch() { filter_combo->add_item(TTR("Constants Only"), SEARCH_CONSTANTS); filter_combo->add_item(TTR("Properties Only"), SEARCH_PROPERTIES); filter_combo->add_item(TTR("Theme Properties Only"), SEARCH_THEME_ITEMS); - filter_combo->connect("item_selected", callable_mp(this, &EditorHelpSearch::_filter_combo_item_selected)); + filter_combo->connect(SceneStringName(item_selected), callable_mp(this, &EditorHelpSearch::_filter_combo_item_selected)); hbox->add_child(filter_combo); // Create the results tree. @@ -369,7 +369,7 @@ EditorHelpSearch::EditorHelpSearch() { results_tree->set_hide_root(true); results_tree->set_select_mode(Tree::SELECT_ROW); results_tree->connect("item_activated", callable_mp(this, &EditorHelpSearch::_confirmed)); - results_tree->connect("item_selected", callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(false)); + results_tree->connect(SceneStringName(item_selected), callable_mp((BaseButton *)get_ok_button(), &BaseButton::set_disabled).bind(false)); vbox->add_child(results_tree, true); } diff --git a/editor/editor_locale_dialog.cpp b/editor/editor_locale_dialog.cpp index e97e4ac777b..f8fd05bf1e3 100644 --- a/editor/editor_locale_dialog.cpp +++ b/editor/editor_locale_dialog.cpp @@ -399,7 +399,7 @@ EditorLocaleDialog::EditorLocaleDialog() { filter_mode->set_h_size_flags(Control::SIZE_EXPAND_FILL); filter_mode->add_item(TTR("Show Selected Locales Only"), SHOW_ONLY_SELECTED_LOCALES); filter_mode->select(0); - filter_mode->connect("item_selected", callable_mp(this, &EditorLocaleDialog::_filter_mode_changed)); + filter_mode->connect(SceneStringName(item_selected), callable_mp(this, &EditorLocaleDialog::_filter_mode_changed)); hb_filter->add_child(filter_mode); } { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 54ba06afd80..1e83be1dcd9 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -7138,7 +7138,7 @@ EditorNode::EditorNode() { // Add the renderers name to the UI. if (current_renderer_ps == current_renderer_os) { - renderer->connect("item_selected", callable_mp(this, &EditorNode::_renderer_selected)); + renderer->connect(SceneStringName(item_selected), callable_mp(this, &EditorNode::_renderer_selected)); // As we are doing string comparisons, keep in standard case to prevent problems with capitals // "vulkan" in particular uses lowercase "v" in the code, and uppercase in the UI. PackedStringArray renderers = ProjectSettings::get_singleton()->get_custom_property_info().get(StringName("rendering/renderer/rendering_method")).hint_string.split(",", false); @@ -7299,7 +7299,7 @@ EditorNode::EditorNode() { vbox->add_child(install_android_build_template_message); choose_android_export_profile = memnew(OptionButton); - choose_android_export_profile->connect("item_selected", callable_mp(this, &EditorNode::_android_export_preset_selected)); + choose_android_export_profile->connect(SceneStringName(item_selected), callable_mp(this, &EditorNode::_android_export_preset_selected)); vbox->add_child(choose_android_export_profile); install_android_build_template = memnew(ConfirmationDialog); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 54d1e0a5139..eef8e3e5d0c 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -376,7 +376,7 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() { option_button->set_flat(true); option_button->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); default_layout->add_child(option_button); - option_button->connect("item_selected", callable_mp(this, &EditorPropertyTextEnum::_option_selected)); + option_button->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertyTextEnum::_option_selected)); edit_button = memnew(Button); edit_button->set_flat(true); @@ -735,7 +735,7 @@ EditorPropertyEnum::EditorPropertyEnum() { options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); add_child(options); add_focusable(options); - options->connect("item_selected", callable_mp(this, &EditorPropertyEnum::_option_selected)); + options->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertyEnum::_option_selected)); } ///////////////////// FLAGS ///////////////////////// diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 4266c0f69c2..04e30c56e40 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -1246,7 +1246,7 @@ ProjectExportDialog::ProjectExportDialog() { presets->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); SET_DRAG_FORWARDING_GCD(presets, ProjectExportDialog); mc->add_child(presets); - presets->connect("item_selected", callable_mp(this, &ProjectExportDialog::_edit_preset)); + presets->connect(SceneStringName(item_selected), callable_mp(this, &ProjectExportDialog::_edit_preset)); duplicate_preset = memnew(Button); duplicate_preset->set_tooltip_text(TTR("Duplicate")); duplicate_preset->set_flat(true); @@ -1328,7 +1328,7 @@ ProjectExportDialog::ProjectExportDialog() { export_filter->add_item(TTR("Export all resources in the project except resources checked below")); export_filter->add_item(TTR("Export as dedicated server")); resources_vb->add_margin_child(TTR("Export Mode:"), export_filter); - export_filter->connect("item_selected", callable_mp(this, &ProjectExportDialog::_export_type_changed)); + export_filter->connect(SceneStringName(item_selected), callable_mp(this, &ProjectExportDialog::_export_type_changed)); include_label = memnew(Label); include_label->set_text(TTR("Resources to export:")); @@ -1461,7 +1461,7 @@ ProjectExportDialog::ProjectExportDialog() { script_mode->add_item(TTR("Text (easier debugging)"), (int)EditorExportPreset::MODE_SCRIPT_TEXT); script_mode->add_item(TTR("Binary tokens (faster loading)"), (int)EditorExportPreset::MODE_SCRIPT_BINARY_TOKENS); script_mode->add_item(TTR("Compressed binary tokens (smaller files)"), (int)EditorExportPreset::MODE_SCRIPT_BINARY_TOKENS_COMPRESSED); - script_mode->connect("item_selected", callable_mp(this, &ProjectExportDialog::_script_export_mode_changed)); + script_mode->connect(SceneStringName(item_selected), callable_mp(this, &ProjectExportDialog::_script_export_mode_changed)); sections->add_child(script_vb); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 17b6eb5081b..1e55010411f 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -624,7 +624,7 @@ FindInFilesPanel::FindInFilesPanel() { _results_display = memnew(Tree); _results_display->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); _results_display->set_v_size_flags(SIZE_EXPAND_FILL); - _results_display->connect("item_selected", callable_mp(this, &FindInFilesPanel::_on_result_selected)); + _results_display->connect(SceneStringName(item_selected), callable_mp(this, &FindInFilesPanel::_on_result_selected)); _results_display->connect("item_edited", callable_mp(this, &FindInFilesPanel::_on_item_edited)); _results_display->set_hide_root(true); _results_display->set_select_mode(Tree::SELECT_ROW); diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp index 97c54e8f484..964602c72fd 100644 --- a/editor/gui/editor_file_dialog.cpp +++ b/editor/gui/editor_file_dialog.cpp @@ -1786,7 +1786,7 @@ void EditorFileDialog::_update_option_controls() { } ob->select(opt.default_idx); grid_options->add_child(ob); - ob->connect("item_selected", callable_mp(this, &EditorFileDialog::_option_changed_item_selected).bind(opt.name)); + ob->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_option_changed_item_selected).bind(opt.name)); selected_options[opt.name] = opt.default_idx; } } @@ -2173,7 +2173,7 @@ EditorFileDialog::EditorFileDialog() { pathhb->add_child(shortcuts_container); drives = memnew(OptionButton); - drives->connect("item_selected", callable_mp(this, &EditorFileDialog::_select_drive)); + drives->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_select_drive)); pathhb->add_child(drives); pathhb->add_child(memnew(VSeparator)); @@ -2225,7 +2225,7 @@ EditorFileDialog::EditorFileDialog() { favorites->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); fav_vb->add_child(favorites); favorites->set_v_size_flags(Control::SIZE_EXPAND_FILL); - favorites->connect("item_selected", callable_mp(this, &EditorFileDialog::_favorite_selected)); + favorites->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_favorite_selected)); VBoxContainer *rec_vb = memnew(VBoxContainer); vsc->add_child(rec_vb); @@ -2235,7 +2235,7 @@ EditorFileDialog::EditorFileDialog() { recent->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); recent->set_allow_reselect(true); rec_vb->add_margin_child(TTR("Recent:"), recent, true); - recent->connect("item_selected", callable_mp(this, &EditorFileDialog::_recent_selected)); + recent->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_recent_selected)); VBoxContainer *item_vb = memnew(VBoxContainer); list_hb->add_child(item_vb); @@ -2301,13 +2301,13 @@ EditorFileDialog::EditorFileDialog() { _update_drives(); connect("confirmed", callable_mp(this, &EditorFileDialog::_action_pressed)); - item_list->connect("item_selected", callable_mp(this, &EditorFileDialog::_item_selected), CONNECT_DEFERRED); + item_list->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_item_selected), CONNECT_DEFERRED); item_list->connect("multi_selected", callable_mp(this, &EditorFileDialog::_multi_selected), CONNECT_DEFERRED); item_list->connect("item_activated", callable_mp(this, &EditorFileDialog::_item_dc_selected).bind()); item_list->connect("empty_clicked", callable_mp(this, &EditorFileDialog::_items_clear_selection)); dir->connect("text_submitted", callable_mp(this, &EditorFileDialog::_dir_submitted)); file->connect("text_submitted", callable_mp(this, &EditorFileDialog::_file_submitted)); - filter->connect("item_selected", callable_mp(this, &EditorFileDialog::_filter_selected)); + filter->connect(SceneStringName(item_selected), callable_mp(this, &EditorFileDialog::_filter_selected)); confirm_save = memnew(ConfirmationDialog); add_child(confirm_save); diff --git a/editor/history_dock.cpp b/editor/history_dock.cpp index 6bbc46e76c8..5a64fba7880 100644 --- a/editor/history_dock.cpp +++ b/editor/history_dock.cpp @@ -262,5 +262,5 @@ HistoryDock::HistoryDock() { action_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); add_child(action_list); action_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); - action_list->connect("item_selected", callable_mp(this, &HistoryDock::seek_history)); + action_list->connect(SceneStringName(item_selected), callable_mp(this, &HistoryDock::seek_history)); } diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index 7f7f27343fd..d345711d9ca 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -1385,7 +1385,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { vars_list->set_column_custom_minimum_width(1, 50 * EDSCALE); vars_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); page2_side_vb->add_child(vars_list); - vars_list->connect("item_selected", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_selected)); + vars_list->connect(SceneStringName(item_selected), callable_mp(this, &DynamicFontImportSettingsDialog::_variation_selected)); vars_list->connect("button_clicked", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_remove)); inspector_vars = memnew(EditorInspector); @@ -1538,7 +1538,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { } glyphs_split->add_child(glyph_tree); glyph_tree->connect("item_activated", callable_mp(this, &DynamicFontImportSettingsDialog::_range_edited)); - glyph_tree->connect("item_selected", callable_mp(this, &DynamicFontImportSettingsDialog::_range_selected)); + glyph_tree->connect(SceneStringName(item_selected), callable_mp(this, &DynamicFontImportSettingsDialog::_range_selected)); // Common diff --git a/editor/import_defaults_editor.cpp b/editor/import_defaults_editor.cpp index ab7988109f9..31e3022f6b9 100644 --- a/editor/import_defaults_editor.cpp +++ b/editor/import_defaults_editor.cpp @@ -207,7 +207,7 @@ ImportDefaultsEditor::ImportDefaultsEditor() { importers = memnew(OptionButton); hb->add_child(importers); hb->add_spacer(); - importers->connect("item_selected", callable_mp(this, &ImportDefaultsEditor::_importer_selected)); + importers->connect(SceneStringName(item_selected), callable_mp(this, &ImportDefaultsEditor::_importer_selected)); reset_defaults = memnew(Button); reset_defaults->set_text(TTR("Reset to Defaults")); reset_defaults->set_disabled(true); diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 9dc7c43684b..5d6dc1ae0a4 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -787,7 +787,7 @@ ImportDock::ImportDock() { import_as->set_fit_to_longest_item(false); import_as->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS); import_as->set_h_size_flags(SIZE_EXPAND_FILL); - import_as->connect("item_selected", callable_mp(this, &ImportDock::_importer_selected)); + import_as->connect(SceneStringName(item_selected), callable_mp(this, &ImportDock::_importer_selected)); hb->add_child(import_as); import_as->set_h_size_flags(SIZE_EXPAND_FILL); preset = memnew(MenuButton); diff --git a/editor/input_event_configuration_dialog.cpp b/editor/input_event_configuration_dialog.cpp index f23d593fb7e..a9335b2a73b 100644 --- a/editor/input_event_configuration_dialog.cpp +++ b/editor/input_event_configuration_dialog.cpp @@ -676,7 +676,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { input_list_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); input_list_tree->set_custom_minimum_size(Size2(0, 100 * EDSCALE)); // Min height for tree input_list_tree->connect("item_activated", callable_mp(this, &InputEventConfigurationDialog::_input_list_item_activated)); - input_list_tree->connect("item_selected", callable_mp(this, &InputEventConfigurationDialog::_input_list_item_selected)); + input_list_tree->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_input_list_item_selected)); input_list_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); manual_vbox->add_child(input_list_tree); @@ -708,7 +708,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { for (int i = -1; i < 8; i++) { device_id_option->add_item(EventListenerLineEdit::get_device_string(i)); } - device_id_option->connect("item_selected", callable_mp(this, &InputEventConfigurationDialog::_device_selection_changed)); + device_id_option->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_device_selection_changed)); _set_current_device(InputMap::ALL_DEVICES); device_container->add_child(device_id_option); @@ -744,7 +744,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { key_mode->add_item(TTR("Keycode (Latin Equivalent)"), KEYMODE_KEYCODE); key_mode->add_item(TTR("Physical Keycode (Position on US QWERTY Keyboard)"), KEYMODE_PHY_KEYCODE); key_mode->add_item(TTR("Key Label (Unicode, Case-Insensitive)"), KEYMODE_UNICODE); - key_mode->connect("item_selected", callable_mp(this, &InputEventConfigurationDialog::_key_mode_selected)); + key_mode->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_key_mode_selected)); key_mode->hide(); additional_options_container->add_child(key_mode); @@ -762,7 +762,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { key_location->add_item(TTR("Any"), (int)KeyLocation::UNSPECIFIED); key_location->add_item(TTR("Left"), (int)KeyLocation::LEFT); key_location->add_item(TTR("Right"), (int)KeyLocation::RIGHT); - key_location->connect("item_selected", callable_mp(this, &InputEventConfigurationDialog::_key_location_selected)); + key_location->connect(SceneStringName(item_selected), callable_mp(this, &InputEventConfigurationDialog::_key_location_selected)); location_container->add_child(key_location); additional_options_container->add_child(location_container); diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index de031c1a57c..c4dbee973eb 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -720,7 +720,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { top_hb->add_child(memnew(Label(TTR("Blend:")))); interpolation = memnew(OptionButton); top_hb->add_child(interpolation); - interpolation->connect("item_selected", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_config_changed)); + interpolation->connect(SceneStringName(item_selected), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_config_changed)); edit_hb = memnew(HBoxContainer); top_hb->add_child(edit_hb); diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index 318e132095d..4ca776cc0ae 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -968,7 +968,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(memnew(Label(TTR("Blend:")))); interpolation = memnew(OptionButton); top_hb->add_child(interpolation); - interpolation->connect("item_selected", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed)); + interpolation->connect(SceneStringName(item_selected), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_config_changed)); edit_hb = memnew(HBoxContainer); top_hb->add_child(edit_hb); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 0a2c192ea40..e6411707e61 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -125,7 +125,7 @@ void AnimationPlayerEditor::_notification(int p_what) { onion_skinning->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &AnimationPlayerEditor::_onion_skinning_menu)); - blend_editor.next->connect(SNAME("item_selected"), callable_mp(this, &AnimationPlayerEditor::_blend_editor_next_changed)); + blend_editor.next->connect(SceneStringName(item_selected), callable_mp(this, &AnimationPlayerEditor::_blend_editor_next_changed)); get_tree()->connect(SNAME("node_removed"), callable_mp(this, &AnimationPlayerEditor::_node_removed)); @@ -2090,7 +2090,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug 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)); + animation->connect(SceneStringName(item_selected), callable_mp(this, &AnimationPlayerEditor::_animation_selected)); frame->connect(SNAME("value_changed"), callable_mp(this, &AnimationPlayerEditor::_seek_value_changed).bind(false)); scale->connect(SNAME("text_submitted"), callable_mp(this, &AnimationPlayerEditor::_scale_changed)); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 2dce0904e4b..f0f5a77288c 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1643,7 +1643,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { sort->set_h_size_flags(Control::SIZE_EXPAND_FILL); sort->set_clip_text(true); - sort->connect("item_selected", callable_mp(this, &EditorAssetLibrary::_rerun_search)); + sort->connect(SceneStringName(item_selected), callable_mp(this, &EditorAssetLibrary::_rerun_search)); search_hb2->add_child(memnew(VSeparator)); @@ -1653,7 +1653,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { search_hb2->add_child(categories); categories->set_h_size_flags(Control::SIZE_EXPAND_FILL); categories->set_clip_text(true); - categories->connect("item_selected", callable_mp(this, &EditorAssetLibrary::_rerun_search)); + categories->connect(SceneStringName(item_selected), callable_mp(this, &EditorAssetLibrary::_rerun_search)); search_hb2->add_child(memnew(VSeparator)); @@ -1662,7 +1662,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { _update_repository_options(); - repository->connect("item_selected", callable_mp(this, &EditorAssetLibrary::_repository_changed)); + repository->connect(SceneStringName(item_selected), callable_mp(this, &EditorAssetLibrary::_repository_changed)); search_hb2->add_child(repository); repository->set_h_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/plugins/control_editor_plugin.cpp b/editor/plugins/control_editor_plugin.cpp index 3479d222672..df20395ac5a 100644 --- a/editor/plugins/control_editor_plugin.cpp +++ b/editor/plugins/control_editor_plugin.cpp @@ -214,7 +214,7 @@ EditorPropertyAnchorsPreset::EditorPropertyAnchorsPreset() { options->set_flat(true); add_child(options); add_focusable(options); - options->connect("item_selected", callable_mp(this, &EditorPropertyAnchorsPreset::_option_selected)); + options->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertyAnchorsPreset::_option_selected)); } void EditorPropertySizeFlags::_set_read_only(bool p_read_only) { @@ -397,7 +397,7 @@ EditorPropertySizeFlags::EditorPropertySizeFlags() { vb->add_child(flag_presets); add_focusable(flag_presets); set_label_reference(flag_presets); - flag_presets->connect("item_selected", callable_mp(this, &EditorPropertySizeFlags::_preset_selected)); + flag_presets->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertySizeFlags::_preset_selected)); flag_options = memnew(VBoxContainer); flag_options->hide(); diff --git a/editor/plugins/plugin_config_dialog.cpp b/editor/plugins/plugin_config_dialog.cpp index fda06c3eec2..fa47e8cd3cb 100644 --- a/editor/plugins/plugin_config_dialog.cpp +++ b/editor/plugins/plugin_config_dialog.cpp @@ -335,7 +335,7 @@ PluginConfigDialog::PluginConfigDialog() { validation_panel->set_update_callback(callable_mp(this, &PluginConfigDialog::_on_required_text_changed)); validation_panel->set_accept_button(get_ok_button()); - script_option_edit->connect("item_selected", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); + script_option_edit->connect(SceneStringName(item_selected), callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); name_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); subfolder_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); script_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1)); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index f4e354ac486..8c2e0f9620a 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1759,10 +1759,10 @@ void ScriptEditor::_notification(int p_what) { EditorNode::get_singleton()->connect("scene_saved", callable_mp(this, &ScriptEditor::_scene_saved_callback)); FileSystemDock::get_singleton()->connect("files_moved", callable_mp(this, &ScriptEditor::_files_moved)); FileSystemDock::get_singleton()->connect("file_removed", callable_mp(this, &ScriptEditor::_file_removed)); - script_list->connect("item_selected", callable_mp(this, &ScriptEditor::_script_selected)); + script_list->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditor::_script_selected)); - members_overview->connect("item_selected", callable_mp(this, &ScriptEditor::_members_overview_selected)); - help_overview->connect("item_selected", callable_mp(this, &ScriptEditor::_help_overview_selected)); + members_overview->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditor::_members_overview_selected)); + help_overview->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditor::_help_overview_selected)); script_split->connect("dragged", callable_mp(this, &ScriptEditor::_split_dragged)); list_split->connect("dragged", callable_mp(this, &ScriptEditor::_split_dragged)); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 8dc398138ce..a8daec7ccbf 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -725,7 +725,7 @@ ShaderEditorPlugin::ShaderEditorPlugin() { shader_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); shader_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); vb->add_child(shader_list); - shader_list->connect("item_selected", callable_mp(this, &ShaderEditorPlugin::_shader_selected)); + shader_list->connect(SceneStringName(item_selected), callable_mp(this, &ShaderEditorPlugin::_shader_selected)); shader_list->connect("item_clicked", callable_mp(this, &ShaderEditorPlugin::_shader_list_clicked)); SET_DRAG_FORWARDING_GCD(shader_list, ShaderEditorPlugin); diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp index dac55921130..05919fb0f65 100644 --- a/editor/plugins/shader_file_editor_plugin.cpp +++ b/editor/plugins/shader_file_editor_plugin.cpp @@ -258,7 +258,7 @@ ShaderFileEditor::ShaderFileEditor() { versions = memnew(ItemList); versions->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); - versions->connect("item_selected", callable_mp(this, &ShaderFileEditor::_version_selected)); + versions->connect(SceneStringName(item_selected), callable_mp(this, &ShaderFileEditor::_version_selected)); versions->set_custom_minimum_size(Size2i(200 * EDSCALE, 0)); main_hs->add_child(versions); diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index e4eaab73250..f5ae695aa44 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -838,7 +838,7 @@ void Skeleton3DEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { update_joint_tree(); - joint_tree->connect("item_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_selection_changed)); + joint_tree->connect(SceneStringName(item_selected), callable_mp(this, &Skeleton3DEditor::_joint_tree_selection_changed)); joint_tree->connect("item_mouse_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_rmb_select)); #ifdef TOOLS_ENABLED skeleton->connect(SceneStringName(pose_updated), callable_mp(this, &Skeleton3DEditor::_draw_gizmo)); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index d1da61e5fcd..11600c86bfc 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -2091,7 +2091,7 @@ SpriteFramesEditor::SpriteFramesEditor() { split_sheet_order->add_item(TTR("Top to Bottom, Right to Left"), FRAME_ORDER_TOP_BOTTOM_RIGHT_LEFT); split_sheet_order->add_item(TTR("Bottom to Top, Left to Right"), FRAME_ORDER_BOTTOM_TOP_LEFT_RIGHT); split_sheet_order->add_item(TTR("Bottom to Top, Right to Left"), FRAME_ORDER_BOTTOM_TOP_RIGHT_LEFT); - split_sheet_order->connect("item_selected", callable_mp(this, &SpriteFramesEditor::_sheet_order_selected)); + split_sheet_order->connect(SceneStringName(item_selected), callable_mp(this, &SpriteFramesEditor::_sheet_order_selected)); split_sheet_menu_hb->add_child(split_sheet_order); Button *select_all = memnew(Button); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 799d7c757d0..c61a8715f4c 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -1138,7 +1138,7 @@ TextureRegionEditor::TextureRegionEditor() { snap_mode_button->add_item(TTR("Grid Snap"), 2); snap_mode_button->add_item(TTR("Auto Slice"), 3); snap_mode_button->select(snap_mode); - snap_mode_button->connect("item_selected", callable_mp(this, &TextureRegionEditor::_set_snap_mode)); + snap_mode_button->connect(SceneStringName(item_selected), callable_mp(this, &TextureRegionEditor::_set_snap_mode)); hb_grid = memnew(HBoxContainer); hb_tools->add_child(hb_grid); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 1fd6c3589e8..4e59b207553 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -1935,7 +1935,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito edit_type_list->set_columns(1); edit_type_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); edit_dialog_side_vb->add_child(edit_type_list); - edit_type_list->connect("item_selected", callable_mp(this, &ThemeItemEditorDialog::_edited_type_selected)); + edit_type_list->connect(SceneStringName(item_selected), callable_mp(this, &ThemeItemEditorDialog::_edited_type_selected)); edit_type_list->connect("button_clicked", callable_mp(this, &ThemeItemEditorDialog::_edited_type_button_pressed)); Label *edit_add_type_label = memnew(Label); @@ -2254,7 +2254,7 @@ ThemeTypeDialog::ThemeTypeDialog() { add_type_options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); add_type_options->set_v_size_flags(Control::SIZE_EXPAND_FILL); add_type_vb->add_child(add_type_options); - add_type_options->connect("item_selected", callable_mp(this, &ThemeTypeDialog::_add_type_options_cbk)); + add_type_options->connect(SceneStringName(item_selected), callable_mp(this, &ThemeTypeDialog::_add_type_options_cbk)); add_type_options->connect("item_activated", callable_mp(this, &ThemeTypeDialog::_add_type_dialog_activated)); add_type_confirmation = memnew(ConfirmationDialog); @@ -3441,7 +3441,7 @@ ThemeTypeEditor::ThemeTypeEditor() { theme_type_list->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS); theme_type_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); type_list_hb->add_child(theme_type_list); - theme_type_list->connect("item_selected", callable_mp(this, &ThemeTypeEditor::_list_type_selected)); + theme_type_list->connect(SceneStringName(item_selected), callable_mp(this, &ThemeTypeEditor::_list_type_selected)); 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.")); diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp index fa06c52e3ee..9fd781a530c 100644 --- a/editor/plugins/tiles/tile_map_layer_editor.cpp +++ b/editor/plugins/tiles/tile_map_layer_editor.cpp @@ -242,7 +242,7 @@ void TileMapLayerEditorTilesPlugin::_update_tile_set_sources_list() { } else { sources_list->set_current(0); } - sources_list->emit_signal(SNAME("item_selected"), sources_list->get_current()); + sources_list->emit_signal(SceneStringName(item_selected), sources_list->get_current()); } // Synchronize the lists. @@ -2405,8 +2405,8 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { sources_list->set_stretch_ratio(0.25); sources_list->set_custom_minimum_size(Size2(70, 0) * EDSCALE); sources_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); - sources_list->connect("item_selected", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_source_display).unbind(1)); - sources_list->connect("item_selected", callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::set_sources_lists_current)); + sources_list->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_source_display).unbind(1)); + sources_list->connect(SceneStringName(item_selected), callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::set_sources_lists_current)); sources_list->connect("item_activated", callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::display_tile_set_editor_panel).unbind(1)); sources_list->connect(SceneStringName(visibility_changed), callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::synchronize_sources_list).bind(sources_list, source_sort_button)); sources_list->add_user_signal(MethodInfo("sort_request")); @@ -2471,7 +2471,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() { patterns_item_list->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size)); patterns_item_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); patterns_item_list->connect(SceneStringName(gui_input), callable_mp(this, &TileMapLayerEditorTilesPlugin::_patterns_item_list_gui_input)); - patterns_item_list->connect("item_selected", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_selection_pattern_from_tileset_pattern_selection).unbind(1)); + patterns_item_list->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_selection_pattern_from_tileset_pattern_selection).unbind(1)); patterns_item_list->connect("item_activated", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_selection_pattern_from_tileset_pattern_selection).unbind(1)); patterns_item_list->connect("empty_clicked", callable_mp(this, &TileMapLayerEditorTilesPlugin::patterns_item_list_empty_clicked)); patterns_bottom_panel->add_child(patterns_item_list); @@ -3521,7 +3521,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() { terrains_tree->set_custom_minimum_size(Size2(70, 0) * EDSCALE); terrains_tree->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); terrains_tree->set_hide_root(true); - terrains_tree->connect("item_selected", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_tiles_list)); + terrains_tree->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_tiles_list)); tilemap_tab_terrains->add_child(terrains_tree); terrains_tile_list = memnew(ItemList); @@ -4444,7 +4444,7 @@ TileMapLayerEditor::TileMapLayerEditor() { layers_selection_button->set_custom_minimum_size(Size2(200, 0)); layers_selection_button->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS); layers_selection_button->set_tooltip_text(TTR("TileMap Layers")); - layers_selection_button->connect("item_selected", callable_mp(this, &TileMapLayerEditor::_layers_selection_item_selected)); + layers_selection_button->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditor::_layers_selection_item_selected)); layer_selection_hbox->add_child(layers_selection_button); select_previous_layer = memnew(Button); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 0003900ac96..1b73e0f335f 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -2595,7 +2595,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tile_data_editors_tree->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT); tile_data_editors_tree->set_h_scroll_enabled(false); tile_data_editors_tree->set_v_scroll_enabled(false); - tile_data_editors_tree->connect("item_selected", callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editors_tree_selected)); + tile_data_editors_tree->connect(SceneStringName(item_selected), callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editors_tree_selected)); tile_data_editors_popup->add_child(tile_data_editors_tree); tile_data_painting_editor_container = memnew(VBoxContainer); diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index a20bd513281..7b85831ca83 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -218,7 +218,7 @@ void TileSetEditor::_update_sources_list(int force_selected_id) { sources_list->set_current(i); sources_list->ensure_current_is_visible(); if (old_selected != to_select) { - sources_list->emit_signal(SNAME("item_selected"), sources_list->get_current()); + sources_list->emit_signal(SceneStringName(item_selected), sources_list->get_current()); } break; } @@ -229,7 +229,7 @@ void TileSetEditor::_update_sources_list(int force_selected_id) { if (sources_list->get_current() < 0 && sources_list->get_item_count() > 0) { sources_list->set_current(0); if (old_selected != int(sources_list->get_item_metadata(0))) { - sources_list->emit_signal(SNAME("item_selected"), sources_list->get_current()); + sources_list->emit_signal(SceneStringName(item_selected), sources_list->get_current()); } } @@ -861,8 +861,8 @@ TileSetEditor::TileSetEditor() { sources_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE); sources_list->set_h_size_flags(SIZE_EXPAND_FILL); sources_list->set_v_size_flags(SIZE_EXPAND_FILL); - sources_list->connect("item_selected", callable_mp(this, &TileSetEditor::_source_selected)); - sources_list->connect("item_selected", callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::set_sources_lists_current)); + sources_list->connect(SceneStringName(item_selected), callable_mp(this, &TileSetEditor::_source_selected)); + sources_list->connect(SceneStringName(item_selected), callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::set_sources_lists_current)); sources_list->connect(SceneStringName(visibility_changed), callable_mp(TilesEditorUtils::get_singleton(), &TilesEditorUtils::synchronize_sources_list).bind(sources_list, source_sort_button)); sources_list->add_user_signal(MethodInfo("sort_request")); sources_list->connect("sort_request", callable_mp(this, &TileSetEditor::_update_sources_list).bind(-1)); 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 88c117272c1..22ef779b8d9 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -562,8 +562,8 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() { scene_tiles_list->set_h_size_flags(SIZE_EXPAND_FILL); scene_tiles_list->set_v_size_flags(SIZE_EXPAND_FILL); SET_DRAG_FORWARDING_CDU(scene_tiles_list, TileSetScenesCollectionSourceEditor); - scene_tiles_list->connect("item_selected", callable_mp(this, &TileSetScenesCollectionSourceEditor::_update_tile_inspector).unbind(1)); - scene_tiles_list->connect("item_selected", callable_mp(this, &TileSetScenesCollectionSourceEditor::_update_action_buttons).unbind(1)); + scene_tiles_list->connect(SceneStringName(item_selected), callable_mp(this, &TileSetScenesCollectionSourceEditor::_update_tile_inspector).unbind(1)); + scene_tiles_list->connect(SceneStringName(item_selected), callable_mp(this, &TileSetScenesCollectionSourceEditor::_update_action_buttons).unbind(1)); scene_tiles_list->connect("item_activated", callable_mp(this, &TileSetScenesCollectionSourceEditor::_scenes_list_item_activated)); scene_tiles_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); right_vbox_container->add_child(scene_tiles_list); diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index f1cc69ce180..3213c290fd1 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -183,7 +183,7 @@ void TilesEditorUtils::synchronize_sources_list(Object *p_current_list, Object * } else { item_list->set_current(atlas_sources_lists_current); item_list->ensure_current_is_visible(); - item_list->emit_signal(SNAME("item_selected"), atlas_sources_lists_current); + item_list->emit_signal(SceneStringName(item_selected), atlas_sources_lists_current); } } } diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 3dfd2bcc04b..d1febbded7a 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -1194,7 +1194,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { unstaged_files->set_h_size_flags(Tree::SIZE_EXPAND_FILL); unstaged_files->set_v_size_flags(Tree::SIZE_EXPAND_FILL); unstaged_files->set_select_mode(Tree::SELECT_ROW); - unstaged_files->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(unstaged_files)); + unstaged_files->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(unstaged_files)); unstaged_files->connect(SNAME("item_activated"), callable_mp(this, &VersionControlEditorPlugin::_item_activated).bind(unstaged_files)); unstaged_files->connect(SNAME("button_clicked"), callable_mp(this, &VersionControlEditorPlugin::_cell_button_pressed)); unstaged_files->create_item(); @@ -1224,7 +1224,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { staged_files->set_h_size_flags(Tree::SIZE_EXPAND_FILL); staged_files->set_v_size_flags(Tree::SIZE_EXPAND_FILL); staged_files->set_select_mode(Tree::SELECT_ROW); - staged_files->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(staged_files)); + staged_files->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(staged_files)); staged_files->connect(SNAME("button_clicked"), callable_mp(this, &VersionControlEditorPlugin::_cell_button_pressed)); staged_files->connect(SNAME("item_activated"), callable_mp(this, &VersionControlEditorPlugin::_item_activated).bind(staged_files)); staged_files->create_item(); @@ -1281,7 +1281,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { commit_list_size_button->set_item_metadata(1, 20); commit_list_size_button->add_item("30"); commit_list_size_button->set_item_metadata(2, 30); - commit_list_size_button->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_set_commit_list_size)); + commit_list_size_button->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_set_commit_list_size)); commit_list_hbc->add_child(commit_list_size_button); commit_list = memnew(Tree); @@ -1294,7 +1294,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { commit_list->set_columns(2); // Commit msg, author commit_list->set_column_custom_minimum_width(0, 40); commit_list->set_column_custom_minimum_width(1, 20); - commit_list->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(commit_list)); + commit_list->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_load_diff).bind(commit_list)); version_commit_dock->add_child(commit_list); version_commit_dock->add_child(memnew(HSeparator)); @@ -1307,7 +1307,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { branch_select = memnew(OptionButton); 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(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_branch_item_selected)); branch_select->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list)); menu_bar->add_child(branch_select); @@ -1352,7 +1352,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { remote_select = memnew(OptionButton); 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(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_remote_selected)); remote_select->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list)); menu_bar->add_child(remote_select); @@ -1492,7 +1492,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { diff_view_type_select = memnew(OptionButton); diff_view_type_select->add_item(TTR("Split"), DIFF_VIEW_TYPE_SPLIT); diff_view_type_select->add_item(TTR("Unified"), DIFF_VIEW_TYPE_UNIFIED); - diff_view_type_select->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_display_diff)); + diff_view_type_select->connect(SceneStringName(item_selected), callable_mp(this, &VersionControlEditorPlugin::_display_diff)); diff_heading->add_child(diff_view_type_select); diff = memnew(RichTextLabel); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 0f98c45ac1b..c36700bda3b 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -876,7 +876,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool OptionButton *op = memnew(OptionButton); hbox->add_child(op); op->set_h_size_flags(Control::SIZE_EXPAND_FILL); - op->connect("item_selected", callable_mp(editor, &VisualShaderEditor::_set_custom_node_option).bind(p_id, i), CONNECT_DEFERRED); + op->connect(SceneStringName(item_selected), callable_mp(editor, &VisualShaderEditor::_set_custom_node_option).bind(p_id, i), CONNECT_DEFERRED); for (const String &s : dp.options) { op->add_item(s); @@ -1124,7 +1124,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool type_box->add_item(TTR("Sampler")); type_box->select(group_node->get_input_port_type(j)); type_box->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - type_box->connect("item_selected", callable_mp(editor, &VisualShaderEditor::_change_input_port_type).bind(p_id, j), CONNECT_DEFERRED); + type_box->connect(SceneStringName(item_selected), callable_mp(editor, &VisualShaderEditor::_change_input_port_type).bind(p_id, j), CONNECT_DEFERRED); LineEdit *name_box = memnew(LineEdit); hb->add_child(name_box); @@ -1188,7 +1188,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool type_box->add_item(TTR("Transform")); type_box->select(group_node->get_output_port_type(i)); type_box->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); - type_box->connect("item_selected", callable_mp(editor, &VisualShaderEditor::_change_output_port_type).bind(p_id, i), CONNECT_DEFERRED); + type_box->connect(SceneStringName(item_selected), callable_mp(editor, &VisualShaderEditor::_change_output_port_type).bind(p_id, i), CONNECT_DEFERRED); } else { Label *label = memnew(Label); label->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED); // TODO: Implement proper translation switch. @@ -6150,24 +6150,24 @@ VisualShaderEditor::VisualShaderEditor() { edit_type_standard->add_item(TTR("Fragment")); edit_type_standard->add_item(TTR("Light")); edit_type_standard->select(1); - edit_type_standard->connect("item_selected", callable_mp(this, &VisualShaderEditor::_mode_selected)); + edit_type_standard->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_mode_selected)); edit_type_particles = memnew(OptionButton); edit_type_particles->add_item(TTR("Start")); edit_type_particles->add_item(TTR("Process")); edit_type_particles->add_item(TTR("Collide")); edit_type_particles->select(0); - edit_type_particles->connect("item_selected", callable_mp(this, &VisualShaderEditor::_mode_selected)); + edit_type_particles->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_mode_selected)); edit_type_sky = memnew(OptionButton); edit_type_sky->add_item(TTR("Sky")); edit_type_sky->select(0); - edit_type_sky->connect("item_selected", callable_mp(this, &VisualShaderEditor::_mode_selected)); + edit_type_sky->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_mode_selected)); edit_type_fog = memnew(OptionButton); edit_type_fog->add_item(TTR("Fog")); edit_type_fog->select(0); - edit_type_fog->connect("item_selected", callable_mp(this, &VisualShaderEditor::_mode_selected)); + edit_type_fog->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_mode_selected)); edit_type = edit_type_standard; @@ -6300,7 +6300,7 @@ VisualShaderEditor::VisualShaderEditor() { members->set_hide_folding(false); members->set_custom_minimum_size(Size2(180 * EDSCALE, 200 * EDSCALE)); members->connect("item_activated", callable_mp(this, &VisualShaderEditor::_member_create)); - members->connect("item_selected", callable_mp(this, &VisualShaderEditor::_member_selected)); + members->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_member_selected)); members->connect("nothing_selected", callable_mp(this, &VisualShaderEditor::_member_unselected)); HBoxContainer *desc_hbox = memnew(HBoxContainer); @@ -6403,7 +6403,7 @@ VisualShaderEditor::VisualShaderEditor() { varyings->set_hide_folding(false); varyings->set_custom_minimum_size(Size2(180 * EDSCALE, 200 * EDSCALE)); varyings->connect("item_activated", callable_mp(this, &VisualShaderEditor::_varying_deleted)); - varyings->connect("item_selected", callable_mp(this, &VisualShaderEditor::_varying_selected)); + varyings->connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderEditor::_varying_selected)); varyings->connect("nothing_selected", callable_mp(this, &VisualShaderEditor::_varying_unselected)); } @@ -7133,7 +7133,7 @@ public: void _notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - connect("item_selected", callable_mp(this, &VisualShaderNodePluginInputEditor::_item_selected)); + connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderNodePluginInputEditor::_item_selected)); } break; } } @@ -7183,7 +7183,7 @@ class VisualShaderNodePluginVaryingEditor : public OptionButton { public: void _notification(int p_what) { if (p_what == NOTIFICATION_READY) { - connect("item_selected", callable_mp(this, &VisualShaderNodePluginVaryingEditor::_item_selected)); + connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderNodePluginVaryingEditor::_item_selected)); } } @@ -7262,7 +7262,7 @@ public: void _notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - connect("item_selected", callable_mp(this, &VisualShaderNodePluginParameterRefEditor::_item_selected)); + connect(SceneStringName(item_selected), callable_mp(this, &VisualShaderNodePluginParameterRefEditor::_item_selected)); } break; } } @@ -7648,7 +7648,7 @@ EditorPropertyVisualShaderMode::EditorPropertyVisualShaderMode() { options->set_clip_text(true); add_child(options); add_focusable(options); - options->connect("item_selected", callable_mp(this, &EditorPropertyVisualShaderMode::_option_selected)); + options->connect(SceneStringName(item_selected), callable_mp(this, &EditorPropertyVisualShaderMode::_option_selected)); } bool EditorInspectorVisualShaderModePlugin::can_handle(Object *p_object) { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index be979f0f150..a819fa32cef 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1253,7 +1253,7 @@ ProjectManager::ProjectManager() { filter_option->set_clip_text(true); filter_option->set_h_size_flags(Control::SIZE_EXPAND_FILL); filter_option->set_stretch_ratio(0.3); - filter_option->connect("item_selected", callable_mp(this, &ProjectManager::_on_order_option_changed)); + filter_option->connect(SceneStringName(item_selected), callable_mp(this, &ProjectManager::_on_order_option_changed)); hb->add_child(filter_option); Vector sort_filter_titles; diff --git a/editor/project_manager/quick_settings_dialog.cpp b/editor/project_manager/quick_settings_dialog.cpp index 59b329c7392..05e8523518e 100644 --- a/editor/project_manager/quick_settings_dialog.cpp +++ b/editor/project_manager/quick_settings_dialog.cpp @@ -221,7 +221,7 @@ QuickSettingsDialog::QuickSettingsDialog() { { language_option_button = memnew(OptionButton); language_option_button->set_fit_to_longest_item(false); - language_option_button->connect("item_selected", callable_mp(this, &QuickSettingsDialog::_language_selected)); + language_option_button->connect(SceneStringName(item_selected), callable_mp(this, &QuickSettingsDialog::_language_selected)); for (int i = 0; i < editor_languages.size(); i++) { const String &lang_value = editor_languages[i]; @@ -237,7 +237,7 @@ QuickSettingsDialog::QuickSettingsDialog() { { theme_option_button = memnew(OptionButton); theme_option_button->set_fit_to_longest_item(false); - theme_option_button->connect("item_selected", callable_mp(this, &QuickSettingsDialog::_theme_selected)); + theme_option_button->connect(SceneStringName(item_selected), callable_mp(this, &QuickSettingsDialog::_theme_selected)); for (int i = 0; i < editor_themes.size(); i++) { const String &theme_value = editor_themes[i]; @@ -260,7 +260,7 @@ QuickSettingsDialog::QuickSettingsDialog() { { scale_option_button = memnew(OptionButton); scale_option_button->set_fit_to_longest_item(false); - scale_option_button->connect("item_selected", callable_mp(this, &QuickSettingsDialog::_scale_selected)); + scale_option_button->connect(SceneStringName(item_selected), callable_mp(this, &QuickSettingsDialog::_scale_selected)); for (int i = 0; i < editor_scales.size(); i++) { const String &scale_value = editor_scales[i]; @@ -274,7 +274,7 @@ QuickSettingsDialog::QuickSettingsDialog() { { network_mode_option_button = memnew(OptionButton); network_mode_option_button->set_fit_to_longest_item(false); - network_mode_option_button->connect("item_selected", callable_mp(this, &QuickSettingsDialog::_network_mode_selected)); + network_mode_option_button->connect(SceneStringName(item_selected), callable_mp(this, &QuickSettingsDialog::_network_mode_selected)); for (int i = 0; i < editor_network_modes.size(); i++) { const String &network_mode_value = editor_network_modes[i]; diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 26b5797d446..208b10d0272 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -673,7 +673,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { feature_box = memnew(OptionButton); feature_box->set_custom_minimum_size(Size2(120, 0) * EDSCALE); - feature_box->connect("item_selected", callable_mp(this, &ProjectSettingsEditor::_feature_selected)); + feature_box->connect(SceneStringName(item_selected), callable_mp(this, &ProjectSettingsEditor::_feature_selected)); custom_properties->add_child(feature_box); type_box = memnew(OptionButton); diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index 9259ab13ab9..54ade75162d 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -326,8 +326,8 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) { spn_count_start->connect("value_changed", callable_mp(this, &RenameDialog::_update_preview_int)); spn_count_step->connect("value_changed", callable_mp(this, &RenameDialog::_update_preview_int)); 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)); + opt_style->connect(SceneStringName(item_selected), callable_mp(this, &RenameDialog::_update_preview_int)); + opt_case->connect(SceneStringName(item_selected), callable_mp(this, &RenameDialog::_update_preview_int)); 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("")); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 13fc5413b34..a056d531c19 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -871,7 +871,7 @@ ScriptCreateDialog::ScriptCreateDialog() { language_menu->select(default_language); } - language_menu->connect("item_selected", callable_mp(this, &ScriptCreateDialog::_language_changed)); + language_menu->connect(SceneStringName(item_selected), callable_mp(this, &ScriptCreateDialog::_language_changed)); /* Inherits */ @@ -907,7 +907,7 @@ ScriptCreateDialog::ScriptCreateDialog() { template_menu = memnew(OptionButton); template_menu->set_h_size_flags(Control::SIZE_EXPAND_FILL); - template_menu->connect("item_selected", callable_mp(this, &ScriptCreateDialog::_template_changed)); + template_menu->connect(SceneStringName(item_selected), callable_mp(this, &ScriptCreateDialog::_template_changed)); template_hb->add_child(template_menu); gc->add_child(template_hb); diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp index 6657aa61210..49e057eb6fd 100644 --- a/editor/shader_create_dialog.cpp +++ b/editor/shader_create_dialog.cpp @@ -606,7 +606,7 @@ ShaderCreateDialog::ShaderCreateDialog() { type_menu->select(default_type); } current_type = default_type; - type_menu->connect("item_selected", callable_mp(this, &ShaderCreateDialog::_type_changed)); + type_menu->connect(SceneStringName(item_selected), callable_mp(this, &ShaderCreateDialog::_type_changed)); // Modes. @@ -616,14 +616,14 @@ ShaderCreateDialog::ShaderCreateDialog() { } gc->add_child(memnew(Label(TTR("Mode:")))); gc->add_child(mode_menu); - mode_menu->connect("item_selected", callable_mp(this, &ShaderCreateDialog::_mode_changed)); + mode_menu->connect(SceneStringName(item_selected), callable_mp(this, &ShaderCreateDialog::_mode_changed)); // Templates. template_menu = memnew(OptionButton); gc->add_child(memnew(Label(TTR("Template:")))); gc->add_child(template_menu); - template_menu->connect("item_selected", callable_mp(this, &ShaderCreateDialog::_template_changed)); + template_menu->connect(SceneStringName(item_selected), callable_mp(this, &ShaderCreateDialog::_template_changed)); // Built-in Shader. diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index 226cb48eb8e..ff7800b4f39 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -1069,7 +1069,7 @@ void GridMapEditor::_update_theme() { void GridMapEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - mesh_library_palette->connect("item_selected", callable_mp(this, &GridMapEditor::_item_selected_cbk)); + mesh_library_palette->connect(SceneStringName(item_selected), callable_mp(this, &GridMapEditor::_item_selected_cbk)); for (int i = 0; i < 3; i++) { grid[i] = RS::get_singleton()->mesh_create(); grid_instance[i] = RS::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world_3d()->get_scenario()); 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 28b875a4ade..604421c6b44 100644 --- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp +++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp @@ -351,18 +351,18 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor() transition_from->add_item(TTR("Next Bar"), AudioStreamInteractive::TRANSITION_FROM_TIME_NEXT_BAR); transition_from->add_item(TTR("Clip End"), AudioStreamInteractive::TRANSITION_FROM_TIME_END); - transition_from->connect("item_selected", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); + transition_from->connect(SceneStringName(item_selected), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); transition_to = memnew(OptionButton); edit_vb->add_margin_child(TTR("Transition To:"), transition_to); transition_to->add_item(TTR("Same Position"), AudioStreamInteractive::TRANSITION_TO_TIME_SAME_POSITION); transition_to->add_item(TTR("Clip Start"), AudioStreamInteractive::TRANSITION_TO_TIME_START); transition_to->add_item(TTR("Prev Position"), AudioStreamInteractive::TRANSITION_TO_TIME_PREVIOUS_POSITION); - transition_to->connect("item_selected", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); + transition_to->connect(SceneStringName(item_selected), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); fade_mode = memnew(OptionButton); edit_vb->add_margin_child(TTR("Fade Mode:"), fade_mode); - fade_mode->connect("item_selected", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); + fade_mode->connect(SceneStringName(item_selected), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); fade_beats = memnew(SpinBox); edit_vb->add_margin_child(TTR("Fade Beats:"), fade_beats); @@ -373,7 +373,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor() filler_clip = memnew(OptionButton); edit_vb->add_margin_child(TTR("Filler Clip:"), filler_clip); filler_clip->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); - filler_clip->connect("item_selected", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); + filler_clip->connect(SceneStringName(item_selected), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1)); hold_previous = memnew(CheckBox); hold_previous->set_text(TTR("Enabled")); diff --git a/modules/openxr/editor/openxr_action_editor.cpp b/modules/openxr/editor/openxr_action_editor.cpp index 06d2e8dcc9c..31ef1f08a59 100644 --- a/modules/openxr/editor/openxr_action_editor.cpp +++ b/modules/openxr/editor/openxr_action_editor.cpp @@ -152,7 +152,7 @@ OpenXRActionEditor::OpenXRActionEditor(Ref p_action) { action_type_button->add_item("Haptic", OpenXRAction::OPENXR_ACTION_HAPTIC); action_type_button->select(int(action->get_action_type())); action_type_button->set_custom_minimum_size(Size2(100.0, 0.0)); - action_type_button->connect("item_selected", callable_mp(this, &OpenXRActionEditor::_on_item_selected)); + action_type_button->connect(SceneStringName(item_selected), callable_mp(this, &OpenXRActionEditor::_on_item_selected)); add_child(action_type_button); // maybe add dropdown to edit our toplevel paths, or do we deduce them from our suggested bindings? diff --git a/modules/openxr/editor/openxr_select_runtime.cpp b/modules/openxr/editor/openxr_select_runtime.cpp index f6aa157907d..026797c6e01 100644 --- a/modules/openxr/editor/openxr_select_runtime.cpp +++ b/modules/openxr/editor/openxr_select_runtime.cpp @@ -98,11 +98,11 @@ void OpenXRSelectRuntime::_notification(int p_notification) { _update_items(); // Connect signal - connect("item_selected", callable_mp(this, &OpenXRSelectRuntime::_item_selected)); + connect(SceneStringName(item_selected), callable_mp(this, &OpenXRSelectRuntime::_item_selected)); } break; case NOTIFICATION_EXIT_TREE: { // Disconnect signal - disconnect("item_selected", callable_mp(this, &OpenXRSelectRuntime::_item_selected)); + disconnect(SceneStringName(item_selected), callable_mp(this, &OpenXRSelectRuntime::_item_selected)); } break; } } diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index a23ee6db717..0818387b727 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -1152,7 +1152,7 @@ void FileDialog::_update_option_controls() { } ob->select(opt.default_idx); grid_options->add_child(ob); - ob->connect("item_selected", callable_mp(this, &FileDialog::_option_changed_item_selected).bind(opt.name)); + ob->connect(SceneStringName(item_selected), callable_mp(this, &FileDialog::_option_changed_item_selected).bind(opt.name)); selected_options[opt.name] = opt.default_idx; } } @@ -1421,7 +1421,7 @@ FileDialog::FileDialog() { hbc->add_child(drives_container); drives = memnew(OptionButton); - drives->connect("item_selected", callable_mp(this, &FileDialog::_select_drive)); + drives->connect(SceneStringName(item_selected), callable_mp(this, &FileDialog::_select_drive)); hbc->add_child(drives); dir = memnew(LineEdit); @@ -1493,7 +1493,7 @@ FileDialog::FileDialog() { tree->connect("nothing_selected", callable_mp(this, &FileDialog::deselect_all)); dir->connect("text_submitted", callable_mp(this, &FileDialog::_dir_submitted)); file->connect("text_submitted", callable_mp(this, &FileDialog::_file_submitted)); - filter->connect("item_selected", callable_mp(this, &FileDialog::_filter_selected)); + filter->connect(SceneStringName(item_selected), callable_mp(this, &FileDialog::_filter_selected)); confirm_save = memnew(ConfirmationDialog); add_child(confirm_save, false, INTERNAL_MODE_FRONT); diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 40c694184c0..c6a2dd1e108 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -733,7 +733,7 @@ void ItemList::gui_input(const Ref &p_event) { select(i, select_mode == SELECT_SINGLE || !mb->is_command_or_control_pressed()); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), i); + emit_signal(SceneStringName(item_selected), i); } else { emit_signal(SNAME("multi_selected"), i, true); } @@ -775,7 +775,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(i); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } break; @@ -798,7 +798,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(next); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); } @@ -813,7 +813,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(i); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } break; } @@ -835,7 +835,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(next); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); } @@ -848,7 +848,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(index); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); break; @@ -863,7 +863,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(index); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); @@ -886,7 +886,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(next); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); } @@ -906,7 +906,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(next); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } accept_event(); } @@ -962,7 +962,7 @@ void ItemList::gui_input(const Ref &p_event) { set_current(i); ensure_current_is_visible(); if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } break; } diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 68e72ea9961..da15b44bdc8 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -395,7 +395,7 @@ void OptionButton::_select(int p_which, bool p_emit) { } if (is_inside_tree() && p_emit) { - emit_signal(SNAME("item_selected"), current); + emit_signal(SceneStringName(item_selected), current); } } diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 56be6b90a28..3f0e8a8955c 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2693,7 +2693,7 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c c.selected = true; selected_item = p_selected; if (!emitted_row) { - emit_signal(SNAME("item_selected")); + emit_signal(SceneStringName(item_selected)); emitted_row = true; } } else if (c.selected) { @@ -2717,7 +2717,7 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c if (select_mode == SELECT_MULTI) { emit_signal(SNAME("multi_selected"), p_current, i, true); } else if (select_mode == SELECT_SINGLE) { - emit_signal(SNAME("item_selected")); + emit_signal(SceneStringName(item_selected)); } } else if (select_mode == SELECT_MULTI && (selected_item != p_selected || selected_col != i)) { diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index 6a05aa78daf..aa1d0ef27dc 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -134,4 +134,6 @@ SceneStringNames::SceneStringNames() { id_pressed = StaticCString::create("id_pressed"); panel = StaticCString::create("panel"); + + item_selected = StaticCString::create("item_selected"); } diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index db11ec36a3e..beb024191de 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -147,6 +147,8 @@ public: StringName id_pressed; StringName panel; + + StringName item_selected; }; #define SceneStringName(m_name) SceneStringNames::get_singleton()->m_name