From 69c95f4b4c128a22777af1e155bc24c7033decca Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 19 Feb 2020 16:27:19 -0300 Subject: Reworked signal connection system, added support for Callable and Signal objects and made them default. --- editor/plugins/abstract_polygon_2d_editor.cpp | 10 +- editor/plugins/animation_blend_space_1d_editor.cpp | 32 ++--- editor/plugins/animation_blend_space_2d_editor.cpp | 52 ++++----- .../plugins/animation_blend_tree_editor_plugin.cpp | 42 +++---- editor/plugins/animation_player_editor_plugin.cpp | 54 ++++----- editor/plugins/animation_state_machine_editor.cpp | 32 ++--- editor/plugins/animation_tree_editor_plugin.cpp | 4 +- editor/plugins/asset_library_editor_plugin.cpp | 64 +++++----- editor/plugins/audio_stream_editor_plugin.cpp | 14 +-- editor/plugins/camera_editor_plugin.cpp | 2 +- editor/plugins/canvas_item_editor_plugin.cpp | 106 ++++++++--------- editor/plugins/collision_polygon_editor_plugin.cpp | 6 +- editor/plugins/cpu_particles_2d_editor_plugin.cpp | 6 +- editor/plugins/cpu_particles_editor_plugin.cpp | 2 +- editor/plugins/curve_editor_plugin.cpp | 12 +- editor/plugins/gi_probe_editor_plugin.cpp | 4 +- editor/plugins/gradient_editor_plugin.cpp | 4 +- editor/plugins/item_list_editor_plugin.cpp | 8 +- editor/plugins/material_editor_plugin.cpp | 8 +- editor/plugins/mesh_editor_plugin.cpp | 4 +- editor/plugins/mesh_instance_editor_plugin.cpp | 6 +- editor/plugins/mesh_library_editor_plugin.cpp | 6 +- editor/plugins/multimesh_editor_plugin.cpp | 10 +- editor/plugins/particles_2d_editor_plugin.cpp | 8 +- editor/plugins/particles_editor_plugin.cpp | 12 +- editor/plugins/path_2d_editor_plugin.cpp | 20 ++-- editor/plugins/path_editor_plugin.cpp | 10 +- editor/plugins/physical_bone_plugin.cpp | 2 +- editor/plugins/polygon_2d_editor_plugin.cpp | 42 +++---- .../plugins/resource_preloader_editor_plugin.cpp | 10 +- editor/plugins/root_motion_editor_plugin.cpp | 8 +- editor/plugins/script_editor_plugin.cpp | 130 ++++++++++----------- editor/plugins/script_text_editor.cpp | 74 ++++++------ editor/plugins/shader_editor_plugin.cpp | 24 ++-- editor/plugins/skeleton_2d_editor_plugin.cpp | 2 +- editor/plugins/skeleton_editor_plugin.cpp | 4 +- editor/plugins/skeleton_ik_editor_plugin.cpp | 2 +- editor/plugins/spatial_editor_plugin.cpp | 94 +++++++-------- editor/plugins/sprite_editor_plugin.cpp | 8 +- editor/plugins/sprite_frames_editor_plugin.cpp | 48 ++++---- editor/plugins/style_box_editor_plugin.cpp | 6 +- editor/plugins/text_editor.cpp | 22 ++-- editor/plugins/texture_region_editor_plugin.cpp | 30 ++--- editor/plugins/theme_editor_plugin.cpp | 12 +- editor/plugins/tile_map_editor_plugin.cpp | 56 ++++----- editor/plugins/tile_set_editor_plugin.cpp | 54 ++++----- editor/plugins/version_control_editor_plugin.cpp | 22 ++-- editor/plugins/visual_shader_editor_plugin.cpp | 106 ++++++++--------- 48 files changed, 647 insertions(+), 647 deletions(-) (limited to 'editor/plugins') diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index 2d038d11ad..6f29b6c76a 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -209,8 +209,8 @@ void AbstractPolygon2DEditor::_notification(int p_what) { button_delete->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons")); button_edit->set_pressed(true); - get_tree()->connect("node_removed", this, "_node_removed"); - create_resource->connect("confirmed", this, "_create_resource"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); + create_resource->connect_compat("confirmed", this, "_create_resource"); } break; } } @@ -820,17 +820,17 @@ AbstractPolygon2DEditor::AbstractPolygon2DEditor(EditorNode *p_editor, bool p_wi add_child(memnew(VSeparator)); button_create = memnew(ToolButton); add_child(button_create); - button_create->connect("pressed", this, "_menu_option", varray(MODE_CREATE)); + button_create->connect_compat("pressed", this, "_menu_option", varray(MODE_CREATE)); button_create->set_toggle_mode(true); button_edit = memnew(ToolButton); add_child(button_edit); - button_edit->connect("pressed", this, "_menu_option", varray(MODE_EDIT)); + button_edit->connect_compat("pressed", this, "_menu_option", varray(MODE_EDIT)); button_edit->set_toggle_mode(true); button_delete = memnew(ToolButton); add_child(button_delete); - button_delete->connect("pressed", this, "_menu_option", varray(MODE_DELETE)); + button_delete->connect_compat("pressed", this, "_menu_option", varray(MODE_DELETE)); button_delete->set_toggle_mode(true); create_resource = memnew(ConfirmationDialog); diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index 9261613ddd..c955f2b806 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -622,28 +622,28 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { top_hb->add_child(tool_blend); tool_blend->set_pressed(true); tool_blend->set_tooltip(TTR("Set the blending position within the space")); - tool_blend->connect("pressed", this, "_tool_switch", varray(3)); + tool_blend->connect_compat("pressed", this, "_tool_switch", varray(3)); tool_select = memnew(ToolButton); tool_select->set_toggle_mode(true); tool_select->set_button_group(bg); top_hb->add_child(tool_select); tool_select->set_tooltip(TTR("Select and move points, create points with RMB.")); - tool_select->connect("pressed", this, "_tool_switch", varray(0)); + tool_select->connect_compat("pressed", this, "_tool_switch", varray(0)); tool_create = memnew(ToolButton); tool_create->set_toggle_mode(true); tool_create->set_button_group(bg); top_hb->add_child(tool_create); tool_create->set_tooltip(TTR("Create points.")); - tool_create->connect("pressed", this, "_tool_switch", varray(1)); + tool_create->connect_compat("pressed", this, "_tool_switch", varray(1)); tool_erase_sep = memnew(VSeparator); top_hb->add_child(tool_erase_sep); tool_erase = memnew(ToolButton); top_hb->add_child(tool_erase); tool_erase->set_tooltip(TTR("Erase points.")); - tool_erase->connect("pressed", this, "_erase_selected"); + tool_erase->connect_compat("pressed", this, "_erase_selected"); top_hb->add_child(memnew(VSeparator)); @@ -652,7 +652,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { top_hb->add_child(snap); snap->set_pressed(true); snap->set_tooltip(TTR("Enable snap and show grid.")); - snap->connect("pressed", this, "_snap_toggled"); + snap->connect_compat("pressed", this, "_snap_toggled"); snap_value = memnew(SpinBox); top_hb->add_child(snap_value); @@ -670,12 +670,12 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { edit_value->set_min(-1000); edit_value->set_max(1000); edit_value->set_step(0.01); - edit_value->connect("value_changed", this, "_edit_point_pos"); + edit_value->connect_compat("value_changed", this, "_edit_point_pos"); open_editor = memnew(Button); edit_hb->add_child(open_editor); open_editor->set_text(TTR("Open Editor")); - open_editor->connect("pressed", this, "_open_editor", varray(), CONNECT_DEFERRED); + open_editor->connect_compat("pressed", this, "_open_editor", varray(), CONNECT_DEFERRED); edit_hb->hide(); open_editor->hide(); @@ -691,8 +691,8 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { panel->set_v_size_flags(SIZE_EXPAND_FILL); blend_space_draw = memnew(Control); - blend_space_draw->connect("gui_input", this, "_blend_space_gui_input"); - blend_space_draw->connect("draw", this, "_blend_space_draw"); + blend_space_draw->connect_compat("gui_input", this, "_blend_space_gui_input"); + blend_space_draw->connect_compat("draw", this, "_blend_space_draw"); blend_space_draw->set_focus_mode(FOCUS_ALL); panel->add_child(blend_space_draw); @@ -724,10 +724,10 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { bottom_hb->add_child(max_value); } - snap_value->connect("value_changed", this, "_config_changed"); - min_value->connect("value_changed", this, "_config_changed"); - max_value->connect("value_changed", this, "_config_changed"); - label_value->connect("text_changed", this, "_labels_changed"); + snap_value->connect_compat("value_changed", this, "_config_changed"); + min_value->connect_compat("value_changed", this, "_config_changed"); + max_value->connect_compat("value_changed", this, "_config_changed"); + label_value->connect_compat("text_changed", this, "_labels_changed"); error_panel = memnew(PanelContainer); add_child(error_panel); @@ -740,18 +740,18 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_add_menu_type"); + menu->connect_compat("id_pressed", this, "_add_menu_type"); animations_menu = memnew(PopupMenu); menu->add_child(animations_menu); animations_menu->set_name("animations"); - animations_menu->connect("index_pressed", this, "_add_animation_type"); + animations_menu->connect_compat("index_pressed", this, "_add_animation_type"); open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - open_file->connect("file_selected", this, "_file_opened"); + open_file->connect_compat("file_selected", this, "_file_opened"); undo_redo = EditorNode::get_undo_redo(); selected_point = -1; diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index fdd8ffd58f..d2306a5d6b 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -55,12 +55,12 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_changed() { void AnimationNodeBlendSpace2DEditor::edit(const Ref &p_node) { if (blend_space.is_valid()) { - blend_space->disconnect("triangles_updated", this, "_blend_space_changed"); + blend_space->disconnect_compat("triangles_updated", this, "_blend_space_changed"); } blend_space = p_node; if (!blend_space.is_null()) { - blend_space->connect("triangles_updated", this, "_blend_space_changed"); + blend_space->connect_compat("triangles_updated", this, "_blend_space_changed"); _update_space(); } } @@ -870,42 +870,42 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(tool_blend); tool_blend->set_pressed(true); tool_blend->set_tooltip(TTR("Set the blending position within the space")); - tool_blend->connect("pressed", this, "_tool_switch", varray(3)); + tool_blend->connect_compat("pressed", this, "_tool_switch", varray(3)); tool_select = memnew(ToolButton); tool_select->set_toggle_mode(true); tool_select->set_button_group(bg); top_hb->add_child(tool_select); tool_select->set_tooltip(TTR("Select and move points, create points with RMB.")); - tool_select->connect("pressed", this, "_tool_switch", varray(0)); + tool_select->connect_compat("pressed", this, "_tool_switch", varray(0)); tool_create = memnew(ToolButton); tool_create->set_toggle_mode(true); tool_create->set_button_group(bg); top_hb->add_child(tool_create); tool_create->set_tooltip(TTR("Create points.")); - tool_create->connect("pressed", this, "_tool_switch", varray(1)); + tool_create->connect_compat("pressed", this, "_tool_switch", varray(1)); tool_triangle = memnew(ToolButton); tool_triangle->set_toggle_mode(true); tool_triangle->set_button_group(bg); top_hb->add_child(tool_triangle); tool_triangle->set_tooltip(TTR("Create triangles by connecting points.")); - tool_triangle->connect("pressed", this, "_tool_switch", varray(2)); + tool_triangle->connect_compat("pressed", this, "_tool_switch", varray(2)); tool_erase_sep = memnew(VSeparator); top_hb->add_child(tool_erase_sep); tool_erase = memnew(ToolButton); top_hb->add_child(tool_erase); tool_erase->set_tooltip(TTR("Erase points and triangles.")); - tool_erase->connect("pressed", this, "_erase_selected"); + tool_erase->connect_compat("pressed", this, "_erase_selected"); tool_erase->set_disabled(true); top_hb->add_child(memnew(VSeparator)); auto_triangles = memnew(ToolButton); top_hb->add_child(auto_triangles); - auto_triangles->connect("pressed", this, "_auto_triangles_toggled"); + auto_triangles->connect_compat("pressed", this, "_auto_triangles_toggled"); auto_triangles->set_toggle_mode(true); auto_triangles->set_tooltip(TTR("Generate blend triangles automatically (instead of manually)")); @@ -916,7 +916,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(snap); snap->set_pressed(true); snap->set_tooltip(TTR("Enable snap and show grid.")); - snap->connect("pressed", this, "_snap_toggled"); + snap->connect_compat("pressed", this, "_snap_toggled"); snap_x = memnew(SpinBox); top_hb->add_child(snap_x); @@ -937,7 +937,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { top_hb->add_child(memnew(Label(TTR("Blend:")))); interpolation = memnew(OptionButton); top_hb->add_child(interpolation); - interpolation->connect("item_selected", this, "_config_changed"); + interpolation->connect_compat("item_selected", this, "_config_changed"); edit_hb = memnew(HBoxContainer); top_hb->add_child(edit_hb); @@ -948,17 +948,17 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { edit_x->set_min(-1000); edit_x->set_step(0.01); edit_x->set_max(1000); - edit_x->connect("value_changed", this, "_edit_point_pos"); + edit_x->connect_compat("value_changed", this, "_edit_point_pos"); edit_y = memnew(SpinBox); edit_hb->add_child(edit_y); edit_y->set_min(-1000); edit_y->set_step(0.01); edit_y->set_max(1000); - edit_y->connect("value_changed", this, "_edit_point_pos"); + edit_y->connect_compat("value_changed", this, "_edit_point_pos"); open_editor = memnew(Button); edit_hb->add_child(open_editor); open_editor->set_text(TTR("Open Editor")); - open_editor->connect("pressed", this, "_open_editor", varray(), CONNECT_DEFERRED); + open_editor->connect_compat("pressed", this, "_open_editor", varray(), CONNECT_DEFERRED); edit_hb->hide(); open_editor->hide(); @@ -999,8 +999,8 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { panel->set_h_size_flags(SIZE_EXPAND_FILL); blend_space_draw = memnew(Control); - blend_space_draw->connect("gui_input", this, "_blend_space_gui_input"); - blend_space_draw->connect("draw", this, "_blend_space_draw"); + blend_space_draw->connect_compat("gui_input", this, "_blend_space_gui_input"); + blend_space_draw->connect_compat("draw", this, "_blend_space_draw"); blend_space_draw->set_focus_mode(FOCUS_ALL); panel->add_child(blend_space_draw); @@ -1029,14 +1029,14 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { min_x_value->set_step(0.01); } - snap_x->connect("value_changed", this, "_config_changed"); - snap_y->connect("value_changed", this, "_config_changed"); - max_x_value->connect("value_changed", this, "_config_changed"); - min_x_value->connect("value_changed", this, "_config_changed"); - max_y_value->connect("value_changed", this, "_config_changed"); - min_y_value->connect("value_changed", this, "_config_changed"); - label_x->connect("text_changed", this, "_labels_changed"); - label_y->connect("text_changed", this, "_labels_changed"); + snap_x->connect_compat("value_changed", this, "_config_changed"); + snap_y->connect_compat("value_changed", this, "_config_changed"); + max_x_value->connect_compat("value_changed", this, "_config_changed"); + min_x_value->connect_compat("value_changed", this, "_config_changed"); + max_y_value->connect_compat("value_changed", this, "_config_changed"); + min_y_value->connect_compat("value_changed", this, "_config_changed"); + label_x->connect_compat("text_changed", this, "_labels_changed"); + label_y->connect_compat("text_changed", this, "_labels_changed"); error_panel = memnew(PanelContainer); add_child(error_panel); @@ -1050,18 +1050,18 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_add_menu_type"); + menu->connect_compat("id_pressed", this, "_add_menu_type"); animations_menu = memnew(PopupMenu); menu->add_child(animations_menu); animations_menu->set_name("animations"); - animations_menu->connect("index_pressed", this, "_add_animation_type"); + animations_menu->connect_compat("index_pressed", this, "_add_animation_type"); open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - open_file->connect("file_selected", this, "_file_opened"); + open_file->connect_compat("file_selected", this, "_file_opened"); undo_redo = EditorNode::get_undo_redo(); selected_point = -1; diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index a100525d10..f2daa809b4 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -146,11 +146,11 @@ void AnimationNodeBlendTreeEditor::_update_graph() { name->set_expand_to_text_length(true); node->add_child(name); node->set_slot(0, false, 0, Color(), true, 0, get_color("font_color", "Label")); - name->connect("text_entered", this, "_node_renamed", varray(agnode)); - name->connect("focus_exited", this, "_node_renamed_focus_out", varray(name, agnode), CONNECT_DEFERRED); + name->connect_compat("text_entered", this, "_node_renamed", varray(agnode)); + name->connect_compat("focus_exited", this, "_node_renamed_focus_out", varray(name, agnode), CONNECT_DEFERRED); base = 1; node->set_show_close_button(true); - node->connect("close_request", this, "_delete_request", varray(E->get()), CONNECT_DEFERRED); + node->connect_compat("close_request", this, "_delete_request", varray(E->get()), CONNECT_DEFERRED); } for (int i = 0; i < agnode->get_input_count(); i++) { @@ -173,13 +173,13 @@ void AnimationNodeBlendTreeEditor::_update_graph() { prop->set_object_and_property(AnimationTreeEditor::get_singleton()->get_tree(), base_path); prop->update_property(); prop->set_name_split_ratio(0); - prop->connect("property_changed", this, "_property_changed"); + prop->connect_compat("property_changed", this, "_property_changed"); node->add_child(prop); visible_properties.push_back(prop); } } - node->connect("dragged", this, "_node_dragged", varray(E->get())); + node->connect_compat("dragged", this, "_node_dragged", varray(E->get())); if (AnimationTreeEditor::get_singleton()->can_edit(agnode)) { node->add_child(memnew(HSeparator)); @@ -187,7 +187,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { open_in_editor->set_text(TTR("Open Editor")); open_in_editor->set_icon(get_icon("Edit", "EditorIcons")); node->add_child(open_in_editor); - open_in_editor->connect("pressed", this, "_open_in_editor", varray(E->get()), CONNECT_DEFERRED); + open_in_editor->connect_compat("pressed", this, "_open_in_editor", varray(E->get()), CONNECT_DEFERRED); open_in_editor->set_h_size_flags(SIZE_SHRINK_CENTER); } @@ -198,7 +198,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { edit_filters->set_text(TTR("Edit Filters")); edit_filters->set_icon(get_icon("AnimationFilter", "EditorIcons")); node->add_child(edit_filters); - edit_filters->connect("pressed", this, "_edit_filters", varray(E->get()), CONNECT_DEFERRED); + edit_filters->connect_compat("pressed", this, "_edit_filters", varray(E->get()), CONNECT_DEFERRED); edit_filters->set_h_size_flags(SIZE_SHRINK_CENTER); } @@ -238,7 +238,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() { animations[E->get()] = pb; node->add_child(pb); - mb->get_popup()->connect("index_pressed", this, "_anim_selected", varray(options, E->get()), CONNECT_DEFERRED); + mb->get_popup()->connect_compat("index_pressed", this, "_anim_selected", varray(options, E->get()), CONNECT_DEFERRED); } if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) { @@ -911,7 +911,7 @@ bool AnimationNodeBlendTreeEditor::can_edit(const Ref &p_node) { void AnimationNodeBlendTreeEditor::edit(const Ref &p_node) { if (blend_tree.is_valid()) { - blend_tree->disconnect("removed_from_graph", this, "_removed_from_graph"); + blend_tree->disconnect_compat("removed_from_graph", this, "_removed_from_graph"); } blend_tree = p_node; @@ -919,7 +919,7 @@ void AnimationNodeBlendTreeEditor::edit(const Ref &p_node) { if (blend_tree.is_null()) { hide(); } else { - blend_tree->connect("removed_from_graph", this, "_removed_from_graph"); + blend_tree->connect_compat("removed_from_graph", this, "_removed_from_graph"); _update_graph(); } @@ -936,12 +936,12 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { graph->add_valid_right_disconnect_type(0); graph->add_valid_left_disconnect_type(0); graph->set_v_size_flags(SIZE_EXPAND_FILL); - graph->connect("connection_request", this, "_connection_request", varray(), CONNECT_DEFERRED); - graph->connect("disconnection_request", this, "_disconnection_request", varray(), CONNECT_DEFERRED); - graph->connect("node_selected", this, "_node_selected"); - graph->connect("scroll_offset_changed", this, "_scroll_changed"); - graph->connect("delete_nodes_request", this, "_delete_nodes_request"); - graph->connect("popup_request", this, "_popup_request"); + graph->connect_compat("connection_request", this, "_connection_request", varray(), CONNECT_DEFERRED); + graph->connect_compat("disconnection_request", this, "_disconnection_request", varray(), CONNECT_DEFERRED); + graph->connect_compat("node_selected", this, "_node_selected"); + graph->connect_compat("scroll_offset_changed", this, "_scroll_changed"); + graph->connect_compat("delete_nodes_request", this, "_delete_nodes_request"); + graph->connect_compat("popup_request", this, "_popup_request"); VSeparator *vs = memnew(VSeparator); graph->get_zoom_hbox()->add_child(vs); @@ -951,8 +951,8 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { graph->get_zoom_hbox()->add_child(add_node); add_node->set_text(TTR("Add Node...")); graph->get_zoom_hbox()->move_child(add_node, 0); - add_node->get_popup()->connect("id_pressed", this, "_add_node"); - add_node->connect("about_to_show", this, "_update_options_menu"); + add_node->get_popup()->connect_compat("id_pressed", this, "_add_node"); + add_node->connect_compat("about_to_show", this, "_update_options_menu"); add_options.push_back(AddOption("Animation", "AnimationNodeAnimation")); add_options.push_back(AddOption("OneShot", "AnimationNodeOneShot")); @@ -984,19 +984,19 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { filter_enabled = memnew(CheckBox); filter_enabled->set_text(TTR("Enable Filtering")); - filter_enabled->connect("pressed", this, "_filter_toggled"); + filter_enabled->connect_compat("pressed", this, "_filter_toggled"); filter_vbox->add_child(filter_enabled); filters = memnew(Tree); filter_vbox->add_child(filters); filters->set_v_size_flags(SIZE_EXPAND_FILL); filters->set_hide_root(true); - filters->connect("item_edited", this, "_filter_edited"); + filters->connect_compat("item_edited", this, "_filter_edited"); open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - open_file->connect("file_selected", this, "_file_opened"); + open_file->connect_compat("file_selected", this, "_file_opened"); undo_redo = EditorNode::get_undo_redo(); } diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index d8bbac9c49..26c3c21d61 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -99,13 +99,13 @@ void AnimationPlayerEditor::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - tool_anim->get_popup()->connect("id_pressed", this, "_animation_tool_menu"); + tool_anim->get_popup()->connect_compat("id_pressed", this, "_animation_tool_menu"); - onion_skinning->get_popup()->connect("id_pressed", this, "_onion_skinning_menu"); + onion_skinning->get_popup()->connect_compat("id_pressed", this, "_onion_skinning_menu"); - blend_editor.next->connect("item_selected", this, "_blend_editor_next_changed"); + blend_editor.next->connect_compat("item_selected", this, "_blend_editor_next_changed"); - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); add_style_override("panel", editor->get_gui_base()->get_stylebox("panel", "Panel")); } break; @@ -1504,16 +1504,16 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() { void AnimationPlayerEditor::_start_onion_skinning() { // FIXME: Using "idle_frame" makes onion layers update one frame behind the current. - if (!get_tree()->is_connected("idle_frame", this, "call_deferred")) { - get_tree()->connect("idle_frame", this, "call_deferred", varray("_prepare_onion_layers_1")); + if (!get_tree()->is_connected_compat("idle_frame", this, "call_deferred")) { + get_tree()->connect_compat("idle_frame", this, "call_deferred", varray("_prepare_onion_layers_1")); } } void AnimationPlayerEditor::_stop_onion_skinning() { - if (get_tree()->is_connected("idle_frame", this, "call_deferred")) { + if (get_tree()->is_connected_compat("idle_frame", this, "call_deferred")) { - get_tree()->disconnect("idle_frame", this, "call_deferred"); + get_tree()->disconnect_compat("idle_frame", this, "call_deferred"); _free_onion_layers(); @@ -1630,11 +1630,11 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay accept = memnew(AcceptDialog); add_child(accept); - accept->connect("confirmed", this, "_menu_confirm_current"); + accept->connect_compat("confirmed", this, "_menu_confirm_current"); delete_dialog = memnew(ConfirmationDialog); add_child(delete_dialog); - delete_dialog->connect("confirmed", this, "_animation_remove_confirmed"); + delete_dialog->connect_compat("confirmed", this, "_animation_remove_confirmed"); tool_anim = memnew(MenuButton); tool_anim->set_flat(false); @@ -1679,7 +1679,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay onion_toggle = memnew(ToolButton); onion_toggle->set_toggle_mode(true); onion_toggle->set_tooltip(TTR("Enable Onion Skinning")); - onion_toggle->connect("pressed", this, "_onion_skinning_menu", varray(ONION_SKINNING_ENABLE)); + onion_toggle->connect_compat("pressed", this, "_onion_skinning_menu", varray(ONION_SKINNING_ENABLE)); hb->add_child(onion_toggle); onion_skinning = memnew(MenuButton); @@ -1705,7 +1705,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay pin->set_toggle_mode(true); pin->set_tooltip(TTR("Pin AnimationPlayer")); hb->add_child(pin); - pin->connect("pressed", this, "_pin_pressed"); + pin->connect_compat("pressed", this, "_pin_pressed"); file = memnew(EditorFileDialog); add_child(file); @@ -1729,7 +1729,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay error_dialog->set_title(TTR("Error!")); add_child(error_dialog); - name_dialog->connect("confirmed", this, "_animation_name_edited"); + name_dialog->connect_compat("confirmed", this, "_animation_name_edited"); blend_editor.dialog = memnew(AcceptDialog); add_child(blend_editor.dialog); @@ -1745,21 +1745,21 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay blend_editor.dialog->set_title(TTR("Cross-Animation Blend Times")); updating_blends = false; - blend_editor.tree->connect("item_edited", this, "_blend_edited"); + blend_editor.tree->connect_compat("item_edited", this, "_blend_edited"); - autoplay->connect("pressed", this, "_autoplay_pressed"); + autoplay->connect_compat("pressed", this, "_autoplay_pressed"); autoplay->set_toggle_mode(true); - play->connect("pressed", this, "_play_pressed"); - play_from->connect("pressed", this, "_play_from_pressed"); - play_bw->connect("pressed", this, "_play_bw_pressed"); - play_bw_from->connect("pressed", this, "_play_bw_from_pressed"); - stop->connect("pressed", this, "_stop_pressed"); + play->connect_compat("pressed", this, "_play_pressed"); + play_from->connect_compat("pressed", this, "_play_from_pressed"); + play_bw->connect_compat("pressed", this, "_play_bw_pressed"); + play_bw_from->connect_compat("pressed", this, "_play_bw_from_pressed"); + stop->connect_compat("pressed", this, "_stop_pressed"); - animation->connect("item_selected", this, "_animation_selected", Vector(), true); + animation->connect_compat("item_selected", this, "_animation_selected", Vector(), true); - file->connect("file_selected", this, "_dialog_action"); - frame->connect("value_changed", this, "_seek_value_changed", Vector(), true); - scale->connect("text_entered", this, "_scale_changed", Vector(), true); + file->connect_compat("file_selected", this, "_dialog_action"); + frame->connect_compat("value_changed", this, "_seek_value_changed", Vector(), true); + scale->connect_compat("text_entered", this, "_scale_changed", Vector(), true); renaming = false; last_active = false; @@ -1769,14 +1769,14 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay add_child(track_editor); track_editor->set_v_size_flags(SIZE_EXPAND_FILL); - track_editor->connect("timeline_changed", this, "_animation_key_editor_seek"); - track_editor->connect("animation_len_changed", this, "_animation_key_editor_anim_len_changed"); + track_editor->connect_compat("timeline_changed", this, "_animation_key_editor_seek"); + track_editor->connect_compat("animation_len_changed", this, "_animation_key_editor_anim_len_changed"); _update_player(); // Onion skinning. - track_editor->connect("visibility_changed", this, "_editor_visibility_changed"); + track_editor->connect_compat("visibility_changed", this, "_editor_visibility_changed"); onion.enabled = false; onion.past = true; diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 035a67b821..6f29aba356 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1276,21 +1276,21 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_select->set_button_group(bg); tool_select->set_pressed(true); tool_select->set_tooltip(TTR("Select and move nodes.\nRMB to add new nodes.\nShift+LMB to create connections.")); - tool_select->connect("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); + tool_select->connect_compat("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); tool_create = memnew(ToolButton); top_hb->add_child(tool_create); tool_create->set_toggle_mode(true); tool_create->set_button_group(bg); tool_create->set_tooltip(TTR("Create new nodes.")); - tool_create->connect("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); + tool_create->connect_compat("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); tool_connect = memnew(ToolButton); top_hb->add_child(tool_connect); tool_connect->set_toggle_mode(true); tool_connect->set_button_group(bg); tool_connect->set_tooltip(TTR("Connect nodes.")); - tool_connect->connect("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); + tool_connect->connect_compat("pressed", this, "_update_mode", varray(), CONNECT_DEFERRED); tool_erase_hb = memnew(HBoxContainer); top_hb->add_child(tool_erase_hb); @@ -1298,7 +1298,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_erase = memnew(ToolButton); tool_erase->set_tooltip(TTR("Remove selected node or transition.")); tool_erase_hb->add_child(tool_erase); - tool_erase->connect("pressed", this, "_erase_selected"); + tool_erase->connect_compat("pressed", this, "_erase_selected"); tool_erase->set_disabled(true); tool_erase_hb->add_child(memnew(VSeparator)); @@ -1306,13 +1306,13 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { tool_autoplay = memnew(ToolButton); tool_autoplay->set_tooltip(TTR("Toggle autoplay this animation on start, restart or seek to zero.")); tool_erase_hb->add_child(tool_autoplay); - tool_autoplay->connect("pressed", this, "_autoplay_selected"); + tool_autoplay->connect_compat("pressed", this, "_autoplay_selected"); tool_autoplay->set_disabled(true); tool_end = memnew(ToolButton); tool_end->set_tooltip(TTR("Set the end animation. This is useful for sub-transitions.")); tool_erase_hb->add_child(tool_end); - tool_end->connect("pressed", this, "_end_selected"); + tool_end->connect_compat("pressed", this, "_end_selected"); tool_end->set_disabled(true); top_hb->add_child(memnew(VSeparator)); @@ -1333,26 +1333,26 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { state_machine_draw = memnew(Control); panel->add_child(state_machine_draw); - state_machine_draw->connect("gui_input", this, "_state_machine_gui_input"); - state_machine_draw->connect("draw", this, "_state_machine_draw"); + state_machine_draw->connect_compat("gui_input", this, "_state_machine_gui_input"); + state_machine_draw->connect_compat("draw", this, "_state_machine_draw"); state_machine_draw->set_focus_mode(FOCUS_ALL); state_machine_play_pos = memnew(Control); state_machine_draw->add_child(state_machine_play_pos); state_machine_play_pos->set_mouse_filter(MOUSE_FILTER_PASS); //pass all to parent state_machine_play_pos->set_anchors_and_margins_preset(PRESET_WIDE); - state_machine_play_pos->connect("draw", this, "_state_machine_pos_draw"); + state_machine_play_pos->connect_compat("draw", this, "_state_machine_pos_draw"); v_scroll = memnew(VScrollBar); state_machine_draw->add_child(v_scroll); v_scroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE); - v_scroll->connect("value_changed", this, "_scroll_changed"); + v_scroll->connect_compat("value_changed", this, "_scroll_changed"); h_scroll = memnew(HScrollBar); state_machine_draw->add_child(h_scroll); h_scroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE); h_scroll->set_margin(MARGIN_RIGHT, -v_scroll->get_size().x * EDSCALE); - h_scroll->connect("value_changed", this, "_scroll_changed"); + h_scroll->connect_compat("value_changed", this, "_scroll_changed"); error_panel = memnew(PanelContainer); add_child(error_panel); @@ -1366,25 +1366,25 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { menu = memnew(PopupMenu); add_child(menu); - menu->connect("id_pressed", this, "_add_menu_type"); + menu->connect_compat("id_pressed", this, "_add_menu_type"); animations_menu = memnew(PopupMenu); menu->add_child(animations_menu); animations_menu->set_name("animations"); - animations_menu->connect("index_pressed", this, "_add_animation_type"); + animations_menu->connect_compat("index_pressed", this, "_add_animation_type"); name_edit = memnew(LineEdit); state_machine_draw->add_child(name_edit); name_edit->hide(); - name_edit->connect("text_entered", this, "_name_edited"); - name_edit->connect("focus_exited", this, "_name_edited_focus_out"); + name_edit->connect_compat("text_entered", this, "_name_edited"); + name_edit->connect_compat("focus_exited", this, "_name_edited_focus_out"); name_edit->set_as_toplevel(true); open_file = memnew(EditorFileDialog); add_child(open_file); open_file->set_title(TTR("Open Animation Node")); open_file->set_mode(EditorFileDialog::MODE_OPEN_FILE); - open_file->connect("file_selected", this, "_file_opened"); + open_file->connect_compat("file_selected", this, "_file_opened"); undo_redo = EditorNode::get_undo_redo(); over_text = false; diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index a729c90160..8900882725 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -85,7 +85,7 @@ void AnimationTreeEditor::_update_path() { b->set_button_group(group); b->set_pressed(true); b->set_focus_mode(FOCUS_NONE); - b->connect("pressed", this, "_path_button_pressed", varray(-1)); + b->connect_compat("pressed", this, "_path_button_pressed", varray(-1)); path_hb->add_child(b); for (int i = 0; i < button_path.size(); i++) { b = memnew(Button); @@ -95,7 +95,7 @@ void AnimationTreeEditor::_update_path() { path_hb->add_child(b); b->set_pressed(true); b->set_focus_mode(FOCUS_NONE); - b->connect("pressed", this, "_path_button_pressed", varray(i)); + b->connect_compat("pressed", this, "_path_button_pressed", varray(i)); } } diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 3d47dd46db..01c3c33995 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -112,7 +112,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() { icon = memnew(TextureButton); icon->set_custom_minimum_size(Size2(64, 64) * EDSCALE); icon->set_default_cursor_shape(CURSOR_POINTING_HAND); - icon->connect("pressed", this, "_asset_clicked"); + icon->connect_compat("pressed", this, "_asset_clicked"); hb->add_child(icon); @@ -123,17 +123,17 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() { title = memnew(LinkButton); title->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); - title->connect("pressed", this, "_asset_clicked"); + title->connect_compat("pressed", this, "_asset_clicked"); vb->add_child(title); category = memnew(LinkButton); category->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); - category->connect("pressed", this, "_category_clicked"); + category->connect_compat("pressed", this, "_category_clicked"); vb->add_child(category); author = memnew(LinkButton); author->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); - author->connect("pressed", this, "_author_clicked"); + author->connect_compat("pressed", this, "_author_clicked"); vb->add_child(author); price = memnew(Label); @@ -263,7 +263,7 @@ void EditorAssetLibraryItemDescription::add_preview(int p_id, bool p_video, cons preview.button->set_flat(true); preview.button->set_icon(get_icon("ThumbnailWait", "EditorIcons")); preview.button->set_toggle_mode(true); - preview.button->connect("pressed", this, "_preview_click", varray(p_id)); + preview.button->connect_compat("pressed", this, "_preview_click", varray(p_id)); preview_hb->add_child(preview.button); if (!p_video) { preview.image = get_icon("ThumbnailWait", "EditorIcons"); @@ -290,7 +290,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { description = memnew(RichTextLabel); desc_vbox->add_child(description); description->set_v_size_flags(SIZE_EXPAND_FILL); - description->connect("meta_clicked", this, "_link_click"); + description->connect_compat("meta_clicked", this, "_link_click"); description->add_constant_override("line_separation", Math::round(5 * EDSCALE)); VBoxContainer *previews_vbox = memnew(VBoxContainer); @@ -526,7 +526,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { title->set_h_size_flags(SIZE_EXPAND_FILL); dismiss = memnew(TextureButton); - dismiss->connect("pressed", this, "_close"); + dismiss->connect_compat("pressed", this, "_close"); title_hb->add_child(dismiss); title->set_clip_text(true); @@ -546,11 +546,11 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { install = memnew(Button); install->set_text(TTR("Install...")); install->set_disabled(true); - install->connect("pressed", this, "_install"); + install->connect_compat("pressed", this, "_install"); retry = memnew(Button); retry->set_text(TTR("Retry")); - retry->connect("pressed", this, "_make_request"); + retry->connect_compat("pressed", this, "_make_request"); hb2->add_child(retry); hb2->add_child(install); @@ -558,7 +558,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { download = memnew(HTTPRequest); add_child(download); - download->connect("request_completed", this, "_http_download_completed"); + download->connect_compat("request_completed", this, "_http_download_completed"); download->set_use_threads(EDITOR_DEF("asset_library/use_threads", true)); download_error = memnew(AcceptDialog); @@ -567,7 +567,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() { asset_installer = memnew(EditorAssetInstaller); add_child(asset_installer); - asset_installer->connect("confirmed", this, "_close"); + asset_installer->connect_compat("confirmed", this, "_close"); prev_status = -1; @@ -657,7 +657,7 @@ void EditorAssetLibrary::_install_asset() { if (templates_only) { download->set_external_install(true); - download->connect("install_asset", this, "_install_external_asset"); + download->connect_compat("install_asset", this, "_install_external_asset"); } } @@ -892,7 +892,7 @@ void EditorAssetLibrary::_request_image(ObjectID p_for, String p_image_url, Imag iq.queue_id = ++last_queue_id; iq.active = false; - iq.request->connect("request_completed", this, "_image_request_completed", varray(iq.queue_id)); + iq.request->connect_compat("request_completed", this, "_image_request_completed", varray(iq.queue_id)); image_queue[iq.queue_id] = iq; @@ -991,7 +991,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *first = memnew(Button); first->set_text(TTR("First")); if (p_page != 0) { - first->connect("pressed", this, "_search", varray(0)); + first->connect_compat("pressed", this, "_search", varray(0)); } else { first->set_disabled(true); first->set_focus_mode(Control::FOCUS_NONE); @@ -1001,7 +1001,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *prev = memnew(Button); prev->set_text(TTR("Previous")); if (p_page > 0) { - prev->connect("pressed", this, "_search", varray(p_page - 1)); + prev->connect_compat("pressed", this, "_search", varray(p_page - 1)); } else { prev->set_disabled(true); prev->set_focus_mode(Control::FOCUS_NONE); @@ -1023,7 +1023,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *current = memnew(Button); current->set_text(itos(i + 1)); - current->connect("pressed", this, "_search", varray(i)); + current->connect_compat("pressed", this, "_search", varray(i)); hbc->add_child(current); } @@ -1032,7 +1032,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *next = memnew(Button); next->set_text(TTR("Next")); if (p_page < p_page_count - 1) { - next->connect("pressed", this, "_search", varray(p_page + 1)); + next->connect_compat("pressed", this, "_search", varray(p_page + 1)); } else { next->set_disabled(true); next->set_focus_mode(Control::FOCUS_NONE); @@ -1043,7 +1043,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int Button *last = memnew(Button); last->set_text(TTR("Last")); if (p_page != p_page_count - 1) { - last->connect("pressed", this, "_search", varray(p_page_count - 1)); + last->connect_compat("pressed", this, "_search", varray(p_page_count - 1)); } else { last->set_disabled(true); last->set_focus_mode(Control::FOCUS_NONE); @@ -1229,9 +1229,9 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const EditorAssetLibraryItem *item = memnew(EditorAssetLibraryItem); asset_items->add_child(item); item->configure(r["title"], r["asset_id"], category_map[r["category_id"]], r["category_id"], r["author"], r["author_id"], r["cost"]); - item->connect("asset_selected", this, "_select_asset"); - item->connect("author_selected", this, "_select_author"); - item->connect("category_selected", this, "_select_category"); + item->connect_compat("asset_selected", this, "_select_asset"); + item->connect_compat("author_selected", this, "_select_author"); + item->connect_compat("category_selected", this, "_select_category"); if (r.has("icon_url") && r["icon_url"] != "") { _request_image(item->get_instance_id(), r["icon_url"], IMAGE_QUEUE_ICON, 0); @@ -1262,7 +1262,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const description = memnew(EditorAssetLibraryItemDescription); add_child(description); description->popup_centered_minsize(); - description->connect("confirmed", this, "_install_asset"); + description->connect_compat("confirmed", this, "_install_asset"); description->configure(r["title"], r["asset_id"], category_map[r["category_id"]], r["category_id"], r["author"], r["author_id"], r["cost"], r["version"], r["version_string"], r["description"], r["download_url"], r["browse_url"], r["download_hash"]); @@ -1374,9 +1374,9 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { filter = memnew(LineEdit); search_hb->add_child(filter); filter->set_h_size_flags(SIZE_EXPAND_FILL); - filter->connect("text_entered", this, "_search_text_entered"); + filter->connect_compat("text_entered", this, "_search_text_entered"); search = memnew(Button(TTR("Search"))); - search->connect("pressed", this, "_search"); + search->connect_compat("pressed", this, "_search"); search_hb->add_child(search); if (!p_templates_only) @@ -1385,12 +1385,12 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { Button *open_asset = memnew(Button); open_asset->set_text(TTR("Import...")); search_hb->add_child(open_asset); - open_asset->connect("pressed", this, "_asset_open"); + open_asset->connect_compat("pressed", this, "_asset_open"); Button *plugins = memnew(Button); plugins->set_text(TTR("Plugins...")); search_hb->add_child(plugins); - plugins->connect("pressed", this, "_manage_plugins"); + plugins->connect_compat("pressed", this, "_manage_plugins"); if (p_templates_only) { open_asset->hide(); @@ -1409,7 +1409,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { search_hb2->add_child(sort); sort->set_h_size_flags(SIZE_EXPAND_FILL); - sort->connect("item_selected", this, "_rerun_search"); + sort->connect_compat("item_selected", this, "_rerun_search"); search_hb2->add_child(memnew(VSeparator)); @@ -1418,7 +1418,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { categories->add_item(TTR("All")); search_hb2->add_child(categories); categories->set_h_size_flags(SIZE_EXPAND_FILL); - categories->connect("item_selected", this, "_rerun_search"); + categories->connect_compat("item_selected", this, "_rerun_search"); search_hb2->add_child(memnew(VSeparator)); @@ -1430,7 +1430,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { repository->add_item("localhost"); repository->set_item_metadata(1, "http://127.0.0.1/asset-library/api"); - repository->connect("item_selected", this, "_repository_changed"); + repository->connect_compat("item_selected", this, "_repository_changed"); search_hb2->add_child(repository); repository->set_h_size_flags(SIZE_EXPAND_FILL); @@ -1445,7 +1445,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { support->get_popup()->add_check_item(TTR("Testing"), SUPPORT_TESTING); support->get_popup()->set_item_checked(SUPPORT_OFFICIAL, true); support->get_popup()->set_item_checked(SUPPORT_COMMUNITY, true); - support->get_popup()->connect("id_pressed", this, "_support_toggled"); + support->get_popup()->connect_compat("id_pressed", this, "_support_toggled"); ///////// @@ -1501,7 +1501,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { request = memnew(HTTPRequest); add_child(request); request->set_use_threads(EDITOR_DEF("asset_library/use_threads", true)); - request->connect("request_completed", this, "_http_request_completed"); + request->connect_compat("request_completed", this, "_http_request_completed"); last_queue_id = 0; @@ -1534,7 +1534,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { asset_open->add_filter("*.zip ; " + TTR("Assets ZIP File")); asset_open->set_mode(EditorFileDialog::MODE_OPEN_FILE); add_child(asset_open); - asset_open->connect("file_selected", this, "_asset_file_selected"); + asset_open->connect_compat("file_selected", this, "_asset_file_selected"); asset_installer = NULL; } diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp index 60cb2ff54d..e4a9c38a99 100644 --- a/editor/plugins/audio_stream_editor_plugin.cpp +++ b/editor/plugins/audio_stream_editor_plugin.cpp @@ -39,7 +39,7 @@ void AudioStreamEditor::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { - AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", this, "_preview_changed"); + AudioStreamPreviewGenerator::get_singleton()->connect_compat("preview_updated", this, "_preview_changed"); } if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) { @@ -214,7 +214,7 @@ AudioStreamEditor::AudioStreamEditor() { _dragging = false; _player = memnew(AudioStreamPlayer); - _player->connect("finished", this, "_on_finished"); + _player->connect_compat("finished", this, "_on_finished"); add_child(_player); VBoxContainer *vbox = memnew(VBoxContainer); @@ -223,13 +223,13 @@ AudioStreamEditor::AudioStreamEditor() { _preview = memnew(ColorRect); _preview->set_v_size_flags(SIZE_EXPAND_FILL); - _preview->connect("draw", this, "_draw_preview"); + _preview->connect_compat("draw", this, "_draw_preview"); vbox->add_child(_preview); _indicator = memnew(Control); _indicator->set_anchors_and_margins_preset(PRESET_WIDE); - _indicator->connect("draw", this, "_draw_indicator"); - _indicator->connect("gui_input", this, "_on_input_indicator"); + _indicator->connect_compat("draw", this, "_draw_indicator"); + _indicator->connect_compat("gui_input", this, "_on_input_indicator"); _preview->add_child(_indicator); HBoxContainer *hbox = memnew(HBoxContainer); @@ -239,12 +239,12 @@ AudioStreamEditor::AudioStreamEditor() { _play_button = memnew(ToolButton); hbox->add_child(_play_button); _play_button->set_focus_mode(Control::FOCUS_NONE); - _play_button->connect("pressed", this, "_play"); + _play_button->connect_compat("pressed", this, "_play"); _stop_button = memnew(ToolButton); hbox->add_child(_stop_button); _stop_button->set_focus_mode(Control::FOCUS_NONE); - _stop_button->connect("pressed", this, "_stop"); + _stop_button->connect_compat("pressed", this, "_stop"); _current_label = memnew(Label); _current_label->set_align(Label::ALIGN_RIGHT); diff --git a/editor/plugins/camera_editor_plugin.cpp b/editor/plugins/camera_editor_plugin.cpp index 6f5bc69bd1..0440785eaf 100644 --- a/editor/plugins/camera_editor_plugin.cpp +++ b/editor/plugins/camera_editor_plugin.cpp @@ -81,7 +81,7 @@ CameraEditor::CameraEditor() { preview->set_margin(MARGIN_RIGHT, 0); preview->set_margin(MARGIN_TOP, 0); preview->set_margin(MARGIN_BOTTOM, 10); - preview->connect("pressed", this, "_pressed"); + preview->connect_compat("pressed", this, "_pressed"); } void CameraEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index c5f6a88783..b91b346089 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3891,10 +3891,10 @@ void CanvasItemEditor::_notification(int p_what) { select_sb->set_default_margin(Margin(i), 4); } - AnimationPlayerEditor::singleton->get_track_editor()->connect("visibility_changed", this, "_keying_changed"); + AnimationPlayerEditor::singleton->get_track_editor()->connect_compat("visibility_changed", this, "_keying_changed"); _keying_changed(); - get_tree()->connect("node_added", this, "_tree_changed", varray()); - get_tree()->connect("node_removed", this, "_tree_changed", varray()); + get_tree()->connect_compat("node_added", this, "_tree_changed", varray()); + get_tree()->connect_compat("node_removed", this, "_tree_changed", varray()); } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { @@ -3902,8 +3902,8 @@ void CanvasItemEditor::_notification(int p_what) { } if (p_what == NOTIFICATION_EXIT_TREE) { - get_tree()->disconnect("node_added", this, "_tree_changed"); - get_tree()->disconnect("node_removed", this, "_tree_changed"); + get_tree()->disconnect_compat("node_added", this, "_tree_changed"); + get_tree()->disconnect_compat("node_removed", this, "_tree_changed"); } if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { @@ -4181,7 +4181,7 @@ void CanvasItemEditor::_popup_warning_temporarily(Control *p_control, const floa Timer *timer; if (!popup_temporarily_timers.has(p_control)) { timer = memnew(Timer); - timer->connect("timeout", this, "_popup_warning_depop", varray(p_control)); + timer->connect_compat("timeout", this, "_popup_warning_depop", varray(p_control)); timer->set_one_shot(true); add_child(timer); @@ -5410,11 +5410,11 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { editor = p_editor; editor_selection = p_editor->get_editor_selection(); editor_selection->add_editor_plugin(this); - editor_selection->connect("selection_changed", this, "update"); - editor_selection->connect("selection_changed", this, "_selection_changed"); + editor_selection->connect_compat("selection_changed", this, "update"); + editor_selection->connect_compat("selection_changed", this, "_selection_changed"); - editor->call_deferred("connect", make_binds("play_pressed", this, "_update_override_camera_button", true)); - editor->call_deferred("connect", make_binds("stop_pressed", this, "_update_override_camera_button", false)); + editor->call_deferred("connect", make_binds("play_pressed", Callable(this, "_update_override_camera_button"), true)); + editor->call_deferred("connect", make_binds("stop_pressed", Callable(this, "_update_override_camera_button"), false)); hb = memnew(HBoxContainer); add_child(hb); @@ -5434,7 +5434,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { viewport_scrollable->set_clip_contents(true); viewport_scrollable->set_v_size_flags(SIZE_EXPAND_FILL); viewport_scrollable->set_h_size_flags(SIZE_EXPAND_FILL); - viewport_scrollable->connect("draw", this, "_update_scrollbars"); + viewport_scrollable->connect_compat("draw", this, "_update_scrollbars"); ViewportContainer *scene_tree = memnew(ViewportContainer); viewport_scrollable->add_child(scene_tree); @@ -5456,8 +5456,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { viewport->set_anchors_and_margins_preset(Control::PRESET_WIDE); viewport->set_clip_contents(true); viewport->set_focus_mode(FOCUS_ALL); - viewport->connect("draw", this, "_draw_viewport"); - viewport->connect("gui_input", this, "_gui_input_viewport"); + viewport->connect_compat("draw", this, "_draw_viewport"); + viewport->connect_compat("gui_input", this, "_gui_input_viewport"); info_overlay = memnew(VBoxContainer); info_overlay->set_anchors_and_margins_preset(Control::PRESET_BOTTOM_LEFT); @@ -5485,25 +5485,25 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { h_scroll = memnew(HScrollBar); viewport->add_child(h_scroll); - h_scroll->connect("value_changed", this, "_update_scroll"); + h_scroll->connect_compat("value_changed", this, "_update_scroll"); h_scroll->hide(); v_scroll = memnew(VScrollBar); viewport->add_child(v_scroll); - v_scroll->connect("value_changed", this, "_update_scroll"); + v_scroll->connect_compat("value_changed", this, "_update_scroll"); v_scroll->hide(); viewport->add_child(controls_vb); zoom_minus = memnew(ToolButton); zoom_hb->add_child(zoom_minus); - zoom_minus->connect("pressed", this, "_button_zoom_minus"); + zoom_minus->connect_compat("pressed", this, "_button_zoom_minus"); zoom_minus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_minus", TTR("Zoom Out"), KEY_MASK_CMD | KEY_MINUS)); zoom_minus->set_focus_mode(FOCUS_NONE); zoom_reset = memnew(ToolButton); zoom_hb->add_child(zoom_reset); - zoom_reset->connect("pressed", this, "_button_zoom_reset"); + zoom_reset->connect_compat("pressed", this, "_button_zoom_reset"); zoom_reset->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", TTR("Zoom Reset"), KEY_MASK_CMD | KEY_0)); zoom_reset->set_focus_mode(FOCUS_NONE); zoom_reset->set_text_align(Button::TextAlign::ALIGN_CENTER); @@ -5512,7 +5512,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { zoom_plus = memnew(ToolButton); zoom_hb->add_child(zoom_plus); - zoom_plus->connect("pressed", this, "_button_zoom_plus"); + zoom_plus->connect_compat("pressed", this, "_button_zoom_plus"); zoom_plus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_plus", TTR("Zoom In"), KEY_MASK_CMD | KEY_EQUAL)); // Usually direct access key for PLUS zoom_plus->set_focus_mode(FOCUS_NONE); @@ -5521,7 +5521,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { select_button = memnew(ToolButton); hb->add_child(select_button); select_button->set_toggle_mode(true); - select_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_SELECT)); + select_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_SELECT)); select_button->set_pressed(true); select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), KEY_Q)); select_button->set_tooltip(keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate") + "\n" + TTR("Alt+Drag: Move") + "\n" + TTR("Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving).") + "\n" + TTR("Alt+RMB: Depth list selection")); @@ -5531,21 +5531,21 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { move_button = memnew(ToolButton); hb->add_child(move_button); move_button->set_toggle_mode(true); - move_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_MOVE)); + move_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_MOVE)); move_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/move_mode", TTR("Move Mode"), KEY_W)); move_button->set_tooltip(TTR("Move Mode")); rotate_button = memnew(ToolButton); hb->add_child(rotate_button); rotate_button->set_toggle_mode(true); - rotate_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_ROTATE)); + rotate_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_ROTATE)); rotate_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/rotate_mode", TTR("Rotate Mode"), KEY_E)); rotate_button->set_tooltip(TTR("Rotate Mode")); scale_button = memnew(ToolButton); hb->add_child(scale_button); scale_button->set_toggle_mode(true); - scale_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_SCALE)); + scale_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_SCALE)); scale_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/scale_mode", TTR("Scale Mode"), KEY_S)); scale_button->set_tooltip(TTR("Scale Mode")); @@ -5554,25 +5554,25 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { list_select_button = memnew(ToolButton); hb->add_child(list_select_button); list_select_button->set_toggle_mode(true); - list_select_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_LIST_SELECT)); + list_select_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_LIST_SELECT)); list_select_button->set_tooltip(TTR("Show a list of all objects at the position clicked\n(same as Alt+RMB in select mode).")); pivot_button = memnew(ToolButton); hb->add_child(pivot_button); pivot_button->set_toggle_mode(true); - pivot_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_EDIT_PIVOT)); + pivot_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_EDIT_PIVOT)); pivot_button->set_tooltip(TTR("Click to change object's rotation pivot.")); pan_button = memnew(ToolButton); hb->add_child(pan_button); pan_button->set_toggle_mode(true); - pan_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_PAN)); + pan_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_PAN)); pan_button->set_tooltip(TTR("Pan Mode")); ruler_button = memnew(ToolButton); hb->add_child(ruler_button); ruler_button->set_toggle_mode(true); - ruler_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_RULER)); + ruler_button->connect_compat("pressed", this, "_button_tool_select", make_binds(TOOL_RULER)); ruler_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/ruler_mode", TTR("Ruler Mode"), KEY_R)); ruler_button->set_tooltip(TTR("Ruler Mode")); @@ -5581,14 +5581,14 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { smart_snap_button = memnew(ToolButton); hb->add_child(smart_snap_button); smart_snap_button->set_toggle_mode(true); - smart_snap_button->connect("toggled", this, "_button_toggle_smart_snap"); + smart_snap_button->connect_compat("toggled", this, "_button_toggle_smart_snap"); smart_snap_button->set_tooltip(TTR("Toggle smart snapping.")); smart_snap_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/use_smart_snap", TTR("Use Smart Snap"), KEY_MASK_SHIFT | KEY_S)); grid_snap_button = memnew(ToolButton); hb->add_child(grid_snap_button); grid_snap_button->set_toggle_mode(true); - grid_snap_button->connect("toggled", this, "_button_toggle_grid_snap"); + grid_snap_button->connect_compat("toggled", this, "_button_toggle_grid_snap"); grid_snap_button->set_tooltip(TTR("Toggle grid snapping.")); grid_snap_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/use_grid_snap", TTR("Use Grid Snap"), KEY_MASK_SHIFT | KEY_G)); @@ -5599,7 +5599,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { snap_config_menu->set_switch_on_hover(true); PopupMenu *p = snap_config_menu->get_popup(); - p->connect("id_pressed", this, "_popup_callback"); + p->connect_compat("id_pressed", this, "_popup_callback"); p->set_hide_on_checkable_item_selection(false); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_rotation_snap", TTR("Use Rotation Snap")), SNAP_USE_ROTATION); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/use_scale_snap", TTR("Use Scale Snap")), SNAP_USE_SCALE); @@ -5613,7 +5613,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { smartsnap_config_popup = memnew(PopupMenu); p->add_child(smartsnap_config_popup); smartsnap_config_popup->set_name("SmartSnapping"); - smartsnap_config_popup->connect("id_pressed", this, "_popup_callback"); + smartsnap_config_popup->connect_compat("id_pressed", this, "_popup_callback"); smartsnap_config_popup->set_hide_on_checkable_item_selection(false); smartsnap_config_popup->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/snap_node_parent", TTR("Snap to Parent")), SNAP_USE_NODE_PARENT); smartsnap_config_popup->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/snap_node_anchors", TTR("Snap to Node Anchor")), SNAP_USE_NODE_ANCHORS); @@ -5627,22 +5627,22 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { lock_button = memnew(ToolButton); hb->add_child(lock_button); - lock_button->connect("pressed", this, "_popup_callback", varray(LOCK_SELECTED)); + lock_button->connect_compat("pressed", this, "_popup_callback", varray(LOCK_SELECTED)); lock_button->set_tooltip(TTR("Lock the selected object in place (can't be moved).")); unlock_button = memnew(ToolButton); hb->add_child(unlock_button); - unlock_button->connect("pressed", this, "_popup_callback", varray(UNLOCK_SELECTED)); + unlock_button->connect_compat("pressed", this, "_popup_callback", varray(UNLOCK_SELECTED)); unlock_button->set_tooltip(TTR("Unlock the selected object (can be moved).")); group_button = memnew(ToolButton); hb->add_child(group_button); - group_button->connect("pressed", this, "_popup_callback", varray(GROUP_SELECTED)); + group_button->connect_compat("pressed", this, "_popup_callback", varray(GROUP_SELECTED)); group_button->set_tooltip(TTR("Makes sure the object's children are not selectable.")); ungroup_button = memnew(ToolButton); hb->add_child(ungroup_button); - ungroup_button->connect("pressed", this, "_popup_callback", varray(UNGROUP_SELECTED)); + ungroup_button->connect_compat("pressed", this, "_popup_callback", varray(UNGROUP_SELECTED)); ungroup_button->set_tooltip(TTR("Restores the object's children's ability to be selected.")); hb->add_child(memnew(VSeparator)); @@ -5661,13 +5661,13 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p->add_separator(); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_make_bones", TTR("Make Custom Bone(s) from Node(s)"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B), SKELETON_MAKE_BONES); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_bones", TTR("Clear Custom Bones")), SKELETON_CLEAR_BONES); - p->connect("id_pressed", this, "_popup_callback"); + p->connect_compat("id_pressed", this, "_popup_callback"); hb->add_child(memnew(VSeparator)); override_camera_button = memnew(ToolButton); hb->add_child(override_camera_button); - override_camera_button->connect("toggled", this, "_button_override_camera"); + override_camera_button->connect_compat("toggled", this, "_button_override_camera"); override_camera_button->set_toggle_mode(true); override_camera_button->set_disabled(true); _update_override_camera_button(false); @@ -5677,7 +5677,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { view_menu = memnew(MenuButton); view_menu->set_text(TTR("View")); hb->add_child(view_menu); - view_menu->get_popup()->connect("id_pressed", this, "_popup_callback"); + view_menu->get_popup()->connect_compat("id_pressed", this, "_popup_callback"); view_menu->set_switch_on_hover(true); p = view_menu->get_popup(); @@ -5705,18 +5705,18 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { presets_menu->set_switch_on_hover(true); p = presets_menu->get_popup(); - p->connect("id_pressed", this, "_popup_callback"); + p->connect_compat("id_pressed", this, "_popup_callback"); anchors_popup = memnew(PopupMenu); p->add_child(anchors_popup); anchors_popup->set_name("Anchors"); - anchors_popup->connect("id_pressed", this, "_popup_callback"); + anchors_popup->connect_compat("id_pressed", this, "_popup_callback"); anchor_mode_button = memnew(ToolButton); hb->add_child(anchor_mode_button); anchor_mode_button->set_toggle_mode(true); anchor_mode_button->hide(); - anchor_mode_button->connect("toggled", this, "_button_toggle_anchor_mode"); + anchor_mode_button->connect_compat("toggled", this, "_button_toggle_anchor_mode"); animation_hb = memnew(HBoxContainer); hb->add_child(animation_hb); @@ -5728,7 +5728,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { key_loc_button->set_flat(true); key_loc_button->set_pressed(true); key_loc_button->set_focus_mode(FOCUS_NONE); - key_loc_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_POS)); + key_loc_button->connect_compat("pressed", this, "_popup_callback", varray(ANIM_INSERT_POS)); key_loc_button->set_tooltip(TTR("Translation mask for inserting keys.")); animation_hb->add_child(key_loc_button); key_rot_button = memnew(Button); @@ -5736,20 +5736,20 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { key_rot_button->set_flat(true); key_rot_button->set_pressed(true); key_rot_button->set_focus_mode(FOCUS_NONE); - key_rot_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_ROT)); + key_rot_button->connect_compat("pressed", this, "_popup_callback", varray(ANIM_INSERT_ROT)); key_rot_button->set_tooltip(TTR("Rotation mask for inserting keys.")); animation_hb->add_child(key_rot_button); key_scale_button = memnew(Button); key_scale_button->set_toggle_mode(true); key_scale_button->set_flat(true); key_scale_button->set_focus_mode(FOCUS_NONE); - key_scale_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_SCALE)); + key_scale_button->connect_compat("pressed", this, "_popup_callback", varray(ANIM_INSERT_SCALE)); key_scale_button->set_tooltip(TTR("Scale mask for inserting keys.")); animation_hb->add_child(key_scale_button); key_insert_button = memnew(Button); key_insert_button->set_flat(true); key_insert_button->set_focus_mode(FOCUS_NONE); - key_insert_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_KEY)); + key_insert_button->connect_compat("pressed", this, "_popup_callback", varray(ANIM_INSERT_KEY)); key_insert_button->set_tooltip(TTR("Insert keys (based on mask).")); key_insert_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/anim_insert_key", TTR("Insert Key"), KEY_INSERT)); animation_hb->add_child(key_insert_button); @@ -5765,7 +5765,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { animation_menu = memnew(MenuButton); animation_menu->set_tooltip(TTR("Animation Key and Pose Options")); animation_hb->add_child(animation_menu); - animation_menu->get_popup()->connect("id_pressed", this, "_popup_callback"); + animation_menu->get_popup()->connect_compat("id_pressed", this, "_popup_callback"); animation_menu->set_switch_on_hover(true); p = animation_menu->get_popup(); @@ -5778,7 +5778,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p->add_shortcut(ED_SHORTCUT("canvas_item_editor/anim_clear_pose", TTR("Clear Pose"), KEY_MASK_SHIFT | KEY_K), ANIM_CLEAR_POSE); snap_dialog = memnew(SnapDialog); - snap_dialog->connect("confirmed", this, "_snap_changed"); + snap_dialog->connect_compat("confirmed", this, "_snap_changed"); add_child(snap_dialog); select_sb = Ref(memnew(StyleBoxTexture)); @@ -5786,8 +5786,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { selection_menu = memnew(PopupMenu); add_child(selection_menu); selection_menu->set_custom_minimum_size(Vector2(100, 0)); - selection_menu->connect("id_pressed", this, "_selection_result_pressed"); - selection_menu->connect("popup_hide", this, "_selection_menu_hide"); + selection_menu->connect_compat("id_pressed", this, "_selection_result_pressed"); + selection_menu->connect_compat("popup_hide", this, "_selection_menu_hide"); multiply_grid_step_shortcut = ED_SHORTCUT("canvas_item_editor/multiply_grid_step", TTR("Multiply grid step by 2"), KEY_KP_MULTIPLY); divide_grid_step_shortcut = ED_SHORTCUT("canvas_item_editor/divide_grid_step", TTR("Divide grid step by 2"), KEY_KP_DIVIDE); @@ -6234,11 +6234,11 @@ void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p void CanvasItemEditorViewport::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("mouse_exited", this, "_on_mouse_exit"); + connect_compat("mouse_exited", this, "_on_mouse_exit"); label->add_color_override("font_color", get_color("warning_color", "Editor")); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("mouse_exited", this, "_on_mouse_exit"); + disconnect_compat("mouse_exited", this, "_on_mouse_exit"); } break; default: break; @@ -6276,8 +6276,8 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte selector = memnew(AcceptDialog); editor->get_gui_base()->add_child(selector); selector->set_title(TTR("Change Default Type")); - selector->connect("confirmed", this, "_on_change_type_confirmed"); - selector->connect("popup_hide", this, "_on_change_type_closed"); + selector->connect_compat("confirmed", this, "_on_change_type_confirmed"); + selector->connect_compat("popup_hide", this, "_on_change_type_closed"); VBoxContainer *vbc = memnew(VBoxContainer); selector->add_child(vbc); @@ -6294,7 +6294,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte CheckBox *check = memnew(CheckBox); btn_group->add_child(check); check->set_text(types[i]); - check->connect("button_down", this, "_on_select_type", varray(check)); + check->connect_compat("button_down", this, "_on_select_type", varray(check)); check->set_button_group(button_group); } diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp index 9aa9b6cda5..59bbe031ed 100644 --- a/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_editor_plugin.cpp @@ -47,7 +47,7 @@ void Polygon3DEditor::_notification(int p_what) { button_create->set_icon(get_icon("Edit", "EditorIcons")); button_edit->set_icon(get_icon("MovePoint", "EditorIcons")); button_edit->set_pressed(true); - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); } break; case NOTIFICATION_PROCESS: { @@ -532,12 +532,12 @@ Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) { add_child(memnew(VSeparator)); button_create = memnew(ToolButton); add_child(button_create); - button_create->connect("pressed", this, "_menu_option", varray(MODE_CREATE)); + button_create->connect_compat("pressed", this, "_menu_option", varray(MODE_CREATE)); button_create->set_toggle_mode(true); button_edit = memnew(ToolButton); add_child(button_edit); - button_edit->connect("pressed", this, "_menu_option", varray(MODE_EDIT)); + button_edit->connect_compat("pressed", this, "_menu_option", varray(MODE_EDIT)); button_edit->set_toggle_mode(true); mode = MODE_EDIT; diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp index 80f5e26d48..ad3f01ec37 100644 --- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp @@ -240,9 +240,9 @@ void CPUParticles2DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - menu->get_popup()->connect("id_pressed", this, "_menu_callback"); + menu->get_popup()->connect_compat("id_pressed", this, "_menu_callback"); menu->set_icon(menu->get_popup()->get_icon("Particles2D", "EditorIcons")); - file->connect("file_selected", this, "_file_selected"); + file->connect_compat("file_selected", this, "_file_selected"); } } @@ -305,7 +305,7 @@ CPUParticles2DEditorPlugin::CPUParticles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(emission_mask); - emission_mask->connect("confirmed", this, "_generate_emission_mask"); + emission_mask->connect_compat("confirmed", this, "_generate_emission_mask"); } CPUParticles2DEditorPlugin::~CPUParticles2DEditorPlugin() { diff --git a/editor/plugins/cpu_particles_editor_plugin.cpp b/editor/plugins/cpu_particles_editor_plugin.cpp index be3e9cd8e0..8a73ae1e1f 100644 --- a/editor/plugins/cpu_particles_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_editor_plugin.cpp @@ -116,7 +116,7 @@ CPUParticlesEditor::CPUParticlesEditor() { options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); } void CPUParticlesEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 62a3ff9b58..5f4fb19d9e 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -49,7 +49,7 @@ CurveEditor::CurveEditor() { set_clip_contents(true); _context_menu = memnew(PopupMenu); - _context_menu->connect("id_pressed", this, "_on_context_menu_item_selected"); + _context_menu->connect_compat("id_pressed", this, "_on_context_menu_item_selected"); add_child(_context_menu); _presets_menu = memnew(PopupMenu); @@ -60,7 +60,7 @@ CurveEditor::CurveEditor() { _presets_menu->add_item(TTR("Ease In"), PRESET_EASE_IN); _presets_menu->add_item(TTR("Ease Out"), PRESET_EASE_OUT); _presets_menu->add_item(TTR("Smoothstep"), PRESET_SMOOTHSTEP); - _presets_menu->connect("id_pressed", this, "_on_preset_item_selected"); + _presets_menu->connect_compat("id_pressed", this, "_on_preset_item_selected"); _context_menu->add_child(_presets_menu); } @@ -70,15 +70,15 @@ void CurveEditor::set_curve(Ref curve) { return; if (_curve_ref.is_valid()) { - _curve_ref->disconnect(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); - _curve_ref->disconnect(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); + _curve_ref->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); + _curve_ref->disconnect_compat(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); } _curve_ref = curve; if (_curve_ref.is_valid()) { - _curve_ref->connect(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); - _curve_ref->connect(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); + _curve_ref->connect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); + _curve_ref->connect_compat(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); } _selected_point = -1; diff --git a/editor/plugins/gi_probe_editor_plugin.cpp b/editor/plugins/gi_probe_editor_plugin.cpp index fe2c0d33b7..9231d38a02 100644 --- a/editor/plugins/gi_probe_editor_plugin.cpp +++ b/editor/plugins/gi_probe_editor_plugin.cpp @@ -147,7 +147,7 @@ GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) { bake = memnew(ToolButton); bake->set_icon(editor->get_gui_base()->get_icon("Bake", "EditorIcons")); bake->set_text(TTR("Bake GI Probe")); - bake->connect("pressed", this, "_bake"); + bake->connect_compat("pressed", this, "_bake"); bake_hb->add_child(bake); bake_info = memnew(Label); bake_info->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -159,7 +159,7 @@ GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) { probe_file = memnew(EditorFileDialog); probe_file->set_mode(EditorFileDialog::MODE_SAVE_FILE); probe_file->add_filter("*.res"); - probe_file->connect("file_selected", this, "_giprobe_save_path_and_bake"); + probe_file->connect_compat("file_selected", this, "_giprobe_save_path_and_bake"); get_editor_interface()->get_base_control()->add_child(probe_file); probe_file->set_title(TTR("Select path for GIProbe Data File")); diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index 0a3a994eb7..b36782ee14 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -69,8 +69,8 @@ void GradientEditor::_bind_methods() { void GradientEditor::set_gradient(const Ref &p_gradient) { gradient = p_gradient; - connect("ramp_changed", this, "_ramp_changed"); - gradient->connect("changed", this, "_gradient_changed"); + connect_compat("ramp_changed", this, "_ramp_changed"); + gradient->connect_compat("changed", this, "_gradient_changed"); set_points(gradient->get_points()); } diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp index b7dfe97081..b872a2d932 100644 --- a/editor/plugins/item_list_editor_plugin.cpp +++ b/editor/plugins/item_list_editor_plugin.cpp @@ -268,7 +268,7 @@ void ItemListEditor::_notification(int p_notification) { del_button->set_icon(get_icon("Remove", "EditorIcons")); } else if (p_notification == NOTIFICATION_READY) { - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); } } @@ -359,7 +359,7 @@ ItemListEditor::ItemListEditor() { toolbar_button = memnew(ToolButton); toolbar_button->set_text(TTR("Items")); add_child(toolbar_button); - toolbar_button->connect("pressed", this, "_edit_items"); + toolbar_button->connect_compat("pressed", this, "_edit_items"); dialog = memnew(AcceptDialog); dialog->set_title(TTR("Item List Editor")); @@ -376,14 +376,14 @@ ItemListEditor::ItemListEditor() { add_button = memnew(Button); add_button->set_text(TTR("Add")); hbc->add_child(add_button); - add_button->connect("pressed", this, "_add_button"); + add_button->connect_compat("pressed", this, "_add_button"); hbc->add_spacer(); del_button = memnew(Button); del_button->set_text(TTR("Delete")); hbc->add_child(del_button); - del_button->connect("pressed", this, "_delete_button"); + del_button->connect_compat("pressed", this, "_delete_button"); property_editor = memnew(EditorInspector); vbc->add_child(property_editor); diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 4e44082853..bca0bde441 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -171,13 +171,13 @@ MaterialEditor::MaterialEditor() { sphere_switch->set_toggle_mode(true); sphere_switch->set_pressed(true); vb_shape->add_child(sphere_switch); - sphere_switch->connect("pressed", this, "_button_pressed", varray(sphere_switch)); + sphere_switch->connect_compat("pressed", this, "_button_pressed", varray(sphere_switch)); box_switch = memnew(TextureButton); box_switch->set_toggle_mode(true); box_switch->set_pressed(false); vb_shape->add_child(box_switch); - box_switch->connect("pressed", this, "_button_pressed", varray(box_switch)); + box_switch->connect_compat("pressed", this, "_button_pressed", varray(box_switch)); hb->add_spacer(); @@ -187,12 +187,12 @@ MaterialEditor::MaterialEditor() { light_1_switch = memnew(TextureButton); light_1_switch->set_toggle_mode(true); vb_light->add_child(light_1_switch); - light_1_switch->connect("pressed", this, "_button_pressed", varray(light_1_switch)); + light_1_switch->connect_compat("pressed", this, "_button_pressed", varray(light_1_switch)); light_2_switch = memnew(TextureButton); light_2_switch->set_toggle_mode(true); vb_light->add_child(light_2_switch); - light_2_switch->connect("pressed", this, "_button_pressed", varray(light_2_switch)); + light_2_switch->connect_compat("pressed", this, "_button_pressed", varray(light_2_switch)); first_enter = true; } diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index d06e5b6349..2b25a2328c 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -157,12 +157,12 @@ MeshEditor::MeshEditor() { light_1_switch = memnew(TextureButton); light_1_switch->set_toggle_mode(true); vb_light->add_child(light_1_switch); - light_1_switch->connect("pressed", this, "_button_pressed", varray(light_1_switch)); + light_1_switch->connect_compat("pressed", this, "_button_pressed", varray(light_1_switch)); light_2_switch = memnew(TextureButton); light_2_switch->set_toggle_mode(true); vb_light->add_child(light_2_switch); - light_2_switch->connect("pressed", this, "_button_pressed", varray(light_2_switch)); + light_2_switch->connect_compat("pressed", this, "_button_pressed", varray(light_2_switch)); first_enter = true; diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp index 574646956e..182a8600e4 100644 --- a/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_editor_plugin.cpp @@ -469,7 +469,7 @@ MeshInstanceEditor::MeshInstanceEditor() { options->get_popup()->add_item(TTR("View UV2"), MENU_OPTION_DEBUG_UV2); options->get_popup()->add_item(TTR("Unwrap UV2 for Lightmap/AO"), MENU_OPTION_CREATE_UV2); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); outline_dialog = memnew(ConfirmationDialog); outline_dialog->set_title(TTR("Create Outline Mesh")); @@ -487,7 +487,7 @@ MeshInstanceEditor::MeshInstanceEditor() { outline_dialog_vbc->add_margin_child(TTR("Outline Size:"), outline_size); add_child(outline_dialog); - outline_dialog->connect("confirmed", this, "_create_outline_mesh"); + outline_dialog->connect_compat("confirmed", this, "_create_outline_mesh"); err_dialog = memnew(AcceptDialog); add_child(err_dialog); @@ -497,7 +497,7 @@ MeshInstanceEditor::MeshInstanceEditor() { add_child(debug_uv_dialog); debug_uv = memnew(Control); debug_uv->set_custom_minimum_size(Size2(600, 600) * EDSCALE); - debug_uv->connect("draw", this, "_debug_uv_draw"); + debug_uv->connect_compat("draw", this, "_debug_uv_draw"); debug_uv_dialog->add_child(debug_uv); } diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index b77cb6453f..ea8842a56f 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -268,7 +268,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { file->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper()); } add_child(file); - file->connect("file_selected", this, "_import_scene_cbk"); + file->connect_compat("file_selected", this, "_import_scene_cbk"); menu = memnew(MenuButton); SpatialEditor::get_singleton()->add_control_to_menu_panel(menu); @@ -281,13 +281,13 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { menu->get_popup()->add_item(TTR("Import from Scene"), MENU_OPTION_IMPORT_FROM_SCENE); menu->get_popup()->add_item(TTR("Update from Scene"), MENU_OPTION_UPDATE_FROM_SCENE); menu->get_popup()->set_item_disabled(menu->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE), true); - menu->get_popup()->connect("id_pressed", this, "_menu_cbk"); + menu->get_popup()->connect_compat("id_pressed", this, "_menu_cbk"); menu->hide(); editor = p_editor; cd = memnew(ConfirmationDialog); add_child(cd); - cd->get_ok()->connect("pressed", this, "_menu_confirm"); + cd->get_ok()->connect_compat("pressed", this, "_menu_confirm"); } void MeshLibraryEditorPlugin::edit(Object *p_node) { diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp index 4b7fd6399b..b2ce01b8d8 100644 --- a/editor/plugins/multimesh_editor_plugin.cpp +++ b/editor/plugins/multimesh_editor_plugin.cpp @@ -295,7 +295,7 @@ MultiMeshEditor::MultiMeshEditor() { options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MultiMeshInstance", "EditorIcons")); options->get_popup()->add_item(TTR("Populate Surface")); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); populate_dialog = memnew(ConfirmationDialog); populate_dialog->set_title(TTR("Populate MultiMesh")); @@ -313,7 +313,7 @@ MultiMeshEditor::MultiMeshEditor() { Button *b = memnew(Button); hbc->add_child(b); b->set_text(".."); - b->connect("pressed", this, "_browse", make_binds(false)); + b->connect_compat("pressed", this, "_browse", make_binds(false)); vbc->add_margin_child(TTR("Target Surface:"), hbc); @@ -325,7 +325,7 @@ MultiMeshEditor::MultiMeshEditor() { hbc->add_child(b); b->set_text(".."); vbc->add_margin_child(TTR("Source Mesh:"), hbc); - b->connect("pressed", this, "_browse", make_binds(true)); + b->connect_compat("pressed", this, "_browse", make_binds(true)); populate_axis = memnew(OptionButton); populate_axis->add_item(TTR("X-Axis")); @@ -371,10 +371,10 @@ MultiMeshEditor::MultiMeshEditor() { populate_dialog->get_ok()->set_text(TTR("Populate")); - populate_dialog->get_ok()->connect("pressed", this, "_populate"); + populate_dialog->get_ok()->connect_compat("pressed", this, "_populate"); std = memnew(SceneTreeDialog); populate_dialog->add_child(std); - std->connect("selected", this, "_browsed"); + std->connect_compat("selected", this, "_browsed"); _last_pp_node = NULL; diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp index 2e149a0f65..ab23cb9054 100644 --- a/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/particles_2d_editor_plugin.cpp @@ -349,9 +349,9 @@ void Particles2DEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - menu->get_popup()->connect("id_pressed", this, "_menu_callback"); + menu->get_popup()->connect_compat("id_pressed", this, "_menu_callback"); menu->set_icon(menu->get_popup()->get_icon("Particles2D", "EditorIcons")); - file->connect("file_selected", this, "_file_selected"); + file->connect_compat("file_selected", this, "_file_selected"); } } @@ -416,7 +416,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(generate_visibility_rect); - generate_visibility_rect->connect("confirmed", this, "_generate_visibility_rect"); + generate_visibility_rect->connect_compat("confirmed", this, "_generate_visibility_rect"); emission_mask = memnew(ConfirmationDialog); emission_mask->set_title(TTR("Load Emission Mask")); @@ -433,7 +433,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child(emission_mask); - emission_mask->connect("confirmed", this, "_generate_emission_mask"); + emission_mask->connect_compat("confirmed", this, "_generate_emission_mask"); } Particles2DEditorPlugin::~Particles2DEditorPlugin() { diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index 940874846f..cea2182ae9 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -229,14 +229,14 @@ ParticlesEditorBase::ParticlesEditorBase() { emd_vb->add_margin_child(TTR("Emission Source: "), emission_fill); emission_dialog->get_ok()->set_text(TTR("Create")); - emission_dialog->connect("confirmed", this, "_generate_emission_points"); + emission_dialog->connect_compat("confirmed", this, "_generate_emission_points"); emission_file_dialog = memnew(EditorFileDialog); add_child(emission_file_dialog); - emission_file_dialog->connect("file_selected", this, "_resource_seleted"); + emission_file_dialog->connect_compat("file_selected", this, "_resource_seleted"); emission_tree_dialog = memnew(SceneTreeDialog); add_child(emission_tree_dialog); - emission_tree_dialog->connect("selected", this, "_node_selected"); + emission_tree_dialog->connect_compat("selected", this, "_node_selected"); List extensions; ResourceLoader::get_recognized_extensions_for_type("Mesh", &extensions); @@ -262,7 +262,7 @@ void ParticlesEditor::_notification(int p_notification) { if (p_notification == NOTIFICATION_ENTER_TREE) { options->set_icon(options->get_popup()->get_icon("Particles", "EditorIcons")); - get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect_compat("node_removed", this, "_node_removed"); } } @@ -474,7 +474,7 @@ ParticlesEditor::ParticlesEditor() { options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART); - options->get_popup()->connect("id_pressed", this, "_menu_option"); + options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); generate_aabb = memnew(ConfirmationDialog); generate_aabb->set_title(TTR("Generate Visibility AABB")); @@ -488,7 +488,7 @@ ParticlesEditor::ParticlesEditor() { add_child(generate_aabb); - generate_aabb->connect("confirmed", this, "_generate_aabb"); + generate_aabb->connect_compat("confirmed", this, "_generate_aabb"); } void ParticlesEditorPlugin::edit(Object *p_object) { diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index 383dada590..e642233c64 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -441,14 +441,14 @@ void Path2DEditor::edit(Node *p_path2d) { if (p_path2d) { node = Object::cast_to(p_path2d); - if (!node->is_connected("visibility_changed", this, "_node_visibility_changed")) - node->connect("visibility_changed", this, "_node_visibility_changed"); + if (!node->is_connected_compat("visibility_changed", this, "_node_visibility_changed")) + node->connect_compat("visibility_changed", this, "_node_visibility_changed"); } else { // node may have been deleted at this point - if (node && node->is_connected("visibility_changed", this, "_node_visibility_changed")) - node->disconnect("visibility_changed", this, "_node_visibility_changed"); + if (node && node->is_connected_compat("visibility_changed", this, "_node_visibility_changed")) + node->disconnect_compat("visibility_changed", this, "_node_visibility_changed"); node = NULL; } } @@ -555,34 +555,34 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { curve_edit->set_toggle_mode(true); curve_edit->set_focus_mode(Control::FOCUS_NONE); curve_edit->set_tooltip(TTR("Select Points") + "\n" + TTR("Shift+Drag: Select Control Points") + "\n" + keycode_get_string(KEY_MASK_CMD) + TTR("Click: Add Point") + "\n" + TTR("Left Click: Split Segment (in curve)") + "\n" + TTR("Right Click: Delete Point")); - curve_edit->connect("pressed", this, "_mode_selected", varray(MODE_EDIT)); + curve_edit->connect_compat("pressed", this, "_mode_selected", varray(MODE_EDIT)); base_hb->add_child(curve_edit); curve_edit_curve = memnew(ToolButton); curve_edit_curve->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCurve", "EditorIcons")); curve_edit_curve->set_toggle_mode(true); curve_edit_curve->set_focus_mode(Control::FOCUS_NONE); curve_edit_curve->set_tooltip(TTR("Select Control Points (Shift+Drag)")); - curve_edit_curve->connect("pressed", this, "_mode_selected", varray(MODE_EDIT_CURVE)); + curve_edit_curve->connect_compat("pressed", this, "_mode_selected", varray(MODE_EDIT_CURVE)); base_hb->add_child(curve_edit_curve); curve_create = memnew(ToolButton); curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate", "EditorIcons")); curve_create->set_toggle_mode(true); curve_create->set_focus_mode(Control::FOCUS_NONE); curve_create->set_tooltip(TTR("Add Point (in empty space)")); - curve_create->connect("pressed", this, "_mode_selected", varray(MODE_CREATE)); + curve_create->connect_compat("pressed", this, "_mode_selected", varray(MODE_CREATE)); base_hb->add_child(curve_create); curve_del = memnew(ToolButton); curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons")); curve_del->set_toggle_mode(true); curve_del->set_focus_mode(Control::FOCUS_NONE); curve_del->set_tooltip(TTR("Delete Point")); - curve_del->connect("pressed", this, "_mode_selected", varray(MODE_DELETE)); + curve_del->connect_compat("pressed", this, "_mode_selected", varray(MODE_DELETE)); base_hb->add_child(curve_del); curve_close = memnew(ToolButton); curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveClose", "EditorIcons")); curve_close->set_focus_mode(Control::FOCUS_NONE); curve_close->set_tooltip(TTR("Close Curve")); - curve_close->connect("pressed", this, "_mode_selected", varray(ACTION_CLOSE)); + curve_close->connect_compat("pressed", this, "_mode_selected", varray(ACTION_CLOSE)); base_hb->add_child(curve_close); PopupMenu *menu; @@ -596,7 +596,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { menu->set_item_checked(HANDLE_OPTION_ANGLE, mirror_handle_angle); menu->add_check_item(TTR("Mirror Handle Lengths")); menu->set_item_checked(HANDLE_OPTION_LENGTH, mirror_handle_length); - menu->connect("id_pressed", this, "_handle_option_pressed"); + menu->connect_compat("id_pressed", this, "_handle_option_pressed"); base_hb->hide(); diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp index 75c9776f0f..b955bf7f41 100644 --- a/editor/plugins/path_editor_plugin.cpp +++ b/editor/plugins/path_editor_plugin.cpp @@ -543,10 +543,10 @@ void PathEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - curve_create->connect("pressed", this, "_mode_changed", make_binds(0)); - curve_edit->connect("pressed", this, "_mode_changed", make_binds(1)); - curve_del->connect("pressed", this, "_mode_changed", make_binds(2)); - curve_close->connect("pressed", this, "_close_curve"); + curve_create->connect_compat("pressed", this, "_mode_changed", make_binds(0)); + curve_edit->connect_compat("pressed", this, "_mode_changed", make_binds(1)); + curve_del->connect_compat("pressed", this, "_mode_changed", make_binds(2)); + curve_close->connect_compat("pressed", this, "_close_curve"); } } @@ -614,7 +614,7 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { menu->set_item_checked(HANDLE_OPTION_ANGLE, mirror_handle_angle); menu->add_check_item(TTR("Mirror Handle Lengths")); menu->set_item_checked(HANDLE_OPTION_LENGTH, mirror_handle_length); - menu->connect("id_pressed", this, "_handle_option_pressed"); + menu->connect_compat("id_pressed", this, "_handle_option_pressed"); curve_edit->set_pressed(true); /* diff --git a/editor/plugins/physical_bone_plugin.cpp b/editor/plugins/physical_bone_plugin.cpp index 28099a927b..4b63d82961 100644 --- a/editor/plugins/physical_bone_plugin.cpp +++ b/editor/plugins/physical_bone_plugin.cpp @@ -64,7 +64,7 @@ PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) : button_transform_joint->set_text(TTR("Move Joint")); button_transform_joint->set_icon(SpatialEditor::get_singleton()->get_icon("PhysicalBone", "EditorIcons")); button_transform_joint->set_toggle_mode(true); - button_transform_joint->connect("toggled", this, "_on_toggle_button_transform_joint"); + button_transform_joint->connect_compat("toggled", this, "_on_toggle_button_transform_joint"); hide(); } diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 8b0adbafa2..91c0222f6d 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -192,7 +192,7 @@ void Polygon2DEditor::_update_bone_list() { if (np == selected || bone_scroll_vb->get_child_count() < 2) cb->set_pressed(true); - cb->connect("pressed", this, "_bone_paint_selected", varray(i)); + cb->connect_compat("pressed", this, "_bone_paint_selected", varray(i)); } uv_edit_draw->update(); @@ -1273,14 +1273,14 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : button_uv = memnew(ToolButton); add_child(button_uv); button_uv->set_tooltip(TTR("Open Polygon 2D UV editor.")); - button_uv->connect("pressed", this, "_menu_option", varray(MODE_EDIT_UV)); + button_uv->connect_compat("pressed", this, "_menu_option", varray(MODE_EDIT_UV)); uv_mode = UV_MODE_EDIT_POINT; uv_edit = memnew(AcceptDialog); add_child(uv_edit); uv_edit->set_title(TTR("Polygon 2D UV Editor")); uv_edit->set_resizable(true); - uv_edit->connect("popup_hide", this, "_uv_edit_popup_hide"); + uv_edit->connect_compat("popup_hide", this, "_uv_edit_popup_hide"); VBoxContainer *uv_main_vb = memnew(VBoxContainer); uv_edit->add_child(uv_main_vb); @@ -1312,10 +1312,10 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_edit_mode[2]->set_button_group(uv_edit_group); uv_edit_mode[3]->set_button_group(uv_edit_group); - uv_edit_mode[0]->connect("pressed", this, "_uv_edit_mode_select", varray(0)); - uv_edit_mode[1]->connect("pressed", this, "_uv_edit_mode_select", varray(1)); - uv_edit_mode[2]->connect("pressed", this, "_uv_edit_mode_select", varray(2)); - uv_edit_mode[3]->connect("pressed", this, "_uv_edit_mode_select", varray(3)); + uv_edit_mode[0]->connect_compat("pressed", this, "_uv_edit_mode_select", varray(0)); + uv_edit_mode[1]->connect_compat("pressed", this, "_uv_edit_mode_select", varray(1)); + uv_edit_mode[2]->connect_compat("pressed", this, "_uv_edit_mode_select", varray(2)); + uv_edit_mode[3]->connect_compat("pressed", this, "_uv_edit_mode_select", varray(3)); uv_mode_hb->add_child(memnew(VSeparator)); @@ -1325,7 +1325,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_button[i] = memnew(ToolButton); uv_button[i]->set_toggle_mode(true); uv_mode_hb->add_child(uv_button[i]); - uv_button[i]->connect("pressed", this, "_uv_mode", varray(i)); + uv_button[i]->connect_compat("pressed", this, "_uv_mode", varray(i)); uv_button[i]->set_focus_mode(FOCUS_NONE); } @@ -1388,7 +1388,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_menu->get_popup()->add_item(TTR("Clear UV"), UVEDIT_UV_CLEAR); uv_menu->get_popup()->add_separator(); uv_menu->get_popup()->add_item(TTR("Grid Settings"), UVEDIT_GRID_SETTINGS); - uv_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + uv_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); uv_mode_hb->add_child(memnew(VSeparator)); @@ -1399,7 +1399,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : b_snap_enable->set_toggle_mode(true); b_snap_enable->set_pressed(use_snap); b_snap_enable->set_tooltip(TTR("Enable Snap")); - b_snap_enable->connect("toggled", this, "_set_use_snap"); + b_snap_enable->connect_compat("toggled", this, "_set_use_snap"); b_snap_grid = memnew(ToolButton); uv_mode_hb->add_child(b_snap_grid); @@ -1408,7 +1408,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : b_snap_grid->set_toggle_mode(true); b_snap_grid->set_pressed(snap_show_grid); b_snap_grid->set_tooltip(TTR("Show Grid")); - b_snap_grid->connect("toggled", this, "_set_show_grid"); + b_snap_grid->connect_compat("toggled", this, "_set_show_grid"); grid_settings = memnew(AcceptDialog); grid_settings->set_title(TTR("Configure Grid:")); @@ -1422,7 +1422,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sb_off_x->set_step(1); sb_off_x->set_value(snap_offset.x); sb_off_x->set_suffix("px"); - sb_off_x->connect("value_changed", this, "_set_snap_off_x"); + sb_off_x->connect_compat("value_changed", this, "_set_snap_off_x"); grid_settings_vb->add_margin_child(TTR("Grid Offset X:"), sb_off_x); SpinBox *sb_off_y = memnew(SpinBox); @@ -1431,7 +1431,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sb_off_y->set_step(1); sb_off_y->set_value(snap_offset.y); sb_off_y->set_suffix("px"); - sb_off_y->connect("value_changed", this, "_set_snap_off_y"); + sb_off_y->connect_compat("value_changed", this, "_set_snap_off_y"); grid_settings_vb->add_margin_child(TTR("Grid Offset Y:"), sb_off_y); SpinBox *sb_step_x = memnew(SpinBox); @@ -1440,7 +1440,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sb_step_x->set_step(1); sb_step_x->set_value(snap_step.x); sb_step_x->set_suffix("px"); - sb_step_x->connect("value_changed", this, "_set_snap_step_x"); + sb_step_x->connect_compat("value_changed", this, "_set_snap_step_x"); grid_settings_vb->add_margin_child(TTR("Grid Step X:"), sb_step_x); SpinBox *sb_step_y = memnew(SpinBox); @@ -1449,7 +1449,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sb_step_y->set_step(1); sb_step_y->set_value(snap_step.y); sb_step_y->set_suffix("px"); - sb_step_y->connect("value_changed", this, "_set_snap_step_y"); + sb_step_y->connect_compat("value_changed", this, "_set_snap_step_y"); grid_settings_vb->add_margin_child(TTR("Grid Step Y:"), sb_step_y); uv_mode_hb->add_child(memnew(VSeparator)); @@ -1469,16 +1469,16 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_zoom->share(uv_zoom_value); uv_zoom_value->set_custom_minimum_size(Size2(50, 0)); uv_mode_hb->add_child(uv_zoom_value); - uv_zoom->connect("value_changed", this, "_uv_scroll_changed"); + uv_zoom->connect_compat("value_changed", this, "_uv_scroll_changed"); uv_vscroll = memnew(VScrollBar); uv_vscroll->set_step(0.001); uv_edit_draw->add_child(uv_vscroll); - uv_vscroll->connect("value_changed", this, "_uv_scroll_changed"); + uv_vscroll->connect_compat("value_changed", this, "_uv_scroll_changed"); uv_hscroll = memnew(HScrollBar); uv_hscroll->set_step(0.001); uv_edit_draw->add_child(uv_hscroll); - uv_hscroll->connect("value_changed", this, "_uv_scroll_changed"); + uv_hscroll->connect_compat("value_changed", this, "_uv_scroll_changed"); bone_scroll_main_vb = memnew(VBoxContainer); bone_scroll_main_vb->hide(); @@ -1486,7 +1486,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : sync_bones = memnew(Button(TTR("Sync Bones to Polygon"))); bone_scroll_main_vb->add_child(sync_bones); sync_bones->set_h_size_flags(0); - sync_bones->connect("pressed", this, "_sync_bones"); + sync_bones->connect_compat("pressed", this, "_sync_bones"); uv_main_hsc->add_child(bone_scroll_main_vb); bone_scroll = memnew(ScrollContainer); bone_scroll->set_v_scroll(true); @@ -1496,8 +1496,8 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : bone_scroll_vb = memnew(VBoxContainer); bone_scroll->add_child(bone_scroll_vb); - uv_edit_draw->connect("draw", this, "_uv_draw"); - uv_edit_draw->connect("gui_input", this, "_uv_input"); + uv_edit_draw->connect_compat("draw", this, "_uv_draw"); + uv_edit_draw->connect_compat("gui_input", this, "_uv_input"); uv_draw_zoom = 1.0; point_drag_index = -1; uv_drag = false; diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index fb04f50827..12b8ac9008 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -382,7 +382,7 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() { add_child(file); tree = memnew(Tree); - tree->connect("button_pressed", this, "_cell_button_pressed"); + tree->connect_compat("button_pressed", this, "_cell_button_pressed"); tree->set_columns(2); tree->set_column_min_width(0, 2); tree->set_column_min_width(1, 3); @@ -396,10 +396,10 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() { dialog = memnew(AcceptDialog); add_child(dialog); - load->connect("pressed", this, "_load_pressed"); - paste->connect("pressed", this, "_paste_pressed"); - file->connect("files_selected", this, "_files_load_request"); - tree->connect("item_edited", this, "_item_edited"); + load->connect_compat("pressed", this, "_load_pressed"); + paste->connect_compat("pressed", this, "_paste_pressed"); + file->connect_compat("files_selected", this, "_files_load_request"); + tree->connect_compat("item_edited", this, "_item_edited"); loading_scene = false; } diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp index 1349de5d8e..132ec40dd2 100644 --- a/editor/plugins/root_motion_editor_plugin.cpp +++ b/editor/plugins/root_motion_editor_plugin.cpp @@ -262,24 +262,24 @@ EditorPropertyRootMotion::EditorPropertyRootMotion() { assign->set_flat(true); assign->set_h_size_flags(SIZE_EXPAND_FILL); assign->set_clip_text(true); - assign->connect("pressed", this, "_node_assign"); + assign->connect_compat("pressed", this, "_node_assign"); hbc->add_child(assign); clear = memnew(Button); clear->set_flat(true); - clear->connect("pressed", this, "_node_clear"); + clear->connect_compat("pressed", this, "_node_clear"); hbc->add_child(clear); filter_dialog = memnew(ConfirmationDialog); add_child(filter_dialog); filter_dialog->set_title(TTR("Edit Filtered Tracks:")); - filter_dialog->connect("confirmed", this, "_confirmed"); + filter_dialog->connect_compat("confirmed", this, "_confirmed"); filters = memnew(Tree); filter_dialog->add_child(filters); filters->set_v_size_flags(SIZE_EXPAND_FILL); filters->set_hide_root(true); - filters->connect("item_activated", this, "_confirmed"); + filters->connect_compat("item_activated", this, "_confirmed"); //filters->connect("item_edited", this, "_filter_edited"); } ////////////////////////// diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index f12be18c21..cea18b63f1 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -210,7 +210,7 @@ void ScriptEditorQuickOpen::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - connect("confirmed", this, "_confirmed"); + connect_compat("confirmed", this, "_confirmed"); search_box->set_clear_button_enabled(true); FALLTHROUGH; @@ -219,7 +219,7 @@ void ScriptEditorQuickOpen::_notification(int p_what) { search_box->set_right_icon(get_icon("Search", "EditorIcons")); } break; case NOTIFICATION_EXIT_TREE: { - disconnect("confirmed", this, "_confirmed"); + disconnect_compat("confirmed", this, "_confirmed"); } break; } } @@ -239,15 +239,15 @@ ScriptEditorQuickOpen::ScriptEditorQuickOpen() { add_child(vbc); search_box = memnew(LineEdit); vbc->add_margin_child(TTR("Search:"), search_box); - search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("gui_input", this, "_sbox_input"); + search_box->connect_compat("text_changed", this, "_text_changed"); + search_box->connect_compat("gui_input", this, "_sbox_input"); search_options = memnew(Tree); vbc->add_margin_child(TTR("Matches:"), search_options, true); get_ok()->set_text(TTR("Open")); get_ok()->set_disabled(true); register_text_enter(search_box); set_hide_on_ok(false); - search_options->connect("item_activated", this, "_confirmed"); + search_options->connect_compat("item_activated", this, "_confirmed"); search_options->set_hide_root(true); search_options->set_hide_folding(true); search_options->add_constant_override("draw_guides", 1); @@ -1439,18 +1439,18 @@ void ScriptEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { - editor->connect("play_pressed", this, "_editor_play"); - editor->connect("pause_pressed", this, "_editor_pause"); - editor->connect("stop_pressed", this, "_editor_stop"); - editor->connect("script_add_function_request", this, "_add_callback"); - editor->connect("resource_saved", this, "_res_saved_callback"); - script_list->connect("item_selected", this, "_script_selected"); + editor->connect_compat("play_pressed", this, "_editor_play"); + editor->connect_compat("pause_pressed", this, "_editor_pause"); + editor->connect_compat("stop_pressed", this, "_editor_stop"); + editor->connect_compat("script_add_function_request", this, "_add_callback"); + editor->connect_compat("resource_saved", this, "_res_saved_callback"); + script_list->connect_compat("item_selected", this, "_script_selected"); - members_overview->connect("item_selected", this, "_members_overview_selected"); - help_overview->connect("item_selected", this, "_help_overview_selected"); - script_split->connect("dragged", this, "_script_split_dragged"); + members_overview->connect_compat("item_selected", this, "_members_overview_selected"); + help_overview->connect_compat("item_selected", this, "_help_overview_selected"); + script_split->connect_compat("dragged", this, "_script_split_dragged"); - EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); + EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_editor_settings_changed"); FALLTHROUGH; } case NOTIFICATION_THEME_CHANGED: { @@ -1474,16 +1474,16 @@ void ScriptEditor::_notification(int p_what) { case NOTIFICATION_READY: { - get_tree()->connect("tree_changed", this, "_tree_changed"); - editor->get_inspector_dock()->connect("request_help", this, "_request_help"); - editor->connect("request_help_search", this, "_help_search"); + get_tree()->connect_compat("tree_changed", this, "_tree_changed"); + editor->get_inspector_dock()->connect_compat("request_help", this, "_request_help"); + editor->connect_compat("request_help_search", this, "_help_search"); } break; case NOTIFICATION_EXIT_TREE: { - editor->disconnect("play_pressed", this, "_editor_play"); - editor->disconnect("pause_pressed", this, "_editor_pause"); - editor->disconnect("stop_pressed", this, "_editor_stop"); + editor->disconnect_compat("play_pressed", this, "_editor_play"); + editor->disconnect_compat("pause_pressed", this, "_editor_pause"); + editor->disconnect_compat("stop_pressed", this, "_editor_stop"); } break; case MainLoop::NOTIFICATION_WM_FOCUS_IN: { @@ -2194,14 +2194,14 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra _sort_list_on_update = true; _update_script_names(); _save_layout(); - se->connect("name_changed", this, "_update_script_names"); - se->connect("edited_script_changed", this, "_script_changed"); - se->connect("request_help", this, "_help_search"); - se->connect("request_open_script_at_line", this, "_goto_script_line"); - se->connect("go_to_help", this, "_help_class_goto"); - se->connect("request_save_history", this, "_save_history"); - se->connect("search_in_files_requested", this, "_on_find_in_files_requested"); - se->connect("replace_in_files_requested", this, "_on_replace_in_files_requested"); + se->connect_compat("name_changed", this, "_update_script_names"); + se->connect_compat("edited_script_changed", this, "_script_changed"); + se->connect_compat("request_help", this, "_help_search"); + se->connect_compat("request_open_script_at_line", this, "_goto_script_line"); + se->connect_compat("go_to_help", this, "_help_class_goto"); + se->connect_compat("request_save_history", this, "_save_history"); + se->connect_compat("search_in_files_requested", this, "_on_find_in_files_requested"); + se->connect_compat("replace_in_files_requested", this, "_on_replace_in_files_requested"); //test for modification, maybe the script was not edited but was loaded @@ -2813,7 +2813,7 @@ void ScriptEditor::_help_class_open(const String &p_class) { tab_container->add_child(eh); _go_to_tab(tab_container->get_tab_count() - 1); eh->go_to_class(p_class, 0); - eh->connect("go_to_help", this, "_help_class_goto"); + eh->connect_compat("go_to_help", this, "_help_class_goto"); _add_recent_script(p_class); _sort_list_on_update = true; _update_script_names(); @@ -2843,7 +2843,7 @@ void ScriptEditor::_help_class_goto(const String &p_desc) { tab_container->add_child(eh); _go_to_tab(tab_container->get_tab_count() - 1); eh->go_to_help(p_desc); - eh->connect("go_to_help", this, "_help_class_goto"); + eh->connect_compat("go_to_help", this, "_help_class_goto"); _add_recent_script(eh->get_class()); _sort_list_on_update = true; _update_script_names(); @@ -3221,7 +3221,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { filter_scripts = memnew(LineEdit); filter_scripts->set_placeholder(TTR("Filter scripts")); filter_scripts->set_clear_button_enabled(true); - filter_scripts->connect("text_changed", this, "_filter_scripts_text_changed"); + filter_scripts->connect_compat("text_changed", this, "_filter_scripts_text_changed"); scripts_vbox->add_child(filter_scripts); script_list = memnew(ItemList); @@ -3230,13 +3230,13 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_list->set_v_size_flags(SIZE_EXPAND_FILL); script_split->set_split_offset(140); _sort_list_on_update = true; - script_list->connect("gui_input", this, "_script_list_gui_input", varray(), CONNECT_DEFERRED); + script_list->connect_compat("gui_input", this, "_script_list_gui_input", varray(), CONNECT_DEFERRED); script_list->set_allow_rmb_select(true); script_list->set_drag_forwarding(this); context_menu = memnew(PopupMenu); add_child(context_menu); - context_menu->connect("id_pressed", this, "_menu_option"); + context_menu->connect_compat("id_pressed", this, "_menu_option"); context_menu->set_hide_on_window_lose_focus(true); overview_vbox = memnew(VBoxContainer); @@ -3257,14 +3257,14 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { members_overview_alphabeta_sort_button->set_tooltip(TTR("Toggle alphabetical sorting of the method list.")); members_overview_alphabeta_sort_button->set_toggle_mode(true); members_overview_alphabeta_sort_button->set_pressed(EditorSettings::get_singleton()->get("text_editor/tools/sort_members_outline_alphabetically")); - members_overview_alphabeta_sort_button->connect("toggled", this, "_toggle_members_overview_alpha_sort"); + members_overview_alphabeta_sort_button->connect_compat("toggled", this, "_toggle_members_overview_alpha_sort"); buttons_hbox->add_child(members_overview_alphabeta_sort_button); filter_methods = memnew(LineEdit); filter_methods->set_placeholder(TTR("Filter methods")); filter_methods->set_clear_button_enabled(true); - filter_methods->connect("text_changed", this, "_filter_methods_text_changed"); + filter_methods->connect_compat("text_changed", this, "_filter_methods_text_changed"); overview_vbox->add_child(filter_methods); members_overview = memnew(ItemList); @@ -3308,7 +3308,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { recent_scripts = memnew(PopupMenu); recent_scripts->set_name("RecentScripts"); file_menu->get_popup()->add_child(recent_scripts); - recent_scripts->connect("id_pressed", this, "_open_recent_script"); + recent_scripts->connect_compat("id_pressed", this, "_open_recent_script"); _update_recent_scripts(); file_menu->get_popup()->add_separator(); @@ -3330,7 +3330,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { theme_submenu = memnew(PopupMenu); theme_submenu->set_name("Theme"); file_menu->get_popup()->add_child(theme_submenu); - theme_submenu->connect("id_pressed", this, "_theme_option"); + theme_submenu->connect_compat("id_pressed", this, "_theme_option"); theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/import_theme", TTR("Import Theme...")), THEME_IMPORT); theme_submenu->add_shortcut(ED_SHORTCUT("script_editor/reload_theme", TTR("Reload Theme")), THEME_RELOAD); @@ -3349,14 +3349,14 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KEY_MASK_CMD | KEY_BACKSLASH), TOGGLE_SCRIPTS_PANEL); - file_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + file_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); script_search_menu = memnew(MenuButton); menu_hb->add_child(script_search_menu); script_search_menu->set_text(TTR("Search")); script_search_menu->set_switch_on_hover(true); script_search_menu->get_popup()->set_hide_on_window_lose_focus(true); - script_search_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + script_search_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); debug_menu = memnew(MenuButton); menu_hb->add_child(debug_menu); @@ -3372,7 +3372,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { //debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW); debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/keep_debugger_open", TTR("Keep Debugger Open")), DEBUG_SHOW_KEEP_OPEN); debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/debug_with_external_editor", TTR("Debug with External Editor")), DEBUG_WITH_EXTERNAL_EDITOR); - debug_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + debug_menu->get_popup()->connect_compat("id_pressed", this, "_menu_option"); debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true); debug_menu->get_popup()->set_item_disabled(debug_menu->get_popup()->get_item_index(DEBUG_STEP), true); @@ -3393,63 +3393,63 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { site_search = memnew(ToolButton); site_search->set_text(TTR("Online Docs")); - site_search->connect("pressed", this, "_menu_option", varray(SEARCH_WEBSITE)); + site_search->connect_compat("pressed", this, "_menu_option", varray(SEARCH_WEBSITE)); menu_hb->add_child(site_search); site_search->set_tooltip(TTR("Open Godot online documentation.")); request_docs = memnew(ToolButton); request_docs->set_text(TTR("Request Docs")); - request_docs->connect("pressed", this, "_menu_option", varray(REQUEST_DOCS)); + request_docs->connect_compat("pressed", this, "_menu_option", varray(REQUEST_DOCS)); menu_hb->add_child(request_docs); request_docs->set_tooltip(TTR("Help improve the Godot documentation by giving feedback.")); help_search = memnew(ToolButton); help_search->set_text(TTR("Search Help")); - help_search->connect("pressed", this, "_menu_option", varray(SEARCH_HELP)); + help_search->connect_compat("pressed", this, "_menu_option", varray(SEARCH_HELP)); menu_hb->add_child(help_search); help_search->set_tooltip(TTR("Search the reference documentation.")); menu_hb->add_child(memnew(VSeparator)); script_back = memnew(ToolButton); - script_back->connect("pressed", this, "_history_back"); + script_back->connect_compat("pressed", this, "_history_back"); menu_hb->add_child(script_back); script_back->set_disabled(true); script_back->set_tooltip(TTR("Go to previous edited document.")); script_forward = memnew(ToolButton); - script_forward->connect("pressed", this, "_history_forward"); + script_forward->connect_compat("pressed", this, "_history_forward"); menu_hb->add_child(script_forward); script_forward->set_disabled(true); script_forward->set_tooltip(TTR("Go to next edited document.")); - tab_container->connect("tab_changed", this, "_tab_changed"); + tab_container->connect_compat("tab_changed", this, "_tab_changed"); erase_tab_confirm = memnew(ConfirmationDialog); erase_tab_confirm->get_ok()->set_text(TTR("Save")); erase_tab_confirm->add_button(TTR("Discard"), OS::get_singleton()->get_swap_ok_cancel(), "discard"); - erase_tab_confirm->connect("confirmed", this, "_close_current_tab"); - erase_tab_confirm->connect("custom_action", this, "_close_discard_current_tab"); + erase_tab_confirm->connect_compat("confirmed", this, "_close_current_tab"); + erase_tab_confirm->connect_compat("custom_action", this, "_close_discard_current_tab"); add_child(erase_tab_confirm); script_create_dialog = memnew(ScriptCreateDialog); script_create_dialog->set_title(TTR("Create Script")); add_child(script_create_dialog); - script_create_dialog->connect("script_created", this, "_script_created"); + script_create_dialog->connect_compat("script_created", this, "_script_created"); file_dialog_option = -1; file_dialog = memnew(EditorFileDialog); add_child(file_dialog); - file_dialog->connect("file_selected", this, "_file_dialog_action"); + file_dialog->connect_compat("file_selected", this, "_file_dialog_action"); error_dialog = memnew(AcceptDialog); add_child(error_dialog); debugger = memnew(ScriptEditorDebugger(editor)); - debugger->connect("goto_script_line", this, "_goto_script_line"); - debugger->connect("set_execution", this, "_set_execution"); - debugger->connect("clear_execution", this, "_clear_execution"); - debugger->connect("show_debugger", this, "_show_debugger"); + debugger->connect_compat("goto_script_line", this, "_goto_script_line"); + debugger->connect_compat("set_execution", this, "_set_execution"); + debugger->connect_compat("clear_execution", this, "_clear_execution"); + debugger->connect_compat("show_debugger", this, "_show_debugger"); disk_changed = memnew(ConfirmationDialog); { @@ -3464,11 +3464,11 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { vbc->add_child(disk_changed_list); disk_changed_list->set_v_size_flags(SIZE_EXPAND_FILL); - disk_changed->connect("confirmed", this, "_reload_scripts"); + disk_changed->connect_compat("confirmed", this, "_reload_scripts"); disk_changed->get_ok()->set_text(TTR("Reload")); disk_changed->add_button(TTR("Resave"), !OS::get_singleton()->get_swap_ok_cancel(), "resave"); - disk_changed->connect("custom_action", this, "_resave_scripts"); + disk_changed->connect_compat("custom_action", this, "_resave_scripts"); } add_child(disk_changed); @@ -3478,29 +3478,29 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger); debugger->set_tool_button(db); - debugger->connect("breaked", this, "_breaked"); + debugger->connect_compat("breaked", this, "_breaked"); autosave_timer = memnew(Timer); autosave_timer->set_one_shot(false); - autosave_timer->connect(SceneStringNames::get_singleton()->tree_entered, this, "_update_autosave_timer"); - autosave_timer->connect("timeout", this, "_autosave_scripts"); + autosave_timer->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, "_update_autosave_timer"); + autosave_timer->connect_compat("timeout", this, "_autosave_scripts"); add_child(autosave_timer); grab_focus_block = false; help_search_dialog = memnew(EditorHelpSearch); add_child(help_search_dialog); - help_search_dialog->connect("go_to_help", this, "_help_class_goto"); + help_search_dialog->connect_compat("go_to_help", this, "_help_class_goto"); find_in_files_dialog = memnew(FindInFilesDialog); - find_in_files_dialog->connect(FindInFilesDialog::SIGNAL_FIND_REQUESTED, this, "_start_find_in_files", varray(false)); - find_in_files_dialog->connect(FindInFilesDialog::SIGNAL_REPLACE_REQUESTED, this, "_start_find_in_files", varray(true)); + find_in_files_dialog->connect_compat(FindInFilesDialog::SIGNAL_FIND_REQUESTED, this, "_start_find_in_files", varray(false)); + find_in_files_dialog->connect_compat(FindInFilesDialog::SIGNAL_REPLACE_REQUESTED, this, "_start_find_in_files", varray(true)); add_child(find_in_files_dialog); find_in_files = memnew(FindInFilesPanel); find_in_files_button = editor->add_bottom_panel_item(TTR("Search Results"), find_in_files); find_in_files->set_custom_minimum_size(Size2(0, 200) * EDSCALE); - find_in_files->connect(FindInFilesPanel::SIGNAL_RESULT_SELECTED, this, "_on_find_in_files_result_selected"); - find_in_files->connect(FindInFilesPanel::SIGNAL_FILES_MODIFIED, this, "_on_find_in_files_modified_files"); + find_in_files->connect_compat(FindInFilesPanel::SIGNAL_RESULT_SELECTED, this, "_on_find_in_files_result_selected"); + find_in_files->connect_compat(FindInFilesPanel::SIGNAL_FILES_MODIFIED, this, "_on_find_in_files_modified_files"); find_in_files->hide(); find_in_files_button->hide(); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 9f1e2f0353..2069c035fb 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -53,24 +53,24 @@ void ConnectionInfoDialog::popup_connections(String p_method, Vector p_n for (List::Element *E = all_connections.front(); E; E = E->next()) { Connection connection = E->get(); - if (connection.method != p_method) { + if (connection.callable.get_method() != p_method) { continue; } TreeItem *node_item = tree->create_item(root); - node_item->set_text(0, Object::cast_to(connection.source)->get_name()); - node_item->set_icon(0, EditorNode::get_singleton()->get_object_icon(connection.source, "Node")); + node_item->set_text(0, Object::cast_to(connection.signal.get_object())->get_name()); + node_item->set_icon(0, EditorNode::get_singleton()->get_object_icon(connection.signal.get_object(), "Node")); node_item->set_selectable(0, false); node_item->set_editable(0, false); - node_item->set_text(1, connection.signal); + node_item->set_text(1, connection.signal.get_name()); node_item->set_icon(1, get_parent_control()->get_icon("Slot", "EditorIcons")); node_item->set_selectable(1, false); node_item->set_editable(1, false); - node_item->set_text(2, Object::cast_to(connection.target)->get_name()); - node_item->set_icon(2, EditorNode::get_singleton()->get_object_icon(connection.target, "Node")); + node_item->set_text(2, Object::cast_to(connection.callable.get_object())->get_name()); + node_item->set_icon(2, EditorNode::get_singleton()->get_object_icon(connection.callable.get_object(), "Node")); node_item->set_selectable(2, false); node_item->set_editable(2, false); } @@ -603,12 +603,12 @@ void ScriptTextEditor::_validate_script() { Connection connection = E->get(); String base_path = base->get_name(); - String source_path = base == connection.source ? base_path : base_path + "/" + base->get_path_to(Object::cast_to(connection.source)); - String target_path = base == connection.target ? base_path : base_path + "/" + base->get_path_to(Object::cast_to(connection.target)); + String source_path = base == connection.signal.get_object() ? base_path : base_path + "/" + base->get_path_to(Object::cast_to(connection.signal.get_object())); + String target_path = base == connection.callable.get_object() ? base_path : base_path + "/" + base->get_path_to(Object::cast_to(connection.callable.get_object())); warnings_panel->push_cell(); warnings_panel->push_color(warnings_panel->get_color("warning_color", "Editor")); - warnings_panel->add_text(vformat(TTR("Missing connected method '%s' for signal '%s' from node '%s' to node '%s'."), connection.method, connection.signal, source_path, target_path)); + warnings_panel->add_text(vformat(TTR("Missing connected method '%s' for signal '%s' from node '%s' to node '%s'."), connection.callable.get_method(), connection.signal.get_name(), source_path, target_path)); warnings_panel->pop(); // Color. warnings_panel->pop(); // Cell. } @@ -1006,24 +1006,24 @@ void ScriptTextEditor::_update_connected_methods() { } // As deleted nodes are still accessible via the undo/redo system, check if they're still on the tree. - Node *source = Object::cast_to(connection.source); + Node *source = Object::cast_to(connection.signal.get_object()); if (source && !source->is_inside_tree()) { continue; } - if (methods_found.has(connection.method)) { + if (methods_found.has(connection.callable.get_method())) { continue; } - if (!ClassDB::has_method(script->get_instance_base_type(), connection.method)) { + if (!ClassDB::has_method(script->get_instance_base_type(), connection.callable.get_method())) { int line = -1; for (int j = 0; j < functions.size(); j++) { String name = functions[j].get_slice(":", 0); - if (name == connection.method) { + if (name == connection.callable.get_method()) { line = functions[j].get_slice(":", 1).to_int(); - text_edit->set_line_info_icon(line - 1, get_parent_control()->get_icon("Slot", "EditorIcons"), connection.method); - methods_found.insert(connection.method); + text_edit->set_line_info_icon(line - 1, get_parent_control()->get_icon("Slot", "EditorIcons"), connection.callable.get_method()); + methods_found.insert(connection.callable.get_method()); break; } } @@ -1036,7 +1036,7 @@ void ScriptTextEditor::_update_connected_methods() { bool found_inherited_function = false; Ref