From 413c11357d039a03a8dca440a01951a637ae936b Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 13 May 2024 16:56:03 +0200 Subject: [PATCH] Use Core/Scene stringnames consistently --- core/config/project_settings.cpp | 1 - core/io/marshalls.cpp | 1 - core/io/packed_data_container.cpp | 1 - core/io/resource.cpp | 1 - core/object/class_db.cpp | 1 - core/object/message_queue.cpp | 1 - core/object/object.cpp | 1 - core/object/script_language.cpp | 1 - core/register_core_types.cpp | 1 - core/variant/variant.cpp | 1 - core/variant/variant.h | 1 + core/variant/variant_call.cpp | 1 - core/variant/variant_construct.h | 1 - core/variant/variant_op.h | 1 - core/variant/variant_setget.h | 1 - core/variant/variant_utility.cpp | 1 - editor/action_map_editor.cpp | 1 - editor/animation_bezier_editor.cpp | 2 +- editor/animation_track_editor.cpp | 19 +- editor/code_editor.cpp | 8 +- editor/connections_dialog.cpp | 2 +- editor/create_dialog.cpp | 2 +- .../debugger/editor_performance_profiler.cpp | 8 +- editor/debugger/editor_profiler.cpp | 6 +- editor/debugger/editor_visual_profiler.cpp | 6 +- editor/editor_about.cpp | 8 +- editor/editor_audio_buses.cpp | 8 +- editor/editor_autoload_settings.cpp | 8 +- editor/editor_command_palette.cpp | 2 +- editor/editor_data.cpp | 4 +- editor/editor_dock_manager.cpp | 16 +- editor/editor_help.cpp | 14 +- editor/editor_help_search.cpp | 2 +- editor/editor_inspector.cpp | 18 +- editor/editor_layouts_dialog.cpp | 4 +- ...editor_native_shader_source_visualizer.cpp | 5 +- editor/editor_node.cpp | 2 +- editor/editor_properties.cpp | 15 +- editor/editor_properties_array_dict.cpp | 4 +- editor/editor_quick_open.cpp | 2 +- editor/editor_resource_picker.cpp | 10 +- editor/editor_settings_dialog.cpp | 4 +- editor/event_listener_line_edit.cpp | 4 +- editor/filesystem_dock.cpp | 8 +- editor/find_in_files.cpp | 11 +- editor/group_settings_editor.cpp | 16 +- editor/groups_editor.cpp | 7 +- editor/gui/editor_scene_tabs.cpp | 6 +- editor/gui/editor_spin_slider.cpp | 18 +- editor/gui/editor_toaster.cpp | 8 +- editor/gui/scene_tree_editor.cpp | 24 +-- editor/import/3d/resource_importer_scene.cpp | 6 +- editor/import/3d/scene_import_settings.cpp | 6 +- .../import/audio_stream_import_settings.cpp | 10 +- editor/import_dock.cpp | 4 +- editor/input_event_configuration_dialog.cpp | 4 +- editor/node_dock.cpp | 4 +- .../animation_blend_space_1d_editor.cpp | 4 +- .../animation_blend_space_2d_editor.cpp | 4 +- .../animation_blend_tree_editor_plugin.cpp | 2 +- .../animation_player_editor_plugin.cpp | 7 +- .../animation_state_machine_editor.cpp | 13 +- .../plugins/animation_tree_editor_plugin.cpp | 1 - .../plugins/asset_library_editor_plugin.cpp | 4 +- editor/plugins/audio_stream_editor_plugin.cpp | 8 +- editor/plugins/canvas_item_editor_plugin.cpp | 18 +- .../collision_shape_2d_editor_plugin.cpp | 1 - editor/plugins/editor_debugger_plugin.cpp | 4 +- editor/plugins/gradient_editor_plugin.cpp | 2 +- .../mesh_instance_3d_editor_plugin.cpp | 3 +- .../navigation_obstacle_3d_editor_plugin.cpp | 1 - .../navigation_polygon_editor_plugin.cpp | 4 +- editor/plugins/node_3d_editor_plugin.cpp | 46 ++--- editor/plugins/packed_scene_editor_plugin.cpp | 1 - ...article_process_material_editor_plugin.cpp | 8 +- editor/plugins/path_2d_editor_plugin.cpp | 8 +- editor/plugins/path_3d_editor_plugin.cpp | 8 +- editor/plugins/polygon_2d_editor_plugin.cpp | 6 +- editor/plugins/script_editor_plugin.cpp | 9 +- editor/plugins/script_text_editor.cpp | 2 +- editor/plugins/skeleton_3d_editor_plugin.cpp | 1 - editor/plugins/sprite_2d_editor_plugin.cpp | 4 +- .../plugins/sprite_frames_editor_plugin.cpp | 24 +-- editor/plugins/text_editor.cpp | 2 +- editor/plugins/text_shader_editor.cpp | 6 +- editor/plugins/texture_3d_editor_plugin.cpp | 2 +- .../plugins/texture_layered_editor_plugin.cpp | 2 +- .../plugins/texture_region_editor_plugin.cpp | 16 +- editor/plugins/theme_editor_plugin.cpp | 16 +- editor/plugins/theme_editor_preview.cpp | 8 +- editor/plugins/tiles/tile_atlas_view.cpp | 20 +- editor/plugins/tiles/tile_data_editors.cpp | 4 +- .../plugins/tiles/tile_map_layer_editor.cpp | 38 ++-- .../tiles/tile_set_atlas_source_editor.cpp | 45 +++-- editor/plugins/tiles/tile_set_editor.cpp | 4 +- ...le_set_scenes_collection_source_editor.cpp | 18 +- editor/plugins/tiles/tiles_editor_plugin.cpp | 8 +- .../plugins/version_control_editor_plugin.cpp | 2 +- .../plugins/visual_shader_editor_plugin.cpp | 28 +-- editor/project_manager.cpp | 2 +- editor/project_manager/project_list.cpp | 2 +- editor/property_selector.cpp | 2 +- editor/rename_dialog.cpp | 16 +- editor/scene_tree_dock.cpp | 6 +- editor/script_create_dialog.cpp | 2 +- editor/shader_create_dialog.cpp | 2 +- editor/surface_upgrade_tool.cpp | 1 - editor/themes/editor_theme_manager.cpp | 4 +- editor/window_wrapper.cpp | 2 +- main/main.cpp | 1 - modules/csg/csg_shape.cpp | 6 +- modules/gdscript/gdscript.cpp | 5 +- modules/gdscript/gdscript_analyzer.cpp | 1 - modules/gdscript/gdscript_compiler.cpp | 5 +- modules/gdscript/gdscript_vm.cpp | 1 - .../gdscript/tests/gdscript_test_runner.cpp | 1 - .../editor_scene_exporter_gltf_settings.cpp | 8 +- .../gridmap/editor/grid_map_editor_plugin.cpp | 9 +- modules/gridmap/grid_map.cpp | 2 - ...audio_stream_interactive_editor_plugin.cpp | 4 +- modules/multiplayer/multiplayer_spawner.cpp | 1 - .../multiplayer/multiplayer_synchronizer.cpp | 2 +- modules/multiplayer/scene_cache_interface.cpp | 1 - .../scene_replication_interface.cpp | 5 +- modules/webxr/webxr_interface_js.cpp | 3 +- scene/2d/animated_sprite_2d.cpp | 9 +- scene/2d/audio_stream_player_2d.cpp | 1 - scene/2d/cpu_particles_2d.cpp | 1 - scene/2d/gpu_particles_2d.cpp | 1 - scene/2d/mesh_instance_2d.cpp | 2 - scene/2d/multimesh_instance_2d.cpp | 2 - scene/2d/navigation_agent_2d.cpp | 2 +- scene/2d/physics/area_2d.cpp | 1 - scene/2d/physics/collision_object_2d.cpp | 1 - scene/2d/physics/joints/joint_2d.cpp | 1 - scene/2d/physics/rigid_body_2d.cpp | 2 - scene/2d/sprite_2d.cpp | 1 - scene/2d/tile_map.cpp | 1 - scene/2d/tile_map_layer.cpp | 1 - scene/2d/touch_screen_button.cpp | 11 +- scene/2d/visible_on_screen_notifier_2d.cpp | 2 - scene/3d/bone_attachment_3d.cpp | 4 +- scene/3d/cpu_particles_3d.cpp | 1 - scene/3d/gpu_particles_3d.cpp | 1 - scene/3d/label_3d.cpp | 1 - scene/3d/navigation_agent_3d.cpp | 2 +- scene/3d/node_3d.cpp | 1 - scene/3d/physical_bone_simulator_3d.cpp | 8 +- scene/3d/physics/area_3d.cpp | 1 - scene/3d/physics/area_3d.h | 1 - scene/3d/physics/collision_object_3d.cpp | 1 - .../3d/physics/joints/cone_twist_joint_3d.cpp | 2 - scene/3d/physics/joints/joint_3d.cpp | 2 - scene/3d/physics/joints/slider_joint_3d.cpp | 2 - scene/3d/physics/rigid_body_3d.cpp | 2 - scene/3d/skeleton_3d.cpp | 1 - scene/3d/sprite_3d.cpp | 13 +- scene/3d/visible_on_screen_notifier_3d.cpp | 2 - scene/3d/visual_instance_3d.cpp | 3 - scene/3d/voxel_gi.cpp | 1 - scene/animation/animation_blend_tree.cpp | 5 +- scene/animation/animation_mixer.cpp | 5 +- scene/animation/animation_player.cpp | 3 +- scene/animation/animation_tree.cpp | 1 - scene/animation/tween.cpp | 10 +- scene/audio/audio_stream_player_internal.cpp | 3 +- scene/gui/base_button.cpp | 1 - scene/gui/color_picker.cpp | 38 ++-- scene/gui/container.cpp | 14 +- scene/gui/control.cpp | 7 +- scene/gui/dialogs.cpp | 12 +- scene/gui/graph_edit.cpp | 20 +- scene/gui/item_list.cpp | 2 +- scene/gui/line_edit.cpp | 4 +- scene/gui/nine_patch_rect.cpp | 1 - scene/gui/popup.cpp | 8 +- scene/gui/popup_menu.cpp | 2 +- scene/gui/range.cpp | 2 +- scene/gui/rich_text_label.cpp | 3 +- scene/gui/scroll_bar.cpp | 18 +- scene/gui/spin_box.cpp | 6 +- scene/gui/tab_bar.cpp | 2 +- scene/gui/tab_container.cpp | 6 +- scene/gui/tree.cpp | 2 +- scene/gui/video_stream_player.cpp | 1 - scene/main/canvas_item.cpp | 1 - scene/main/canvas_layer.cpp | 2 +- scene/main/node.cpp | 2 - scene/main/node.h | 1 + scene/main/scene_tree.cpp | 3 +- scene/main/shader_globals_override.cpp | 1 - scene/main/viewport.cpp | 5 +- scene/main/window.cpp | 5 +- scene/register_scene_types.cpp | 1 - scene/resources/2d/tile_set.cpp | 54 +++--- scene/resources/3d/world_3d.cpp | 1 - scene/resources/animation.cpp | 1 - scene/resources/animation_library.cpp | 4 +- scene/resources/atlas_texture.cpp | 2 - scene/resources/curve_texture.cpp | 2 - scene/resources/gradient_texture.cpp | 1 - scene/resources/material.cpp | 1 - scene/resources/packed_scene.cpp | 1 - scene/resources/shader.cpp | 1 - scene/resources/visual_shader.cpp | 2 +- scene/scene_string_names.cpp | 5 - scene/scene_string_names.h | 5 - scene/theme/default_theme.cpp | 5 +- scene/theme/theme_db.cpp | 6 +- scene/theme/theme_owner.cpp | 12 +- servers/audio/audio_stream.cpp | 10 +- tests/core/input/test_input_event.h | 4 +- tests/core/object/test_object.h | 1 - tests/scene/test_viewport.h | 174 +++++++++--------- 214 files changed, 650 insertions(+), 765 deletions(-) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index a116c9c2705..91d2f5d0c06 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -31,7 +31,6 @@ #include "project_settings.h" #include "core/core_bind.h" // For Compression enum. -#include "core/core_string_names.h" #include "core/input/input_map.h" #include "core/io/config_file.h" #include "core/io/dir_access.h" diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 1928f86d6a8..c0d18d01207 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -30,7 +30,6 @@ #include "marshalls.h" -#include "core/core_string_names.h" #include "core/io/resource_loader.h" #include "core/object/ref_counted.h" #include "core/object/script_language.h" diff --git a/core/io/packed_data_container.cpp b/core/io/packed_data_container.cpp index b20279c9ace..ca236ce05c7 100644 --- a/core/io/packed_data_container.cpp +++ b/core/io/packed_data_container.cpp @@ -30,7 +30,6 @@ #include "packed_data_container.h" -#include "core/core_string_names.h" #include "core/io/marshalls.h" Variant PackedDataContainer::getvar(const Variant &p_key, bool *r_valid) const { diff --git a/core/io/resource.cpp b/core/io/resource.cpp index 24ff0e83d2b..573692f41e4 100644 --- a/core/io/resource.cpp +++ b/core/io/resource.cpp @@ -30,7 +30,6 @@ #include "resource.h" -#include "core/core_string_names.h" #include "core/io/file_access.h" #include "core/io/resource_loader.h" #include "core/math/math_funcs.h" diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 7ea26c3fc56..e25703b93fb 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -31,7 +31,6 @@ #include "class_db.h" #include "core/config/engine.h" -#include "core/core_string_names.h" #include "core/io/resource_loader.h" #include "core/object/script_language.h" #include "core/os/mutex.h" diff --git a/core/object/message_queue.cpp b/core/object/message_queue.cpp index 6fab934395b..062c3fc702b 100644 --- a/core/object/message_queue.cpp +++ b/core/object/message_queue.cpp @@ -31,7 +31,6 @@ #include "message_queue.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "core/object/class_db.h" #include "core/object/script_language.h" diff --git a/core/object/object.cpp b/core/object/object.cpp index 57f8766509b..303624e6d77 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -31,7 +31,6 @@ #include "object.h" #include "object.compat.inc" -#include "core/core_string_names.h" #include "core/extension/gdextension_manager.h" #include "core/io/resource.h" #include "core/object/class_db.h" diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index 820296e66d0..eb7d560a5d5 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -31,7 +31,6 @@ #include "script_language.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/debugger/script_debugger.h" #include "core/io/resource_loader.h" diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 4c1ed8a69a8..8a55e4de8f1 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -33,7 +33,6 @@ #include "core/config/engine.h" #include "core/config/project_settings.h" #include "core/core_bind.h" -#include "core/core_string_names.h" #include "core/crypto/aes_context.h" #include "core/crypto/crypto.h" #include "core/crypto/hashing_context.h" diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 8be00b13588..30a8facd67c 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -30,7 +30,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/io/json.h" #include "core/io/marshalls.h" diff --git a/core/variant/variant.h b/core/variant/variant.h index 821edcfedf4..64943137225 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -31,6 +31,7 @@ #ifndef VARIANT_H #define VARIANT_H +#include "core/core_string_names.h" #include "core/input/input_enums.h" #include "core/io/ip_address.h" #include "core/math/aabb.h" diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 9b7777f480f..099653f9386 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -30,7 +30,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/crypto/crypto_core.h" #include "core/debugger/engine_debugger.h" #include "core/io/compression.h" diff --git a/core/variant/variant_construct.h b/core/variant/variant_construct.h index 82995620aa7..b824044b82d 100644 --- a/core/variant/variant_construct.h +++ b/core/variant/variant_construct.h @@ -33,7 +33,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/crypto/crypto_core.h" #include "core/debugger/engine_debugger.h" #include "core/io/compression.h" diff --git a/core/variant/variant_op.h b/core/variant/variant_op.h index 3142f49fc68..0b94d79a97b 100644 --- a/core/variant/variant_op.h +++ b/core/variant/variant_op.h @@ -33,7 +33,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/object/class_db.h" diff --git a/core/variant/variant_setget.h b/core/variant/variant_setget.h index 176967344f9..cdacbad3739 100644 --- a/core/variant/variant_setget.h +++ b/core/variant/variant_setget.h @@ -33,7 +33,6 @@ #include "variant.h" -#include "core/core_string_names.h" #include "core/debugger/engine_debugger.h" #include "core/object/class_db.h" #include "core/templates/local_vector.h" diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp index 5522b5ba881..7534a154a1c 100644 --- a/core/variant/variant_utility.cpp +++ b/core/variant/variant_utility.cpp @@ -30,7 +30,6 @@ #include "variant_utility.h" -#include "core/core_string_names.h" #include "core/io/marshalls.h" #include "core/object/ref_counted.h" #include "core/os/os.h" diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index a949899ac45..bc3db3f7fac 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -38,7 +38,6 @@ #include "scene/gui/check_button.h" #include "scene/gui/separator.h" #include "scene/gui/tree.h" -#include "scene/scene_string_names.h" static bool _is_action_name_valid(const String &p_name) { const char32_t *cstr = p_name.get_data(); diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index af4b759c7a3..baec996016b 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -1939,7 +1939,7 @@ AnimationBezierTrackEdit::AnimationBezierTrackEdit() { play_position->set_mouse_filter(MOUSE_FILTER_PASS); add_child(play_position); play_position->set_anchors_and_offsets_preset(PRESET_FULL_RECT); - play_position->connect("draw", callable_mp(this, &AnimationBezierTrackEdit::_play_position_draw)); + play_position->connect(SceneStringName(draw), callable_mp(this, &AnimationBezierTrackEdit::_play_position_draw)); set_focus_mode(FOCUS_CLICK); set_clip_contents(true); diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 28aef2789b5..e6de641d3c4 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -55,7 +55,6 @@ #include "scene/gui/texture_rect.h" #include "scene/gui/view_panner.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" #include "servers/audio/audio_stream.h" void AnimationTrackKeyEdit::_bind_methods() { @@ -1896,7 +1895,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() { play_position->set_mouse_filter(MOUSE_FILTER_PASS); add_child(play_position); play_position->set_anchors_and_offsets_preset(PRESET_FULL_RECT); - play_position->connect("draw", callable_mp(this, &AnimationTimelineEdit::_play_position_draw)); + play_position->connect(SceneStringName(draw), callable_mp(this, &AnimationTimelineEdit::_play_position_draw)); add_track = memnew(MenuButton); add_track->set_position(Vector2(0, 0)); @@ -2962,7 +2961,7 @@ void AnimationTrackEdit::gui_input(const Ref &p_event) { } path->set_text(animation->track_get_path(track)); - Vector2 theme_ofs = path->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))->get_offset(); + Vector2 theme_ofs = path->get_theme_stylebox(CoreStringName(normal), SNAME("LineEdit"))->get_offset(); path_popup->set_position(get_screen_position() + path_rect.position - theme_ofs); path_popup->set_size(path_rect.size); path_popup->popup(); @@ -3363,7 +3362,7 @@ AnimationTrackEdit::AnimationTrackEdit() { play_position->set_mouse_filter(MOUSE_FILTER_PASS); add_child(play_position); play_position->set_anchors_and_offsets_preset(PRESET_FULL_RECT); - play_position->connect("draw", callable_mp(this, &AnimationTrackEdit::_play_position_draw)); + play_position->connect(SceneStringName(draw), callable_mp(this, &AnimationTrackEdit::_play_position_draw)); set_focus_mode(FOCUS_CLICK); set_mouse_filter(MOUSE_FILTER_PASS); // Scroll has to work too for selection. } @@ -3586,13 +3585,13 @@ void AnimationTrackEditor::_root_removed() { void AnimationTrackEditor::set_root(Node *p_root) { if (root) { - root->disconnect("tree_exiting", callable_mp(this, &AnimationTrackEditor::_root_removed)); + root->disconnect(SceneStringName(tree_exiting), callable_mp(this, &AnimationTrackEditor::_root_removed)); } root = p_root; if (root) { - root->connect("tree_exiting", callable_mp(this, &AnimationTrackEditor::_root_removed), CONNECT_ONE_SHOT); + root->connect(SceneStringName(tree_exiting), callable_mp(this, &AnimationTrackEditor::_root_removed), CONNECT_ONE_SHOT); } _update_tracks(); @@ -7195,8 +7194,8 @@ AnimationTrackEditor::AnimationTrackEditor() { scroll->remove_child(sb); timeline_scroll->add_child(sb); // Move here so timeline and tracks are always aligned. scroll->set_focus_mode(FOCUS_CLICK); - scroll->connect("gui_input", callable_mp(this, &AnimationTrackEditor::_scroll_input)); - scroll->connect("focus_exited", callable_mp(panner.ptr(), &ViewPanner::release_pan_key)); + scroll->connect(SceneStringName(gui_input), callable_mp(this, &AnimationTrackEditor::_scroll_input)); + scroll->connect(SceneStringName(focus_exited), callable_mp(panner.ptr(), &ViewPanner::release_pan_key)); bezier_edit = memnew(AnimationBezierTrackEdit); timeline_vbox->add_child(bezier_edit); @@ -7373,7 +7372,7 @@ AnimationTrackEditor::AnimationTrackEditor() { pick_track->set_title(TTR("Pick a node to animate:")); pick_track->connect("selected", callable_mp(this, &AnimationTrackEditor::_new_track_node_selected)); pick_track->get_filter_line_edit()->connect("text_changed", callable_mp(this, &AnimationTrackEditor::_pick_track_filter_text_changed)); - pick_track->get_filter_line_edit()->connect("gui_input", callable_mp(this, &AnimationTrackEditor::_pick_track_filter_input)); + pick_track->get_filter_line_edit()->connect(SceneStringName(gui_input), callable_mp(this, &AnimationTrackEditor::_pick_track_filter_input)); prop_selector = memnew(PropertySelector); add_child(prop_selector); @@ -7406,7 +7405,7 @@ AnimationTrackEditor::AnimationTrackEditor() { box_selection->set_as_top_level(true); box_selection->set_mouse_filter(MOUSE_FILTER_IGNORE); box_selection->hide(); - box_selection->connect("draw", callable_mp(this, &AnimationTrackEditor::_box_selection_draw)); + box_selection->connect(SceneStringName(draw), callable_mp(this, &AnimationTrackEditor::_box_selection_draw)); // Default Plugins. diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 9755ff5a5e5..10b8a819923 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -709,7 +709,7 @@ FindReplaceBar::FindReplaceBar() { search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); search_text->connect("text_changed", callable_mp(this, &FindReplaceBar::_search_text_changed)); search_text->connect("text_submitted", callable_mp(this, &FindReplaceBar::_search_text_submitted)); - search_text->connect("focus_exited", callable_mp(this, &FindReplaceBar::_focus_lost)); + search_text->connect(SceneStringName(focus_exited), callable_mp(this, &FindReplaceBar::_focus_lost)); matches_label = memnew(Label); hbc_button_search->add_child(matches_label); @@ -748,7 +748,7 @@ FindReplaceBar::FindReplaceBar() { replace_text->set_tooltip_text(TTR("Replace")); replace_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); replace_text->connect("text_submitted", callable_mp(this, &FindReplaceBar::_replace_text_submitted)); - replace_text->connect("focus_exited", callable_mp(this, &FindReplaceBar::_focus_lost)); + replace_text->connect(SceneStringName(focus_exited), callable_mp(this, &FindReplaceBar::_focus_lost)); replace = memnew(Button); hbc_button_replace->add_child(replace); @@ -1727,7 +1727,7 @@ CodeTextEditor::CodeTextEditor() { scroll->add_child(error); error->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER); error->set_mouse_filter(MOUSE_FILTER_STOP); - error->connect("gui_input", callable_mp(this, &CodeTextEditor::_error_pressed)); + error->connect(SceneStringName(gui_input), callable_mp(this, &CodeTextEditor::_error_pressed)); // Errors error_button = memnew(Button); @@ -1788,7 +1788,7 @@ CodeTextEditor::CodeTextEditor() { indentation_txt->set_tooltip_text(TTR("Indentation")); indentation_txt->set_mouse_filter(MOUSE_FILTER_STOP); - text_editor->connect("gui_input", callable_mp(this, &CodeTextEditor::_text_editor_gui_input)); + text_editor->connect(SceneStringName(gui_input), callable_mp(this, &CodeTextEditor::_text_editor_gui_input)); text_editor->connect("caret_changed", callable_mp(this, &CodeTextEditor::_line_col_changed)); text_editor->connect("text_changed", callable_mp(this, &CodeTextEditor::_text_changed)); text_editor->connect("code_completion_requested", callable_mp(this, &CodeTextEditor::_complete_request)); diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 478067629e7..187e6b7298c 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -1622,7 +1622,7 @@ ConnectionsDock::ConnectionsDock() { connect_dialog->connect("connected", callable_mp(this, &ConnectionsDock::_make_or_edit_connection)); tree->connect("item_selected", callable_mp(this, &ConnectionsDock::_tree_item_selected)); tree->connect("item_activated", callable_mp(this, &ConnectionsDock::_tree_item_activated)); - tree->connect("gui_input", callable_mp(this, &ConnectionsDock::_tree_gui_input)); + tree->connect(SceneStringName(gui_input), callable_mp(this, &ConnectionsDock::_tree_gui_input)); add_theme_constant_override("separation", 3 * EDSCALE); } diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 2c7f6fb21ac..2980054413c 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -807,7 +807,7 @@ CreateDialog::CreateDialog() { search_box->set_clear_button_enabled(true); search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); search_box->connect("text_changed", callable_mp(this, &CreateDialog::_text_changed)); - search_box->connect("gui_input", callable_mp(this, &CreateDialog::_sbox_input)); + search_box->connect(SceneStringName(gui_input), callable_mp(this, &CreateDialog::_sbox_input)); HBoxContainer *search_hb = memnew(HBoxContainer); search_hb->add_child(search_box); diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp index da75715b6d9..9f6160f3721 100644 --- a/editor/debugger/editor_performance_profiler.cpp +++ b/editor/debugger/editor_performance_profiler.cpp @@ -111,7 +111,7 @@ void EditorPerformanceProfiler::_monitor_draw() { info_message->hide(); - Ref graph_style_box = get_theme_stylebox(SNAME("normal"), SNAME("TextEdit")); + Ref graph_style_box = get_theme_stylebox(CoreStringName(normal), SNAME("TextEdit")); Ref graph_font = get_theme_font(SNAME("font"), SNAME("TextEdit")); int font_size = get_theme_font_size(SNAME("font_size"), SNAME("TextEdit")); @@ -276,7 +276,7 @@ void EditorPerformanceProfiler::_marker_input(const Ref &p_event) { } else { marker_key = ""; } - Ref graph_style_box = get_theme_stylebox(SNAME("normal"), SNAME("TextEdit")); + Ref graph_style_box = get_theme_stylebox(CoreStringName(normal), SNAME("TextEdit")); rect.position += graph_style_box->get_offset(); rect.size -= graph_style_box->get_minimum_size(); Vector2 point = mb->get_position() - rect.position; @@ -397,8 +397,8 @@ EditorPerformanceProfiler::EditorPerformanceProfiler() { monitor_draw = memnew(Control); monitor_draw->set_clip_contents(true); - monitor_draw->connect("draw", callable_mp(this, &EditorPerformanceProfiler::_monitor_draw)); - monitor_draw->connect("gui_input", callable_mp(this, &EditorPerformanceProfiler::_marker_input)); + monitor_draw->connect(SceneStringName(draw), callable_mp(this, &EditorPerformanceProfiler::_monitor_draw)); + monitor_draw->connect(SceneStringName(gui_input), callable_mp(this, &EditorPerformanceProfiler::_marker_input)); add_child(monitor_draw); info_message = memnew(Label); diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index ce08d40634d..290b7f5405c 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -694,9 +694,9 @@ EditorProfiler::EditorProfiler() { graph = memnew(TextureRect); graph->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE); graph->set_mouse_filter(MOUSE_FILTER_STOP); - graph->connect("draw", callable_mp(this, &EditorProfiler::_graph_tex_draw)); - graph->connect("gui_input", callable_mp(this, &EditorProfiler::_graph_tex_input)); - graph->connect("mouse_exited", callable_mp(this, &EditorProfiler::_graph_tex_mouse_exit)); + graph->connect(SceneStringName(draw), callable_mp(this, &EditorProfiler::_graph_tex_draw)); + graph->connect(SceneStringName(gui_input), callable_mp(this, &EditorProfiler::_graph_tex_input)); + graph->connect(SceneStringName(mouse_exited), callable_mp(this, &EditorProfiler::_graph_tex_mouse_exit)); h_split->add_child(graph); graph->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 8a5c464c2fe..d54ea2d4338 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -802,9 +802,9 @@ EditorVisualProfiler::EditorVisualProfiler() { graph = memnew(TextureRect); graph->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE); graph->set_mouse_filter(MOUSE_FILTER_STOP); - graph->connect("draw", callable_mp(this, &EditorVisualProfiler::_graph_tex_draw)); - graph->connect("gui_input", callable_mp(this, &EditorVisualProfiler::_graph_tex_input)); - graph->connect("mouse_exited", callable_mp(this, &EditorVisualProfiler::_graph_tex_mouse_exit)); + graph->connect(SceneStringName(draw), callable_mp(this, &EditorVisualProfiler::_graph_tex_draw)); + graph->connect(SceneStringName(gui_input), callable_mp(this, &EditorVisualProfiler::_graph_tex_input)); + graph->connect(SceneStringName(mouse_exited), callable_mp(this, &EditorVisualProfiler::_graph_tex_mouse_exit)); h_split->add_child(graph); graph->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index af4631a539a..f97b2f790f4 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -52,13 +52,13 @@ void EditorAbout::_notification(int p_what) { _tpl_text->begin_bulk_theme_override(); _tpl_text->add_theme_font_override("normal_font", font); _tpl_text->add_theme_font_size_override("normal_font_size", font_size); - _tpl_text->add_theme_constant_override("line_separation", 4 * EDSCALE); + _tpl_text->add_theme_constant_override(SceneStringName(line_separation), 4 * EDSCALE); _tpl_text->end_bulk_theme_override(); license_text_label->begin_bulk_theme_override(); license_text_label->add_theme_font_override("normal_font", font); license_text_label->add_theme_font_size_override("normal_font_size", font_size); - license_text_label->add_theme_constant_override("line_separation", 4 * EDSCALE); + license_text_label->add_theme_constant_override(SceneStringName(line_separation), 4 * EDSCALE); license_text_label->end_bulk_theme_override(); _logo->set_texture(get_editor_theme_icon(SNAME("Logo"))); @@ -130,8 +130,8 @@ ScrollContainer *EditorAbout::_populate_list(const String &p_name, const Listset_mouse_filter(Control::MOUSE_FILTER_PASS); il->connect("item_activated", callable_mp(this, &EditorAbout::_item_with_website_selected).bind(il)); - il->connect("resized", callable_mp(this, &EditorAbout::_item_list_resized).bind(il)); - il->connect("focus_exited", callable_mp(il, &ItemList::deselect_all)); + il->connect(SceneStringName(resized), callable_mp(this, &EditorAbout::_item_list_resized).bind(il)); + il->connect(SceneStringName(focus_exited), callable_mp(il, &ItemList::deselect_all)); il->add_theme_style_override("focus", empty_stylebox); il->add_theme_style_override("selected", empty_stylebox); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index e20d046e00b..6ac9e3849cd 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -805,7 +805,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { track_name = memnew(LineEdit); track_name->connect("text_submitted", callable_mp(this, &EditorAudioBus::_name_changed)); - track_name->connect("focus_exited", callable_mp(this, &EditorAudioBus::_name_focus_exit)); + track_name->connect(SceneStringName(focus_exited), callable_mp(this, &EditorAudioBus::_name_focus_exit)); vb->add_child(track_name); HBoxContainer *hbc = memnew(HBoxContainer); @@ -926,14 +926,14 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { vb->add_child(effects); effects->connect("item_edited", callable_mp(this, &EditorAudioBus::_effect_edited)); effects->connect("cell_selected", callable_mp(this, &EditorAudioBus::_effect_selected)); - effects->connect("focus_exited", callable_mp(effects, &Tree::deselect_all)); + effects->connect(SceneStringName(focus_exited), callable_mp(effects, &Tree::deselect_all)); effects->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true); SET_DRAG_FORWARDING_GCD(effects, EditorAudioBus); effects->connect("item_mouse_selected", callable_mp(this, &EditorAudioBus::_effect_rmb)); effects->set_allow_rmb_select(true); effects->set_focus_mode(FOCUS_CLICK); effects->set_allow_reselect(true); - effects->connect("gui_input", callable_mp(this, &EditorAudioBus::_effects_gui_input)); + effects->connect(SceneStringName(gui_input), callable_mp(this, &EditorAudioBus::_effects_gui_input)); send = memnew(OptionButton); send->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); @@ -982,7 +982,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { void EditorAudioBusDrop::_notification(int p_what) { switch (p_what) { case NOTIFICATION_DRAW: { - draw_style_box(get_theme_stylebox(SNAME("normal"), SNAME("Button")), Rect2(Vector2(), get_size())); + draw_style_box(get_theme_stylebox(CoreStringName(normal), SNAME("Button")), Rect2(Vector2(), get_size())); if (hovering_drop) { Color accent = get_theme_color(SNAME("accent_color"), EditorStringName(Editor)); diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index a7b15e50d7d..b0571a62c11 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -236,8 +236,8 @@ void EditorAutoloadSettings::_autoload_edited() { undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", selected_autoload, order); undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", name); - undo_redo->add_do_method(this, "call_deferred", "update_autoload"); - undo_redo->add_undo_method(this, "call_deferred", "update_autoload"); + undo_redo->add_do_method(this, CoreStringName(call_deferred), "update_autoload"); + undo_redo->add_undo_method(this, CoreStringName(call_deferred), "update_autoload"); undo_redo->add_do_method(this, "emit_signal", autoload_changed); undo_redo->add_undo_method(this, "emit_signal", autoload_changed); @@ -271,8 +271,8 @@ void EditorAutoloadSettings::_autoload_edited() { undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", base, order); undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", base, order); - undo_redo->add_do_method(this, "call_deferred", "update_autoload"); - undo_redo->add_undo_method(this, "call_deferred", "update_autoload"); + undo_redo->add_do_method(this, CoreStringName(call_deferred), "update_autoload"); + undo_redo->add_undo_method(this, CoreStringName(call_deferred), "update_autoload"); undo_redo->add_do_method(this, "emit_signal", autoload_changed); undo_redo->add_undo_method(this, "emit_signal", autoload_changed); diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index b963330fdc0..badab92fb0b 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -349,7 +349,7 @@ EditorCommandPalette::EditorCommandPalette() { command_search_box = memnew(LineEdit); command_search_box->set_placeholder(TTR("Filter Commands")); - command_search_box->connect("gui_input", callable_mp(this, &EditorCommandPalette::_sbox_input)); + command_search_box->connect(SceneStringName(gui_input), callable_mp(this, &EditorCommandPalette::_sbox_input)); command_search_box->connect("text_changed", callable_mp(this, &EditorCommandPalette::_update_command_search)); command_search_box->set_v_size_flags(Control::SIZE_EXPAND_FILL); command_search_box->set_clear_button_enabled(true); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index bd1eef8e53b..11fea8b7285 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -1217,7 +1217,7 @@ void EditorSelection::add_node(Node *p_node) { } selection[p_node] = meta; - p_node->connect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed).bind(p_node), CONNECT_ONE_SHOT); + p_node->connect(SceneStringName(tree_exiting), callable_mp(this, &EditorSelection::_node_removed).bind(p_node), CONNECT_ONE_SHOT); } void EditorSelection::remove_node(Node *p_node) { @@ -1234,7 +1234,7 @@ void EditorSelection::remove_node(Node *p_node) { } selection.erase(p_node); - p_node->disconnect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed)); + p_node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &EditorSelection::_node_removed)); } bool EditorSelection::is_selected(Node *p_node) const { diff --git a/editor/editor_dock_manager.cpp b/editor/editor_dock_manager.cpp index 5106fae9c76..4ba7832e76b 100644 --- a/editor/editor_dock_manager.cpp +++ b/editor/editor_dock_manager.cpp @@ -85,7 +85,7 @@ void DockSplitContainer::add_child_notify(Node *p_child) { return; } - child_control->connect("visibility_changed", callable_mp(this, &DockSplitContainer::_update_visibility)); + child_control->connect(SceneStringName(visibility_changed), callable_mp(this, &DockSplitContainer::_update_visibility)); _update_visibility(); } @@ -104,7 +104,7 @@ void DockSplitContainer::remove_child_notify(Node *p_child) { return; } - child_control->disconnect("visibility_changed", callable_mp(this, &DockSplitContainer::_update_visibility)); + child_control->disconnect(SceneStringName(visibility_changed), callable_mp(this, &DockSplitContainer::_update_visibility)); _update_visibility(); } @@ -280,7 +280,7 @@ void EditorDockManager::_dock_move_to_bottom(Control *p_dock) { // Force docks moved to the bottom to appear first in the list, and give them their associated shortcut to toggle their bottom panel. Button *bottom_button = EditorNode::get_bottom_panel()->add_item(all_docks[p_dock].title, p_dock, all_docks[p_dock].shortcut, true); - bottom_button->connect("gui_input", callable_mp(this, &EditorDockManager::_bottom_dock_button_gui_input).bind(bottom_button).bind(p_dock)); + bottom_button->connect(SceneStringName(gui_input), callable_mp(this, &EditorDockManager::_bottom_dock_button_gui_input).bind(bottom_button).bind(p_dock)); EditorNode::get_bottom_panel()->make_item_visible(p_dock); } @@ -809,7 +809,7 @@ void EditorDockManager::register_dock_slot(DockSlot p_dock_slot, TabContainer *p p_tab_container->connect("active_tab_rearranged", callable_mp(this, &EditorDockManager::_update_layout).unbind(1)); p_tab_container->connect("child_order_changed", callable_mp(this, &EditorDockManager::_dock_container_update_visibility).bind(p_tab_container)); p_tab_container->set_use_hidden_tabs_for_min_size(true); - p_tab_container->get_tab_bar()->connect("gui_input", callable_mp(this, &EditorDockManager::_dock_container_gui_input).bind(p_tab_container)); + p_tab_container->get_tab_bar()->connect(SceneStringName(gui_input), callable_mp(this, &EditorDockManager::_dock_container_gui_input).bind(p_tab_container)); p_tab_container->hide(); } @@ -832,7 +832,7 @@ EditorDockManager::EditorDockManager() { docks_menu = memnew(PopupMenu); docks_menu->set_hide_on_item_selection(false); docks_menu->connect("id_pressed", callable_mp(this, &EditorDockManager::_docks_menu_option)); - EditorNode::get_singleton()->get_gui_base()->connect("theme_changed", callable_mp(this, &EditorDockManager::_update_docks_menu)); + EditorNode::get_singleton()->get_gui_base()->connect(SceneStringName(theme_changed), callable_mp(this, &EditorDockManager::_update_docks_menu)); } void DockContextPopup::_notification(int p_what) { @@ -1092,9 +1092,9 @@ DockContextPopup::DockContextPopup() { dock_select = memnew(Control); dock_select->set_custom_minimum_size(Size2(128, 64) * EDSCALE); - dock_select->connect("gui_input", callable_mp(this, &DockContextPopup::_dock_select_input)); - dock_select->connect("draw", callable_mp(this, &DockContextPopup::_dock_select_draw)); - dock_select->connect("mouse_exited", callable_mp(this, &DockContextPopup::_dock_select_mouse_exited)); + dock_select->connect(SceneStringName(gui_input), callable_mp(this, &DockContextPopup::_dock_select_input)); + dock_select->connect(SceneStringName(draw), callable_mp(this, &DockContextPopup::_dock_select_draw)); + dock_select->connect(SceneStringName(mouse_exited), callable_mp(this, &DockContextPopup::_dock_select_mouse_exited)); dock_select->set_v_size_flags(Control::SIZE_EXPAND_FILL); dock_select_popup_vb->add_child(dock_select); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index fd728dc3939..59ec4ed7150 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -196,7 +196,7 @@ void EditorHelp::_update_theme_item_cache() { class_desc->add_theme_font_override("normal_font", theme_cache.doc_font); class_desc->add_theme_font_size_override("normal_font_size", theme_cache.doc_font_size); - class_desc->add_theme_constant_override("line_separation", get_theme_constant(SNAME("line_separation"), SNAME("EditorHelp"))); + class_desc->add_theme_constant_override(SceneStringName(line_separation), get_theme_constant(SceneStringName(line_separation), SNAME("EditorHelp"))); class_desc->add_theme_constant_override("table_h_separation", get_theme_constant(SNAME("table_h_separation"), SNAME("EditorHelp"))); class_desc->add_theme_constant_override("table_v_separation", get_theme_constant(SNAME("table_v_separation"), SNAME("EditorHelp"))); class_desc->add_theme_constant_override("text_highlight_h_padding", get_theme_constant(SNAME("text_highlight_h_padding"), SNAME("EditorHelp"))); @@ -2340,7 +2340,7 @@ void EditorHelp::_help_callback(const String &p_topic) { if (class_desc->is_ready()) { // call_deferred() is not enough. - class_desc->connect("draw", callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).bind(line), CONNECT_ONE_SHOT | CONNECT_DEFERRED); + class_desc->connect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).bind(line), CONNECT_ONE_SHOT | CONNECT_DEFERRED); } else { scroll_to = line; } @@ -3099,10 +3099,10 @@ EditorHelp::EditorHelp() { class_desc->set_threaded(true); class_desc->set_v_size_flags(SIZE_EXPAND_FILL); - class_desc->connect("finished", callable_mp(this, &EditorHelp::_class_desc_finished)); + class_desc->connect(SceneStringName(finished), callable_mp(this, &EditorHelp::_class_desc_finished)); class_desc->connect("meta_clicked", callable_mp(this, &EditorHelp::_class_desc_select)); - class_desc->connect("gui_input", callable_mp(this, &EditorHelp::_class_desc_input)); - class_desc->connect("resized", callable_mp(this, &EditorHelp::_class_desc_resized).bind(false)); + class_desc->connect(SceneStringName(gui_input), callable_mp(this, &EditorHelp::_class_desc_input)); + class_desc->connect(SceneStringName(resized), callable_mp(this, &EditorHelp::_class_desc_resized).bind(false)); // Added second so it opens at the bottom so it won't offset the entire widget. find_bar = memnew(FindBar); @@ -3857,8 +3857,8 @@ EditorHelpBitTooltip::EditorHelpBitTooltip(Control *p_target) { add_child(timer); ERR_FAIL_NULL(p_target); - p_target->connect("mouse_entered", callable_mp(timer, &Timer::stop)); - p_target->connect("mouse_exited", callable_mp(timer, &Timer::start).bind(-1)); + p_target->connect(SceneStringName(mouse_entered), callable_mp(timer, &Timer::stop)); + p_target->connect(SceneStringName(mouse_exited), callable_mp(timer, &Timer::start).bind(-1)); } #if defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED) diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 1e0c0e9fd88..0a6802fb7cb 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -315,7 +315,7 @@ EditorHelpSearch::EditorHelpSearch() { search_box->set_custom_minimum_size(Size2(200, 0) * EDSCALE); search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); search_box->set_clear_button_enabled(true); - search_box->connect("gui_input", callable_mp(this, &EditorHelpSearch::_search_box_gui_input)); + search_box->connect(SceneStringName(gui_input), callable_mp(this, &EditorHelpSearch::_search_box_gui_input)); search_box->connect("text_changed", callable_mp(this, &EditorHelpSearch::_search_box_text_changed)); register_text_enter(search_box); hbox->add_child(search_box); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index a9c5586ba2f..a23a43bb336 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -647,7 +647,7 @@ void EditorProperty::_focusable_focused(int p_index) { } void EditorProperty::add_focusable(Control *p_control) { - p_control->connect("focus_entered", callable_mp(this, &EditorProperty::_focusable_focused).bind(focusables.size())); + p_control->connect(SceneStringName(focus_entered), callable_mp(this, &EditorProperty::_focusable_focused).bind(focusables.size())); focusables.push_back(p_control); } @@ -2164,10 +2164,10 @@ void EditorInspectorArray::_setup() { int element_position = begin_array_index + i; ae.panel->set_meta("index", element_position); ae.panel->set_tooltip_text(vformat(TTR("Element %d: %s%d*"), element_position, array_element_prefix, element_position)); - ae.panel->connect("focus_entered", callable_mp((CanvasItem *)ae.panel, &PanelContainer::queue_redraw)); - ae.panel->connect("focus_exited", callable_mp((CanvasItem *)ae.panel, &PanelContainer::queue_redraw)); - ae.panel->connect("draw", callable_mp(this, &EditorInspectorArray::_panel_draw).bind(i)); - ae.panel->connect("gui_input", callable_mp(this, &EditorInspectorArray::_panel_gui_input).bind(i)); + ae.panel->connect(SceneStringName(focus_entered), callable_mp((CanvasItem *)ae.panel, &PanelContainer::queue_redraw)); + ae.panel->connect(SceneStringName(focus_exited), callable_mp((CanvasItem *)ae.panel, &PanelContainer::queue_redraw)); + ae.panel->connect(SceneStringName(draw), callable_mp(this, &EditorInspectorArray::_panel_draw).bind(i)); + ae.panel->connect(SceneStringName(gui_input), callable_mp(this, &EditorInspectorArray::_panel_gui_input).bind(i)); ae.panel->add_theme_style_override(SNAME("panel"), i % 2 ? odd_style : even_style); elements_vbox->add_child(ae.panel); @@ -2434,7 +2434,7 @@ EditorInspectorArray::EditorInspectorArray(bool p_read_only) { vbox->add_child(add_button); control_dropping = memnew(Control); - control_dropping->connect("draw", callable_mp(this, &EditorInspectorArray::_control_dropping_draw)); + control_dropping->connect(SceneStringName(draw), callable_mp(this, &EditorInspectorArray::_control_dropping_draw)); control_dropping->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); add_child(control_dropping); @@ -2454,7 +2454,7 @@ EditorInspectorArray::EditorInspectorArray(bool p_read_only) { new_size_spin_box->set_editable(!read_only); resize_dialog_vbox->add_margin_child(TTRC("New Size:"), new_size_spin_box); - vbox->connect("visibility_changed", callable_mp(this, &EditorInspectorArray::_vbox_visibility_changed)); + vbox->connect(SceneStringName(visibility_changed), callable_mp(this, &EditorInspectorArray::_vbox_visibility_changed)); } //////////////////////////////////////////////// @@ -3522,7 +3522,7 @@ void EditorInspector::edit(Object *p_object) { next_object = p_object; // Some plugins need to know the next edited object when clearing the inspector. if (object) { - object->disconnect("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback)); + object->disconnect(CoreStringName(property_list_changed), callable_mp(this, &EditorInspector::_changed_callback)); _clear(); } per_array_page.clear(); @@ -3534,7 +3534,7 @@ void EditorInspector::edit(Object *p_object) { if (scroll_cache.has(object->get_instance_id())) { //if exists, set something else update_scroll_request = scroll_cache[object->get_instance_id()]; //done this way because wait until full size is accommodated } - object->connect("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback)); + object->connect(CoreStringName(property_list_changed), callable_mp(this, &EditorInspector::_changed_callback)); update_tree(); } diff --git a/editor/editor_layouts_dialog.cpp b/editor/editor_layouts_dialog.cpp index 52047c569de..fe21fb26e76 100644 --- a/editor/editor_layouts_dialog.cpp +++ b/editor/editor_layouts_dialog.cpp @@ -131,8 +131,8 @@ EditorLayoutsDialog::EditorLayoutsDialog() { name->set_offset(SIDE_TOP, 5); name->set_anchor_and_offset(SIDE_LEFT, Control::ANCHOR_BEGIN, 5); name->set_anchor_and_offset(SIDE_RIGHT, Control::ANCHOR_END, -5); - name->connect("gui_input", callable_mp(this, &EditorLayoutsDialog::_line_gui_input)); - name->connect("focus_entered", callable_mp(this, &EditorLayoutsDialog::_deselect_layout_names)); + name->connect(SceneStringName(gui_input), callable_mp(this, &EditorLayoutsDialog::_line_gui_input)); + name->connect(SceneStringName(focus_entered), callable_mp(this, &EditorLayoutsDialog::_deselect_layout_names)); name->connect("text_changed", callable_mp(this, &EditorLayoutsDialog::_update_ok_disable_state).unbind(1)); } diff --git a/editor/editor_native_shader_source_visualizer.cpp b/editor/editor_native_shader_source_visualizer.cpp index d87f17f22aa..37c8bffe3d4 100644 --- a/editor/editor_native_shader_source_visualizer.cpp +++ b/editor/editor_native_shader_source_visualizer.cpp @@ -32,6 +32,7 @@ #include "editor/code_editor.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "editor/themes/editor_scale.h" #include "scene/gui/text_edit.h" #include "servers/rendering/shader_language.h" @@ -95,8 +96,8 @@ void EditorNativeShaderSourceVisualizer::_inspect_shader(RID p_shader) { CodeEdit *code_edit = memnew(CodeEdit); code_edit->set_editable(false); code_edit->set_syntax_highlighter(syntax_highlighter); - code_edit->add_theme_font_override("font", get_theme_font("source", "EditorFonts")); - code_edit->add_theme_font_size_override("font_size", get_theme_font_size("source_size", "EditorFonts")); + code_edit->add_theme_font_override("font", get_theme_font("source", EditorStringName(EditorFonts))); + code_edit->add_theme_font_size_override("font_size", get_theme_font_size("source_size", EditorStringName(EditorFonts))); code_edit->add_theme_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6)); // Appearance: Caret diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index e8a0b771847..5702751f175 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -7109,7 +7109,7 @@ EditorNode::EditorNode() { Button *output_button = bottom_panel->add_item(TTR("Output"), log, ED_SHORTCUT_AND_COMMAND("bottom_panels/toggle_output_bottom_panel", TTR("Toggle Output Bottom Panel"), KeyModifierMask::ALT | Key::O)); log->set_tool_button(output_button); - center_split->connect("resized", callable_mp(this, &EditorNode::_vp_resized)); + center_split->connect(SceneStringName(resized), callable_mp(this, &EditorNode::_vp_resized)); native_shader_source_visualizer = memnew(EditorNativeShaderSourceVisualizer); gui_base->add_child(native_shader_source_visualizer); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index c73bdafb1a6..3195b99f76e 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -31,7 +31,6 @@ #include "editor_properties.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" #include "editor/create_dialog.h" #include "editor/editor_node.h" #include "editor/editor_properties_array_dict.h" @@ -457,7 +456,7 @@ EditorPropertyLocale::EditorPropertyLocale() { locale = memnew(LineEdit); locale_hb->add_child(locale); locale->connect("text_submitted", callable_mp(this, &EditorPropertyLocale::_locale_selected)); - locale->connect("focus_exited", callable_mp(this, &EditorPropertyLocale::_locale_focus_exited)); + locale->connect(SceneStringName(focus_exited), callable_mp(this, &EditorPropertyLocale::_locale_focus_exited)); locale->set_h_size_flags(SIZE_EXPAND_FILL); locale_edit = memnew(Button); @@ -598,7 +597,7 @@ EditorPropertyPath::EditorPropertyPath() { path->set_structured_text_bidi_override(TextServer::STRUCTURED_TEXT_FILE); path_hb->add_child(path); path->connect("text_submitted", callable_mp(this, &EditorPropertyPath::_path_selected)); - path->connect("focus_exited", callable_mp(this, &EditorPropertyPath::_path_focus_exited)); + path->connect(SceneStringName(focus_exited), callable_mp(this, &EditorPropertyPath::_path_focus_exited)); path->set_h_size_flags(SIZE_EXPAND_FILL); path_edit = memnew(Button); @@ -1681,8 +1680,8 @@ void EditorPropertyEasing::_bind_methods() { EditorPropertyEasing::EditorPropertyEasing() { easing_draw = memnew(Control); - easing_draw->connect("draw", callable_mp(this, &EditorPropertyEasing::_draw_easing)); - easing_draw->connect("gui_input", callable_mp(this, &EditorPropertyEasing::_drag_easing)); + easing_draw->connect(SceneStringName(draw), callable_mp(this, &EditorPropertyEasing::_draw_easing)); + easing_draw->connect(SceneStringName(gui_input), callable_mp(this, &EditorPropertyEasing::_drag_easing)); easing_draw->set_default_cursor_shape(Control::CURSOR_MOVE); add_child(easing_draw); @@ -1699,7 +1698,7 @@ EditorPropertyEasing::EditorPropertyEasing() { spin->set_allow_lesser(true); spin->set_allow_greater(true); spin->connect("value_changed", callable_mp(this, &EditorPropertyEasing::_spin_value_changed)); - spin->get_line_edit()->connect("focus_exited", callable_mp(this, &EditorPropertyEasing::_spin_focus_exited)); + spin->get_line_edit()->connect(SceneStringName(focus_exited), callable_mp(this, &EditorPropertyEasing::_spin_focus_exited)); spin->hide(); add_child(spin); } @@ -3000,7 +2999,7 @@ EditorPropertyNodePath::EditorPropertyNodePath() { edit = memnew(LineEdit); edit->set_h_size_flags(SIZE_EXPAND_FILL); edit->hide(); - edit->connect(SNAME("focus_exited"), callable_mp(this, &EditorPropertyNodePath::_accept_text)); + edit->connect(SceneStringName(focus_exited), callable_mp(this, &EditorPropertyNodePath::_accept_text)); edit->connect(SNAME("text_submitted"), callable_mp(this, &EditorPropertyNodePath::_text_submitted)); hbc->add_child(edit); } @@ -3280,7 +3279,7 @@ void EditorPropertyResource::setup(Object *p_object, const String &p_path, const EditorShaderPicker *shader_picker = memnew(EditorShaderPicker); shader_picker->set_edited_material(Object::cast_to(p_object)); resource_picker = shader_picker; - connect(SNAME("ready"), callable_mp(this, &EditorPropertyResource::_update_preferred_shader)); + connect(SceneStringName(ready), callable_mp(this, &EditorPropertyResource::_update_preferred_shader)); } else if (p_base_type == "AudioStream") { EditorAudioStreamPicker *astream_picker = memnew(EditorAudioStreamPicker); resource_picker = astream_picker; diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index e338c5c8bd6..4c75f129527 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -273,7 +273,7 @@ void EditorPropertyArray::_create_new_property_slot() { reorder_button->set_icon(get_editor_theme_icon(SNAME("TripleBar"))); reorder_button->set_default_cursor_shape(Control::CURSOR_MOVE); reorder_button->set_disabled(is_read_only()); - reorder_button->connect(SNAME("gui_input"), callable_mp(this, &EditorPropertyArray::_reorder_button_gui_input)); + reorder_button->connect(SceneStringName(gui_input), callable_mp(this, &EditorPropertyArray::_reorder_button_gui_input)); reorder_button->connect(SNAME("button_up"), callable_mp(this, &EditorPropertyArray::_reorder_button_up)); reorder_button->connect(SNAME("button_down"), callable_mp(this, &EditorPropertyArray::_reorder_button_down).bind(idx)); @@ -832,7 +832,7 @@ EditorPropertyArray::EditorPropertyArray() { edit->connect("pressed", callable_mp(this, &EditorPropertyArray::_edit_pressed)); edit->set_toggle_mode(true); SET_DRAG_FORWARDING_CD(edit, EditorPropertyArray); - edit->connect("draw", callable_mp(this, &EditorPropertyArray::_button_draw)); + edit->connect(SceneStringName(draw), callable_mp(this, &EditorPropertyArray::_button_draw)); add_child(edit); add_focusable(edit); diff --git a/editor/editor_quick_open.cpp b/editor/editor_quick_open.cpp index d7a02ace24f..356055c457c 100644 --- a/editor/editor_quick_open.cpp +++ b/editor/editor_quick_open.cpp @@ -293,7 +293,7 @@ EditorQuickOpen::EditorQuickOpen() { search_box = memnew(LineEdit); search_box->connect("text_changed", callable_mp(this, &EditorQuickOpen::_text_changed)); - search_box->connect("gui_input", callable_mp(this, &EditorQuickOpen::_sbox_input)); + search_box->connect(SceneStringName(gui_input), callable_mp(this, &EditorQuickOpen::_sbox_input)); vbc->add_margin_child(TTR("Search:"), search_box); register_text_enter(search_box); diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index e082366c44a..ef4469623c3 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -102,7 +102,7 @@ void EditorResourcePicker::_update_resource_preview(const String &p_path, const } if (p_preview.is_valid()) { - preview_rect->set_offset(SIDE_LEFT, assign_button->get_icon()->get_width() + assign_button->get_theme_stylebox(SNAME("normal"))->get_content_margin(SIDE_LEFT) + get_theme_constant(SNAME("h_separation"), SNAME("Button"))); + preview_rect->set_offset(SIDE_LEFT, assign_button->get_icon()->get_width() + assign_button->get_theme_stylebox(CoreStringName(normal))->get_content_margin(SIDE_LEFT) + get_theme_constant(SNAME("h_separation"), SNAME("Button"))); // Resource-specific stretching. if (Ref(edited_resource).is_valid() || Ref(edited_resource).is_valid()) { @@ -1044,8 +1044,8 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) { SET_DRAG_FORWARDING_GCD(assign_button, EditorResourcePicker); add_child(assign_button); assign_button->connect("pressed", callable_mp(this, &EditorResourcePicker::_resource_selected)); - assign_button->connect("draw", callable_mp(this, &EditorResourcePicker::_button_draw)); - assign_button->connect("gui_input", callable_mp(this, &EditorResourcePicker::_button_input)); + assign_button->connect(SceneStringName(draw), callable_mp(this, &EditorResourcePicker::_button_draw)); + assign_button->connect(SceneStringName(gui_input), callable_mp(this, &EditorResourcePicker::_button_input)); if (!p_hide_assign_button_controls) { preview_rect = memnew(TextureRect); @@ -1063,7 +1063,7 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) { edit_button->set_toggle_mode(true); edit_button->connect("pressed", callable_mp(this, &EditorResourcePicker::_update_menu)); add_child(edit_button); - edit_button->connect("gui_input", callable_mp(this, &EditorResourcePicker::_button_input)); + edit_button->connect(SceneStringName(gui_input), callable_mp(this, &EditorResourcePicker::_button_input)); add_theme_constant_override("separation", 0); } @@ -1332,7 +1332,7 @@ EditorAudioStreamPicker::EditorAudioStreamPicker() : stream_preview_rect->set_offset(SIDE_BOTTOM, -1); stream_preview_rect->set_offset(SIDE_RIGHT, -1); stream_preview_rect->set_mouse_filter(MOUSE_FILTER_IGNORE); - stream_preview_rect->connect("draw", callable_mp(this, &EditorAudioStreamPicker::_preview_draw)); + stream_preview_rect->connect(SceneStringName(draw), callable_mp(this, &EditorAudioStreamPicker::_preview_draw)); get_assign_button()->add_child(stream_preview_rect); get_assign_button()->move_child(stream_preview_rect, 0); diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 7faab03a357..37210714f18 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -778,8 +778,8 @@ EditorSettingsDialog::EditorSettingsDialog() { shortcut_search_by_event->set_stretch_ratio(0.75); shortcut_search_by_event->set_allowed_input_types(INPUT_KEY); shortcut_search_by_event->connect("event_changed", callable_mp(this, &EditorSettingsDialog::_filter_shortcuts_by_event)); - shortcut_search_by_event->connect("focus_entered", callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(false)); - shortcut_search_by_event->connect("focus_exited", callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(true)); + shortcut_search_by_event->connect(SceneStringName(focus_entered), callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(false)); + shortcut_search_by_event->connect(SceneStringName(focus_exited), callable_mp((AcceptDialog *)this, &AcceptDialog::set_close_on_escape).bind(true)); top_hbox->add_child(shortcut_search_by_event); Button *clear_all_search = memnew(Button); diff --git a/editor/event_listener_line_edit.cpp b/editor/event_listener_line_edit.cpp index c29e83d624e..424319610ad 100644 --- a/editor/event_listener_line_edit.cpp +++ b/editor/event_listener_line_edit.cpp @@ -217,8 +217,8 @@ void EventListenerLineEdit::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { connect("text_changed", callable_mp(this, &EventListenerLineEdit::_on_text_changed)); - connect("focus_entered", callable_mp(this, &EventListenerLineEdit::_on_focus)); - connect("focus_exited", callable_mp(this, &EventListenerLineEdit::_on_unfocus)); + connect(SceneStringName(focus_entered), callable_mp(this, &EventListenerLineEdit::_on_focus)); + connect(SceneStringName(focus_exited), callable_mp(this, &EventListenerLineEdit::_on_unfocus)); set_right_icon(get_editor_theme_icon(SNAME("Keyboard"))); set_clear_button_enabled(true); } break; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 2da36bfc22b..b087f4e64e4 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -313,7 +313,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory _sort_file_info_list(file_list); // Build the tree. - const int icon_size = get_theme_constant(SNAME("class_icon_size"), SNAME("Editor")); + const int icon_size = get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)); for (const FileInfo &fi : file_list) { TreeItem *file_item = tree->create_item(subdirectory_item); @@ -4023,8 +4023,8 @@ FileSystemDock::FileSystemDock() { tree->connect("item_mouse_selected", callable_mp(this, &FileSystemDock::_tree_rmb_select)); tree->connect("empty_clicked", callable_mp(this, &FileSystemDock::_tree_empty_click)); tree->connect("nothing_selected", callable_mp(this, &FileSystemDock::_tree_empty_selected)); - tree->connect("gui_input", callable_mp(this, &FileSystemDock::_tree_gui_input)); - tree->connect("mouse_exited", callable_mp(this, &FileSystemDock::_tree_mouse_exited)); + tree->connect(SceneStringName(gui_input), callable_mp(this, &FileSystemDock::_tree_gui_input)); + tree->connect(SceneStringName(mouse_exited), callable_mp(this, &FileSystemDock::_tree_mouse_exited)); tree->connect("item_edited", callable_mp(this, &FileSystemDock::_rename_operation_confirm)); file_list_vb = memnew(VBoxContainer); @@ -4053,7 +4053,7 @@ FileSystemDock::FileSystemDock() { files->set_select_mode(ItemList::SELECT_MULTI); SET_DRAG_FORWARDING_GCD(files, FileSystemDock); files->connect("item_clicked", callable_mp(this, &FileSystemDock::_file_list_item_clicked)); - files->connect("gui_input", callable_mp(this, &FileSystemDock::_file_list_gui_input)); + files->connect(SceneStringName(gui_input), callable_mp(this, &FileSystemDock::_file_list_gui_input)); files->connect("multi_selected", callable_mp(this, &FileSystemDock::_file_multi_selected)); files->connect("empty_clicked", callable_mp(this, &FileSystemDock::_file_list_empty_clicked)); files->connect("item_edited", callable_mp(this, &FileSystemDock::_rename_operation_confirm)); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index dff7ee5bb8b..87c23564ee3 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -47,7 +47,6 @@ #include "scene/gui/tree.h" const char *FindInFiles::SIGNAL_RESULT_FOUND = "result_found"; -const char *FindInFiles::SIGNAL_FINISHED = "finished"; // TODO: Would be nice in Vector and Vectors. template @@ -115,12 +114,12 @@ void FindInFiles::_notification(int p_what) { void FindInFiles::start() { if (_pattern.is_empty()) { print_verbose("Nothing to search, pattern is empty"); - emit_signal(SNAME(SIGNAL_FINISHED)); + emit_signal(SceneStringName(finished)); return; } if (_extension_filter.size() == 0) { print_verbose("Nothing to search, filter matches no files"); - emit_signal(SNAME(SIGNAL_FINISHED)); + emit_signal(SceneStringName(finished)); return; } @@ -202,7 +201,7 @@ void FindInFiles::_iterate() { set_process(false); _current_dir = ""; _searching = false; - emit_signal(SNAME(SIGNAL_FINISHED)); + emit_signal(SceneStringName(finished)); } } @@ -292,7 +291,7 @@ void FindInFiles::_bind_methods() { PropertyInfo(Variant::INT, "end"), PropertyInfo(Variant::STRING, "text"))); - ADD_SIGNAL(MethodInfo(SIGNAL_FINISHED)); + ADD_SIGNAL(MethodInfo("finished")); } //----------------------------------------------------------------------------- @@ -573,7 +572,7 @@ const char *FindInFilesPanel::SIGNAL_CLOSE_BUTTON_CLICKED = "close_button_clicke FindInFilesPanel::FindInFilesPanel() { _finder = memnew(FindInFiles); _finder->connect(FindInFiles::SIGNAL_RESULT_FOUND, callable_mp(this, &FindInFilesPanel::_on_result_found)); - _finder->connect(FindInFiles::SIGNAL_FINISHED, callable_mp(this, &FindInFilesPanel::_on_finished)); + _finder->connect(SceneStringName(finished), callable_mp(this, &FindInFilesPanel::_on_finished)); add_child(_finder); VBoxContainer *vbc = memnew(VBoxContainer); diff --git a/editor/group_settings_editor.cpp b/editor/group_settings_editor.cpp index 45da907d8a2..a7cfa0d6f49 100644 --- a/editor/group_settings_editor.cpp +++ b/editor/group_settings_editor.cpp @@ -80,8 +80,8 @@ void GroupSettingsEditor::_item_edited() { undo_redo->add_do_property(ProjectSettings::get_singleton(), name, new_description); undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, old_description); - undo_redo->add_do_method(this, "call_deferred", "update_groups"); - undo_redo->add_undo_method(this, "call_deferred", "update_groups"); + undo_redo->add_do_method(this, CoreStringName(call_deferred), "update_groups"); + undo_redo->add_undo_method(this, CoreStringName(call_deferred), "update_groups"); undo_redo->add_do_method(this, "emit_signal", group_changed); undo_redo->add_undo_method(this, "emit_signal", group_changed); @@ -157,8 +157,8 @@ void GroupSettingsEditor::_add_group(const String &p_name, const String &p_descr undo_redo->add_do_property(ProjectSettings::get_singleton(), name, p_description); undo_redo->add_undo_property(ProjectSettings::get_singleton(), name, Variant()); - undo_redo->add_do_method(this, "call_deferred", "update_groups"); - undo_redo->add_undo_method(this, "call_deferred", "update_groups"); + undo_redo->add_do_method(this, CoreStringName(call_deferred), "update_groups"); + undo_redo->add_undo_method(this, CoreStringName(call_deferred), "update_groups"); undo_redo->add_do_method(this, "emit_signal", group_changed); undo_redo->add_undo_method(this, "emit_signal", group_changed); @@ -354,8 +354,8 @@ void GroupSettingsEditor::_confirm_rename() { undo_redo->add_undo_method(this, "rename_references", new_name, old_name); } - undo_redo->add_do_method(this, "call_deferred", "update_groups"); - undo_redo->add_undo_method(this, "call_deferred", "update_groups"); + undo_redo->add_do_method(this, CoreStringName(call_deferred), "update_groups"); + undo_redo->add_undo_method(this, CoreStringName(call_deferred), "update_groups"); undo_redo->add_do_method(this, "emit_signal", group_changed); undo_redo->add_undo_method(this, "emit_signal", group_changed); @@ -383,8 +383,8 @@ void GroupSettingsEditor::_confirm_delete() { undo_redo->add_do_method(this, "remove_references", name); } - undo_redo->add_do_method(this, "call_deferred", "update_groups"); - undo_redo->add_undo_method(this, "call_deferred", "update_groups"); + undo_redo->add_do_method(this, CoreStringName(call_deferred), "update_groups"); + undo_redo->add_undo_method(this, CoreStringName(call_deferred), "update_groups"); undo_redo->add_do_method(this, "emit_signal", group_changed); undo_redo->add_undo_method(this, "emit_signal", group_changed); diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index c4e38b327ae..daa014bfacc 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -32,6 +32,7 @@ #include "editor/editor_node.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" #include "editor/gui/editor_validation_panel.h" #include "editor/project_settings_editor.h" @@ -202,7 +203,7 @@ void GroupsEditor::_update_tree() { TreeItem *local_root = tree->create_item(root); local_root->set_text(0, TTR("Scene Groups")); local_root->set_icon(0, get_editor_theme_icon(SNAME("PackedScene"))); - local_root->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), SNAME("Editor"))); + local_root->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor))); local_root->set_selectable(0, false); List scene_keys; @@ -239,7 +240,7 @@ void GroupsEditor::_update_tree() { TreeItem *global_root = tree->create_item(root); global_root->set_text(0, TTR("Global Groups")); global_root->set_icon(0, get_editor_theme_icon(SNAME("Environment"))); - global_root->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), SNAME("Editor"))); + global_root->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor))); global_root->set_selectable(0, false); for (const StringName &E : keys) { @@ -853,7 +854,7 @@ GroupsEditor::GroupsEditor() { tree->set_select_mode(Tree::SelectMode::SELECT_SINGLE); tree->connect("button_clicked", callable_mp(this, &GroupsEditor::_modify_group)); tree->connect("item_mouse_selected", callable_mp(this, &GroupsEditor::_item_mouse_selected)); - tree->connect("gui_input", callable_mp(this, &GroupsEditor::_groups_gui_input)); + tree->connect(SceneStringName(gui_input), callable_mp(this, &GroupsEditor::_groups_gui_input)); add_child(tree); menu = memnew(PopupMenu); diff --git a/editor/gui/editor_scene_tabs.cpp b/editor/gui/editor_scene_tabs.cpp index b824a901709..f39e2adcb10 100644 --- a/editor/gui/editor_scene_tabs.cpp +++ b/editor/gui/editor_scene_tabs.cpp @@ -402,10 +402,10 @@ EditorSceneTabs::EditorSceneTabs() { scene_tabs->connect("tab_button_pressed", callable_mp(this, &EditorSceneTabs::_scene_tab_script_edited)); scene_tabs->connect("tab_close_pressed", callable_mp(this, &EditorSceneTabs::_scene_tab_closed)); scene_tabs->connect("tab_hovered", callable_mp(this, &EditorSceneTabs::_scene_tab_hovered)); - scene_tabs->connect("mouse_exited", callable_mp(this, &EditorSceneTabs::_scene_tab_exit)); - scene_tabs->connect("gui_input", callable_mp(this, &EditorSceneTabs::_scene_tab_input)); + scene_tabs->connect(SceneStringName(mouse_exited), callable_mp(this, &EditorSceneTabs::_scene_tab_exit)); + scene_tabs->connect(SceneStringName(gui_input), callable_mp(this, &EditorSceneTabs::_scene_tab_input)); scene_tabs->connect("active_tab_rearranged", callable_mp(this, &EditorSceneTabs::_reposition_active_tab)); - scene_tabs->connect("resized", callable_mp(this, &EditorSceneTabs::_scene_tabs_resized)); + scene_tabs->connect(SceneStringName(resized), callable_mp(this, &EditorSceneTabs::_scene_tabs_resized)); scene_tabs_context_menu = memnew(PopupMenu); tabbar_container->add_child(scene_tabs_context_menu); diff --git a/editor/gui/editor_spin_slider.cpp b/editor/gui/editor_spin_slider.cpp index 814484b8851..bf487a57696 100644 --- a/editor/gui/editor_spin_slider.cpp +++ b/editor/gui/editor_spin_slider.cpp @@ -290,7 +290,7 @@ void EditorSpinSlider::_update_value_input_stylebox() { // Add a left margin to the stylebox to make the number align with the Label // when it's edited. The LineEdit "focus" stylebox uses the "normal" stylebox's // default margins. - Ref stylebox = get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))->duplicate(); + Ref stylebox = get_theme_stylebox(CoreStringName(normal), SNAME("LineEdit"))->duplicate(); // EditorSpinSliders with a label have more space on the left, so add an // higher margin to match the location where the text begins. // The margin values below were determined by empirical testing. @@ -310,7 +310,7 @@ void EditorSpinSlider::_draw_spin_slider() { bool rtl = is_layout_rtl(); Vector2 size = get_size(); - Ref sb = get_theme_stylebox(is_read_only() ? SNAME("read_only") : SNAME("normal"), SNAME("LineEdit")); + Ref sb = get_theme_stylebox(is_read_only() ? SNAME("read_only") : CoreStringName(normal), SNAME("LineEdit")); if (!flat) { draw_style_box(sb, Rect2(Vector2(), size)); } @@ -513,7 +513,7 @@ LineEdit *EditorSpinSlider::get_line_edit() { } Size2 EditorSpinSlider::get_minimum_size() const { - Ref sb = get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")); + Ref sb = get_theme_stylebox(CoreStringName(normal), SNAME("LineEdit")); Ref font = get_theme_font(SNAME("font"), SNAME("LineEdit")); int font_size = get_theme_font_size(SNAME("font_size"), SNAME("LineEdit")); @@ -712,10 +712,10 @@ void EditorSpinSlider::_ensure_input_popup() { value_input->set_focus_mode(FOCUS_CLICK); value_input_popup->add_child(value_input); value_input->set_anchors_and_offsets_preset(PRESET_FULL_RECT); - value_input_popup->connect("hidden", callable_mp(this, &EditorSpinSlider::_value_input_closed)); + value_input_popup->connect(SceneStringName(hidden), callable_mp(this, &EditorSpinSlider::_value_input_closed)); value_input->connect("text_submitted", callable_mp(this, &EditorSpinSlider::_value_input_submitted)); - value_input->connect("focus_exited", callable_mp(this, &EditorSpinSlider::_value_focus_exited)); - value_input->connect("gui_input", callable_mp(this, &EditorSpinSlider::_value_input_gui_input)); + value_input->connect(SceneStringName(focus_exited), callable_mp(this, &EditorSpinSlider::_value_focus_exited)); + value_input->connect(SceneStringName(gui_input), callable_mp(this, &EditorSpinSlider::_value_input_gui_input)); if (is_inside_tree()) { _update_value_input_stylebox(); @@ -729,7 +729,7 @@ EditorSpinSlider::EditorSpinSlider() { grabber->hide(); grabber->set_as_top_level(true); grabber->set_mouse_filter(MOUSE_FILTER_STOP); - grabber->connect("mouse_entered", callable_mp(this, &EditorSpinSlider::_grabber_mouse_entered)); - grabber->connect("mouse_exited", callable_mp(this, &EditorSpinSlider::_grabber_mouse_exited)); - grabber->connect("gui_input", callable_mp(this, &EditorSpinSlider::_grabber_gui_input)); + grabber->connect(SceneStringName(mouse_entered), callable_mp(this, &EditorSpinSlider::_grabber_mouse_entered)); + grabber->connect(SceneStringName(mouse_exited), callable_mp(this, &EditorSpinSlider::_grabber_mouse_exited)); + grabber->connect(SceneStringName(gui_input), callable_mp(this, &EditorSpinSlider::_grabber_gui_input)); } diff --git a/editor/gui/editor_toaster.cpp b/editor/gui/editor_toaster.cpp index 970bf4cb3e5..e857a82fa54 100644 --- a/editor/gui/editor_toaster.cpp +++ b/editor/gui/editor_toaster.cpp @@ -360,7 +360,7 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_ break; } panel->set_modulate(Color(1, 1, 1, 0)); - panel->connect("draw", callable_mp(this, &EditorToaster::_draw_progress).bind(panel)); + panel->connect(SceneStringName(draw), callable_mp(this, &EditorToaster::_draw_progress).bind(panel)); // Horizontal container. HBoxContainer *hbox_container = memnew(HBoxContainer); @@ -377,7 +377,7 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_ 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("theme_changed", callable_mp(this, &EditorToaster::_close_button_theme_changed).bind(close_button)); + close_button->connect(SceneStringName(theme_changed), callable_mp(this, &EditorToaster::_close_button_theme_changed).bind(close_button)); hbox_container->add_child(close_button); } @@ -506,7 +506,7 @@ EditorToaster::EditorToaster() { // VBox. vbox_container = memnew(VBoxContainer); vbox_container->set_as_top_level(true); - vbox_container->connect("resized", callable_mp(this, &EditorToaster::_update_vbox_position)); + vbox_container->connect(SceneStringName(resized), callable_mp(this, &EditorToaster::_update_vbox_position)); add_child(vbox_container); // Theming (background). @@ -546,7 +546,7 @@ EditorToaster::EditorToaster() { 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("draw", callable_mp(this, &EditorToaster::_draw_button)); + main_button->connect(SceneStringName(draw), callable_mp(this, &EditorToaster::_draw_button)); add_child(main_button); // Disable notification button. diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index 7d2a3c1e240..a06dd310ea9 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -373,8 +373,8 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { } if (can_open_instance && is_scene_tree_dock) { // Show buttons only when necessary (SceneTreeDock) to avoid crashes. - if (!p_node->is_connected("script_changed", callable_mp(this, &SceneTreeEditor::_node_script_changed))) { - p_node->connect("script_changed", callable_mp(this, &SceneTreeEditor::_node_script_changed).bind(p_node)); + if (!p_node->is_connected(CoreStringName(script_changed), callable_mp(this, &SceneTreeEditor::_node_script_changed))) { + p_node->connect(CoreStringName(script_changed), callable_mp(this, &SceneTreeEditor::_node_script_changed).bind(p_node)); } Ref