diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-21 23:26:13 +0100 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-28 14:24:09 +0100 |
| commit | f742dabafee7f54e1b77148d547e2031d7cc535e (patch) | |
| tree | 5aab3c9c4b9aca10d190a7efa600afb8c7aef213 /editor | |
| parent | 01afc442c73661df677c2b93f4037a21992ee45b (diff) | |
| download | redot-engine-f742dabafee7f54e1b77148d547e2031d7cc535e.tar.gz | |
Signals: Manually port most of remaining connect_compat uses
It's tedious work...
Some can't be ported as they depend on private or protected methods
of different classes, which is not supported by callable_mp (even if
it's a class inherited by the current one).
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/animation_track_editor.cpp | 5 | ||||
| -rw-r--r-- | editor/code_editor.cpp | 2 | ||||
| -rw-r--r-- | editor/editor_help_search.cpp | 2 | ||||
| -rw-r--r-- | editor/editor_layouts_dialog.cpp | 3 | ||||
| -rw-r--r-- | editor/editor_node.cpp | 4 | ||||
| -rw-r--r-- | editor/editor_properties.cpp | 4 | ||||
| -rw-r--r-- | editor/find_in_files.cpp | 4 | ||||
| -rw-r--r-- | editor/inspector_dock.cpp | 2 | ||||
| -rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 8 | ||||
| -rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
| -rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 9 | ||||
| -rw-r--r-- | editor/plugins/polygon_2d_editor_plugin.cpp | 4 | ||||
| -rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 14 | ||||
| -rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 2 | ||||
| -rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 32 | ||||
| -rw-r--r-- | editor/project_manager.cpp | 24 | ||||
| -rw-r--r-- | editor/project_settings_editor.cpp | 2 | ||||
| -rw-r--r-- | editor/scene_tree_dock.cpp | 5 | ||||
| -rw-r--r-- | editor/scene_tree_editor.cpp | 1 |
19 files changed, 59 insertions, 70 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index fee79b9bed..095dbd6849 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -5734,10 +5734,13 @@ void AnimationTrackEditor::_bind_methods() { ClassDB::bind_method("_track_grab_focus", &AnimationTrackEditor::_track_grab_focus); ClassDB::bind_method("_update_tracks", &AnimationTrackEditor::_update_tracks); ClassDB::bind_method("_insert_delay", &AnimationTrackEditor::_insert_delay); - ClassDB::bind_method("_clear_selection", &AnimationTrackEditor::_clear_selection); ClassDB::bind_method("_clear_selection_for_anim", &AnimationTrackEditor::_clear_selection_for_anim); ClassDB::bind_method("_select_at_anim", &AnimationTrackEditor::_select_at_anim); + ClassDB::bind_method("_key_selected", &AnimationTrackEditor::_key_selected); // Still used by some connect_compat. + ClassDB::bind_method("_key_deselected", &AnimationTrackEditor::_key_deselected); // Still used by some connect_compat. + ClassDB::bind_method("_clear_selection", &AnimationTrackEditor::_clear_selection); // Still used by some connect_compat. + ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"))); ADD_SIGNAL(MethodInfo("keying_changed")); ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::FLOAT, "len"))); diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 58c2241e03..c8f7e88082 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1712,7 +1712,7 @@ CodeTextEditor::CodeTextEditor() { error->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER); error->set_mouse_filter(MOUSE_FILTER_STOP); error->connect("gui_input", callable_mp(this, &CodeTextEditor::_error_pressed)); - find_replace_bar->connect_compat("error", error, "set_text"); + find_replace_bar->connect("error", callable_mp(error, &Label::set_text)); // Warnings warning_button = memnew(ToolButton); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 679b3169b0..8ca308572b 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -247,7 +247,7 @@ EditorHelpSearch::EditorHelpSearch() { results_tree->set_hide_root(true); results_tree->set_select_mode(Tree::SELECT_ROW); results_tree->connect("item_activated", callable_mp(this, &EditorHelpSearch::_confirmed)); - results_tree->connect_compat("item_selected", get_ok(), "set_disabled", varray(false)); + results_tree->connect("item_selected", callable_mp((BaseButton *)get_ok(), &BaseButton::set_disabled), varray(false)); vbox->add_child(results_tree, true); } diff --git a/editor/editor_layouts_dialog.cpp b/editor/editor_layouts_dialog.cpp index 86633f86ca..5d4a9e738e 100644 --- a/editor/editor_layouts_dialog.cpp +++ b/editor/editor_layouts_dialog.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "editor_layouts_dialog.h" + #include "core/class_db.h" #include "core/io/config_file.h" #include "core/os/keyboard.h" @@ -128,7 +129,7 @@ EditorLayoutsDialog::EditorLayoutsDialog() { name->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5); name->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -5); name->connect("gui_input", callable_mp(this, &EditorLayoutsDialog::_line_gui_input)); - name->connect_compat("focus_entered", layout_names, "unselect_all"); + name->connect("focus_entered", callable_mp(layout_names, &ItemList::unselect_all)); } void EditorLayoutsDialog::set_name_line_enabled(bool p_enabled) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8a75c1b964..6f8027ba64 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2972,7 +2972,7 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed ToolButton *tb = memnew(ToolButton); tb->set_toggle_mode(true); - tb->connect_compat("pressed", singleton, "_editor_select", varray(singleton->main_editor_buttons.size())); + tb->connect("pressed", callable_mp(singleton, &EditorNode::_editor_select), varray(singleton->main_editor_buttons.size())); tb->set_text(p_editor->get_name()); Ref<Texture2D> icon = p_editor->get_icon(); @@ -5473,6 +5473,8 @@ void EditorNode::_bind_methods() { ClassDB::bind_method(D_METHOD("get_gui_base"), &EditorNode::get_gui_base); + ClassDB::bind_method(D_METHOD("_on_plugin_ready"), &EditorNode::_on_plugin_ready); // Still used by some connect_compat. + ClassDB::bind_method("_screenshot", &EditorNode::_screenshot); ClassDB::bind_method("_save_screenshot", &EditorNode::_save_screenshot); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 7bfe4e644b..9ff34f8fb4 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -788,7 +788,7 @@ EditorPropertyLayers::EditorPropertyLayers() { add_child(layers); layers->set_hide_on_checkable_item_selection(false); layers->connect("id_pressed", callable_mp(this, &EditorPropertyLayers::_menu_pressed)); - layers->connect_compat("popup_hide", button, "set_pressed", varray(false)); + layers->connect("popup_hide", callable_mp((BaseButton *)button, &BaseButton::set_pressed), varray(false)); } ///////////////////// INT ///////////////////////// @@ -2854,7 +2854,7 @@ EditorPropertyResource::EditorPropertyResource() { edit->set_flat(true); edit->set_toggle_mode(true); menu->connect("id_pressed", callable_mp(this, &EditorPropertyResource::_menu_option)); - menu->connect_compat("popup_hide", edit, "set_pressed", varray(false)); + menu->connect("popup_hide", callable_mp((BaseButton *)edit, &BaseButton::set_pressed), varray(false)); edit->connect("pressed", callable_mp(this, &EditorPropertyResource::_update_menu)); hbc->add_child(edit); edit->connect("gui_input", callable_mp(this, &EditorPropertyResource::_button_input)); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index faf91c2dbe..5a7d4cede7 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -557,8 +557,8 @@ const char *FindInFilesPanel::SIGNAL_FILES_MODIFIED = "files_modified"; FindInFilesPanel::FindInFilesPanel() { _finder = memnew(FindInFiles); - _finder->connect_compat(FindInFiles::SIGNAL_RESULT_FOUND, this, "_on_result_found"); - _finder->connect_compat(FindInFiles::SIGNAL_FINISHED, this, "_on_finished"); + _finder->connect(FindInFiles::SIGNAL_RESULT_FOUND, callable_mp(this, &FindInFilesPanel::_on_result_found)); + _finder->connect(FindInFiles::SIGNAL_FINISHED, callable_mp(this, &FindInFilesPanel::_on_finished)); add_child(_finder); VBoxContainer *vbc = memnew(VBoxContainer); diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index cad1ede8de..6b8cb49412 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -345,7 +345,7 @@ void InspectorDock::_notification(int p_what) { void InspectorDock::_bind_methods() { ClassDB::bind_method("update_keying", &InspectorDock::update_keying); - ClassDB::bind_method("_transform_keyed", &InspectorDock::_transform_keyed); + ClassDB::bind_method("_transform_keyed", &InspectorDock::_transform_keyed); // Still used by some connect_compat. ClassDB::bind_method("_unref_resource", &InspectorDock::_unref_resource); ClassDB::bind_method("_paste_resource", &InspectorDock::_paste_resource); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index a42fc9d6a6..5ebb655c79 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1501,16 +1501,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_compat("idle_frame", this, "call_deferred")) { - get_tree()->connect_compat("idle_frame", this, "call_deferred", varray("_prepare_onion_layers_1")); + if (!get_tree()->is_connected("idle_frame", callable_mp((Object *)this, &Object::call_deferred))) { + get_tree()->connect("idle_frame", callable_mp((Object *)this, &Object::call_deferred), varray("_prepare_onion_layers_1")); } } void AnimationPlayerEditor::_stop_onion_skinning() { - if (get_tree()->is_connected_compat("idle_frame", this, "call_deferred")) { + if (get_tree()->is_connected("idle_frame", callable_mp((Object *)this, &Object::call_deferred))) { - get_tree()->disconnect_compat("idle_frame", this, "call_deferred"); + get_tree()->disconnect("idle_frame", callable_mp((Object *)this, &Object::call_deferred)); _free_onion_layers(); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 8277879d80..72396174ee 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5390,7 +5390,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { editor = p_editor; editor_selection = p_editor->get_editor_selection(); editor_selection->add_editor_plugin(this); - editor_selection->connect_compat("selection_changed", this, "update"); + editor_selection->connect("selection_changed", callable_mp((CanvasItem *)this, &CanvasItem::update)); editor_selection->connect("selection_changed", callable_mp(this, &CanvasItemEditor::_selection_changed)); editor->call_deferred("connect", make_binds("play_pressed", Callable(this, "_update_override_camera_button"), true)); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index d0926ee47d..adf859eb1e 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -70,15 +70,15 @@ void CurveEditor::set_curve(Ref<Curve> curve) { return; if (_curve_ref.is_valid()) { - _curve_ref->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); - _curve_ref->disconnect_compat(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); + _curve_ref->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveEditor::_curve_changed)); + _curve_ref->disconnect(Curve::SIGNAL_RANGE_CHANGED, callable_mp(this, &CurveEditor::_curve_changed)); } _curve_ref = curve; if (_curve_ref.is_valid()) { - _curve_ref->connect_compat(CoreStringNames::get_singleton()->changed, this, "_curve_changed"); - _curve_ref->connect_compat(Curve::SIGNAL_RANGE_CHANGED, this, "_curve_changed"); + _curve_ref->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &CurveEditor::_curve_changed)); + _curve_ref->connect(Curve::SIGNAL_RANGE_CHANGED, callable_mp(this, &CurveEditor::_curve_changed)); } _selected_point = -1; @@ -749,7 +749,6 @@ void CurveEditor::_draw() { void CurveEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_gui_input"), &CurveEditor::on_gui_input); - ClassDB::bind_method(D_METHOD("_curve_changed"), &CurveEditor::_curve_changed); } //--------------- diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index f6a55ae545..8c115586a4 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -1259,7 +1259,7 @@ 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_compat("pressed", this, "_menu_option", varray(MODE_EDIT_UV)); + button_uv->connect("pressed", callable_mp(this, &Polygon2DEditor::_menu_option), varray(MODE_EDIT_UV)); uv_mode = UV_MODE_EDIT_POINT; uv_edit = memnew(AcceptDialog); @@ -1374,7 +1374,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_compat("id_pressed", this, "_menu_option"); + uv_menu->get_popup()->connect("id_pressed", callable_mp(this, &Polygon2DEditor::_menu_option)); uv_mode_hb->add_child(memnew(VSeparator)); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 2b513feedc..fd9c8f6f39 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -3042,16 +3042,12 @@ void ScriptEditor::_bind_methods() { ClassDB::bind_method("_copy_script_path", &ScriptEditor::_copy_script_path); ClassDB::bind_method("_get_debug_tooltip", &ScriptEditor::_get_debug_tooltip); - ClassDB::bind_method("_update_autosave_timer", &ScriptEditor::_update_autosave_timer); ClassDB::bind_method("_update_script_connections", &ScriptEditor::_update_script_connections); ClassDB::bind_method("_help_class_open", &ScriptEditor::_help_class_open); ClassDB::bind_method("_live_auto_reload_running_scripts", &ScriptEditor::_live_auto_reload_running_scripts); ClassDB::bind_method("_unhandled_input", &ScriptEditor::_unhandled_input); ClassDB::bind_method("_update_members_overview", &ScriptEditor::_update_members_overview); ClassDB::bind_method("_update_recent_scripts", &ScriptEditor::_update_recent_scripts); - ClassDB::bind_method("_start_find_in_files", &ScriptEditor::_start_find_in_files); - ClassDB::bind_method("_on_find_in_files_result_selected", &ScriptEditor::_on_find_in_files_result_selected); - ClassDB::bind_method("_on_find_in_files_modified_files", &ScriptEditor::_on_find_in_files_modified_files); ClassDB::bind_method(D_METHOD("get_drag_data_fw", "point", "from"), &ScriptEditor::get_drag_data_fw); ClassDB::bind_method(D_METHOD("can_drop_data_fw", "point", "data", "from"), &ScriptEditor::can_drop_data_fw); @@ -3340,7 +3336,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { autosave_timer = memnew(Timer); autosave_timer->set_one_shot(false); - autosave_timer->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, "_update_autosave_timer"); + autosave_timer->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &ScriptEditor::_update_autosave_timer)); autosave_timer->connect("timeout", callable_mp(this, &ScriptEditor::_autosave_scripts)); add_child(autosave_timer); @@ -3351,14 +3347,14 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { help_search_dialog->connect("go_to_help", callable_mp(this, &ScriptEditor::_help_class_goto)); find_in_files_dialog = memnew(FindInFilesDialog); - 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)); + find_in_files_dialog->connect(FindInFilesDialog::SIGNAL_FIND_REQUESTED, callable_mp(this, &ScriptEditor::_start_find_in_files), varray(false)); + find_in_files_dialog->connect(FindInFilesDialog::SIGNAL_REPLACE_REQUESTED, callable_mp(this, &ScriptEditor::_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_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->connect(FindInFilesPanel::SIGNAL_RESULT_SELECTED, callable_mp(this, &ScriptEditor::_on_find_in_files_result_selected)); + find_in_files->connect(FindInFilesPanel::SIGNAL_FILES_MODIFIED, callable_mp(this, &ScriptEditor::_on_find_in_files_modified_files)); find_in_files->hide(); find_in_files_button->hide(); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index c6747e4e48..d23b037ed4 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -260,7 +260,7 @@ void TileSetEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, C void TileSetEditor::_bind_methods() { ClassDB::bind_method("_undo_redo_import_scene", &TileSetEditor::_undo_redo_import_scene); - ClassDB::bind_method("_on_workspace_process", &TileSetEditor::_on_workspace_process); + ClassDB::bind_method("_on_workspace_process", &TileSetEditor::_on_workspace_process); // Still used by some connect_compat. ClassDB::bind_method("_set_snap_step", &TileSetEditor::_set_snap_step); ClassDB::bind_method("_set_snap_off", &TileSetEditor::_set_snap_off); ClassDB::bind_method("_set_snap_sep", &TileSetEditor::_set_snap_sep); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 1f400974b6..b3b9afb811 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -85,7 +85,7 @@ void VisualShaderEditor::edit(VisualShader *p_visual_shader) { visual_shader->set_graph_offset(graph->get_scroll_ofs() / EDSCALE); } else { if (visual_shader.is_valid()) { - if (visual_shader->is_connected_compat("changed", this, "")) { + if (visual_shader->is_connected("changed", callable_mp(this, &VisualShaderEditor::_update_preview))) { visual_shader->disconnect("changed", callable_mp(this, &VisualShaderEditor::_update_preview)); } } @@ -523,10 +523,6 @@ void VisualShaderEditor::_update_graph() { expression = expression_node->get_expression(); } - /*if (!vsnode->is_connected("changed", this, "_node_changed")) { - vsnode->connect("changed", this, "_node_changed", varray(vsnode->get_instance_id()), CONNECT_DEFERRED); - }*/ - node->set_offset(position); node->set_title(vsnode->get_caption()); @@ -662,7 +658,7 @@ void VisualShaderEditor::_update_graph() { case Variant::COLOR: { button->set_custom_minimum_size(Size2(30, 0) * EDSCALE); - button->connect_compat("draw", this, "_draw_color_over_button", varray(button, default_value)); + button->connect("draw", callable_mp(this, &VisualShaderEditor::_draw_color_over_button), varray(button, default_value)); } break; case Variant::BOOL: { button->set_text(((bool)default_value) ? "true" : "false"); @@ -2940,15 +2936,10 @@ class VisualShaderNodePluginInputEditor : public OptionButton { Ref<VisualShaderNodeInput> input; -protected: - static void _bind_methods() { - ClassDB::bind_method("_item_selected", &VisualShaderNodePluginInputEditor::_item_selected); - } - public: void _notification(int p_what) { if (p_what == NOTIFICATION_READY) { - connect_compat("item_selected", this, "_item_selected"); + connect("item_selected", callable_mp(this, &VisualShaderNodePluginInputEditor::_item_selected)); } } @@ -3078,25 +3069,22 @@ public: bool res_prop = Object::cast_to<EditorPropertyResource>(p_properties[i]); if (res_prop) { - p_properties[i]->connect_compat("resource_selected", this, "_resource_selected"); + p_properties[i]->connect("resource_selected", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_resource_selected)); } - properties[i]->connect_compat("property_changed", this, "_property_changed"); + properties[i]->connect("property_changed", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_property_changed)); properties[i]->set_object_and_property(node.ptr(), p_names[i]); properties[i]->update_property(); properties[i]->set_name_split_ratio(0); } - node->connect_compat("changed", this, "_node_changed"); - node->connect_compat("editor_refresh_request", this, "_refresh_request", varray(), CONNECT_DEFERRED); + node->connect("changed", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_node_changed)); + node->connect("editor_refresh_request", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_refresh_request), varray(), CONNECT_DEFERRED); } static void _bind_methods() { - ClassDB::bind_method("_property_changed", &VisualShaderNodePluginDefaultEditor::_property_changed, DEFVAL(String()), DEFVAL(false)); - ClassDB::bind_method("_node_changed", &VisualShaderNodePluginDefaultEditor::_node_changed); - ClassDB::bind_method("_refresh_request", &VisualShaderNodePluginDefaultEditor::_refresh_request); - ClassDB::bind_method("_resource_selected", &VisualShaderNodePluginDefaultEditor::_resource_selected); - ClassDB::bind_method("_open_inspector", &VisualShaderNodePluginDefaultEditor::_open_inspector); - ClassDB::bind_method("_show_prop_names", &VisualShaderNodePluginDefaultEditor::_show_prop_names); + ClassDB::bind_method("_refresh_request", &VisualShaderNodePluginDefaultEditor::_refresh_request); // Used by UndoRedo. + ClassDB::bind_method("_open_inspector", &VisualShaderNodePluginDefaultEditor::_open_inspector); // Used by UndoRedo. + ClassDB::bind_method("_show_prop_names", &VisualShaderNodePluginDefaultEditor::_show_prop_names); // Used with call_deferred. } }; diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index d973d362c9..79f3745d11 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -811,7 +811,7 @@ public: create_dir = memnew(Button); pnhb->add_child(create_dir); create_dir->set_text(TTR("Create Folder")); - create_dir->connect_compat("pressed", this, "_create_folder"); + create_dir->connect("pressed", callable_mp(this, &ProjectDialog::_create_folder)); path_container = memnew(VBoxContainer); vb->add_child(path_container); @@ -848,7 +848,7 @@ public: browse = memnew(Button); browse->set_text(TTR("Browse")); - browse->connect_compat("pressed", this, "_browse_path"); + browse->connect("pressed", callable_mp(this, &ProjectDialog::_browse_path)); pphb->add_child(browse); // install status icon @@ -858,7 +858,7 @@ public: install_browse = memnew(Button); install_browse->set_text(TTR("Browse")); - install_browse->connect_compat("pressed", this, "_browse_install_path"); + install_browse->connect("pressed", callable_mp(this, &ProjectDialog::_browse_install_path)); iphb->add_child(install_browse); msg = memnew(Label); @@ -928,13 +928,13 @@ public: fdialog_install->set_access(FileDialog::ACCESS_FILESYSTEM); add_child(fdialog); add_child(fdialog_install); - project_name->connect_compat("text_changed", this, "_text_changed"); - project_path->connect_compat("text_changed", this, "_path_text_changed"); - install_path->connect_compat("text_changed", this, "_path_text_changed"); - fdialog->connect_compat("dir_selected", this, "_path_selected"); - fdialog->connect_compat("file_selected", this, "_file_selected"); - fdialog_install->connect_compat("dir_selected", this, "_install_path_selected"); - fdialog_install->connect_compat("file_selected", this, "_install_path_selected"); + project_name->connect("text_changed", callable_mp(this, &ProjectDialog::_text_changed)); + project_path->connect("text_changed", callable_mp(this, &ProjectDialog::_path_text_changed)); + install_path->connect("text_changed", callable_mp(this, &ProjectDialog::_path_text_changed)); + fdialog->connect("dir_selected", callable_mp(this, &ProjectDialog::_path_selected)); + fdialog->connect("file_selected", callable_mp(this, &ProjectDialog::_file_selected)); + fdialog_install->connect("dir_selected", callable_mp(this, &ProjectDialog::_install_path_selected)); + fdialog_install->connect("file_selected", callable_mp(this, &ProjectDialog::_install_path_selected)); set_hide_on_ok(false); mode = MODE_NEW; @@ -2516,8 +2516,8 @@ ProjectManager::ProjectManager() { pc->set_v_size_flags(SIZE_EXPAND_FILL); _project_list = memnew(ProjectList); - _project_list->connect_compat(ProjectList::SIGNAL_SELECTION_CHANGED, this, "_update_project_buttons"); - _project_list->connect_compat(ProjectList::SIGNAL_PROJECT_ASK_OPEN, this, "_open_selected_projects_ask"); + _project_list->connect(ProjectList::SIGNAL_SELECTION_CHANGED, callable_mp(this, &ProjectManager::_update_project_buttons)); + _project_list->connect(ProjectList::SIGNAL_PROJECT_ASK_OPEN, callable_mp(this, &ProjectManager::_open_selected_projects_ask)); pc->add_child(_project_list); _project_list->set_enable_h_scroll(false); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 621838e2fe..f435e98864 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -2098,7 +2098,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { timer = memnew(Timer); timer->set_wait_time(1.5); - timer->connect_compat("timeout", ProjectSettings::get_singleton(), "save"); + timer->connect("timeout", callable_mp(ProjectSettings::get_singleton(), &ProjectSettings::save)); timer->set_one_shot(true); add_child(timer); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index d466db2ba9..1648aacb71 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -34,7 +34,6 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "core/project_settings.h" - #include "editor/debugger/editor_debugger_node.h" #include "editor/editor_feature_profile.h" #include "editor/editor_node.h" @@ -1052,7 +1051,7 @@ void SceneTreeDock::_notification(int p_what) { if (canvas_item_plugin) { canvas_item_plugin->get_canvas_item_editor()->connect_compat("item_lock_status_changed", scene_tree, "_update_tree"); canvas_item_plugin->get_canvas_item_editor()->connect_compat("item_group_status_changed", scene_tree, "_update_tree"); - scene_tree->connect_compat("node_changed", canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), "update"); + scene_tree->connect("node_changed", callable_mp((CanvasItem *)canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), &CanvasItem::update)); } SpatialEditorPlugin *spatial_editor_plugin = Object::cast_to<SpatialEditorPlugin>(editor_data->get_editor("3D")); @@ -2113,7 +2112,7 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop Object::Connection &c = F->get(); if (!(c.flags & Object::CONNECT_PERSIST)) continue; - newnode->connect_compat(c.signal.get_name(), c.callable.get_object(), c.callable.get_method(), c.binds, Object::CONNECT_PERSIST); + newnode->connect(c.signal.get_name(), c.callable, c.binds, Object::CONNECT_PERSIST); } } diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 328b78e1d1..e4e642e368 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -1089,6 +1089,7 @@ void SceneTreeEditor::set_connecting_signal(bool p_enable) { void SceneTreeEditor::_bind_methods() { + ClassDB::bind_method("_update_tree", &SceneTreeEditor::_update_tree); // Still used by some connect_compat. ClassDB::bind_method("_rename_node", &SceneTreeEditor::_rename_node); ClassDB::bind_method("_test_update_tree", &SceneTreeEditor::_test_update_tree); |
