diff options
-rw-r--r-- | editor/animation_bezier_editor.cpp | 4 | ||||
-rw-r--r-- | editor/animation_track_editor.cpp | 18 | ||||
-rw-r--r-- | editor/animation_track_editor.h | 10 | ||||
-rw-r--r-- | editor/connections_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/editor_file_dialog.h | 4 | ||||
-rw-r--r-- | editor/editor_node.cpp | 54 | ||||
-rw-r--r-- | editor/editor_node.h | 10 | ||||
-rw-r--r-- | editor/editor_plugin_settings.cpp | 2 | ||||
-rw-r--r-- | editor/export/project_export.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 9 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/texture_3d_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/texture_3d_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/texture_layered_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/texture_layered_editor_plugin.h | 1 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 8 | ||||
-rw-r--r-- | editor/scene_tree_editor.cpp | 2 | ||||
-rw-r--r-- | editor/scene_tree_editor.h | 4 | ||||
-rw-r--r-- | editor/shader_globals_editor.cpp | 2 | ||||
-rw-r--r-- | modules/mono/editor/editor_internal_calls.cpp | 2 | ||||
-rw-r--r-- | scene/3d/skeleton_3d.cpp | 3 | ||||
-rw-r--r-- | scene/3d/skeleton_3d.h | 4 |
22 files changed, 62 insertions, 101 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 219f3fdbe1..3b87b3e65e 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -667,8 +667,8 @@ void AnimationBezierTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) { void AnimationBezierTrackEdit::set_editor(AnimationTrackEditor *p_editor) { editor = p_editor; - connect("clear_selection", Callable(editor, "_clear_selection").bind(false)); - connect("select_key", Callable(editor, "_key_selected"), CONNECT_DEFERRED); + connect("clear_selection", callable_mp(editor, &AnimationTrackEditor::_clear_selection).bind(false)); + connect("select_key", callable_mp(editor, &AnimationTrackEditor::_key_selected), CONNECT_DEFERRED); } void AnimationBezierTrackEdit::_play_position_draw() { diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index c2e04e4be9..119ddcf521 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -3420,9 +3420,6 @@ void AnimationTrackEditGroup::_zoom_changed() { queue_redraw(); } -void AnimationTrackEditGroup::_bind_methods() { -} - AnimationTrackEditGroup::AnimationTrackEditGroup() { set_mouse_filter(MOUSE_FILTER_PASS); } @@ -6457,16 +6454,11 @@ void AnimationTrackEditor::_select_all_tracks_for_copy() { } void AnimationTrackEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_animation_update"), &AnimationTrackEditor::_animation_update); - ClassDB::bind_method(D_METHOD("_track_grab_focus"), &AnimationTrackEditor::_track_grab_focus); - ClassDB::bind_method(D_METHOD("_update_tracks"), &AnimationTrackEditor::_update_tracks); - ClassDB::bind_method(D_METHOD("_redraw_tracks"), &AnimationTrackEditor::_redraw_tracks); - ClassDB::bind_method(D_METHOD("_clear_selection_for_anim"), &AnimationTrackEditor::_clear_selection_for_anim); - ClassDB::bind_method(D_METHOD("_select_at_anim"), &AnimationTrackEditor::_select_at_anim); - - ClassDB::bind_method(D_METHOD("_key_selected"), &AnimationTrackEditor::_key_selected); // Still used by some connect_compat. - ClassDB::bind_method(D_METHOD("_key_deselected"), &AnimationTrackEditor::_key_deselected); // Still used by some connect_compat. - ClassDB::bind_method(D_METHOD("_clear_selection"), &AnimationTrackEditor::_clear_selection); // Still used by some connect_compat. + ClassDB::bind_method("_animation_update", &AnimationTrackEditor::_animation_update); + ClassDB::bind_method("_track_grab_focus", &AnimationTrackEditor::_track_grab_focus); + 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("_clear_selection", &AnimationTrackEditor::_clear_selection); ClassDB::bind_method(D_METHOD("_bezier_track_set_key_handle_mode", "animation", "track_idx", "key_idx", "key_handle_mode", "key_handle_set_mode"), &AnimationTrackEditor::_bezier_track_set_key_handle_mode, DEFVAL(Animation::HANDLE_SET_MODE_NONE)); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index ac69b88e99..5c51921d93 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -280,7 +280,6 @@ class AnimationTrackEditGroup : public Control { void _zoom_changed(); protected: - static void _bind_methods(); void _notification(int p_what); public: @@ -407,7 +406,6 @@ class AnimationTrackEditor : public VBoxContainer { void _insert_key_from_track(float p_ofs, int p_track); void _add_method_key(const String &p_method); - void _clear_selection(bool p_update = false); void _clear_selection_for_anim(const Ref<Animation> &p_anim); void _select_at_anim(const Ref<Animation> &p_anim, int p_track, float p_pos); @@ -425,9 +423,6 @@ class AnimationTrackEditor : public VBoxContainer { RBMap<SelectedKey, KeyInfo> selection; - void _key_selected(int p_key, bool p_single, int p_track); - void _key_deselected(int p_key, int p_track); - bool moving_selection = false; float moving_selection_offset = 0.0f; void _move_selection_begin(); @@ -531,6 +526,11 @@ protected: void _notification(int p_what); public: + // Public for use with callable_mp. + void _clear_selection(bool p_update = false); + void _key_selected(int p_key, bool p_single, int p_track); + void _key_deselected(int p_key, int p_track); + enum { EDIT_COPY_TRACKS, EDIT_COPY_TRACKS_CONFIRM, diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 861d05f17a..c83011845b 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -810,7 +810,7 @@ void ConnectionsDock::_go_to_script(TreeItem &p_item) { } if (script.is_valid() && ScriptEditor::get_singleton()->script_goto_method(script, cd.method)) { - EditorNode::get_singleton()->call("_editor_select", EditorNode::EDITOR_SCRIPT); + EditorNode::get_singleton()->editor_select(EditorNode::EDITOR_SCRIPT); } } diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index 6d11cb10ed..2e7302aaf9 100644 --- a/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h @@ -202,7 +202,6 @@ private: void _select_drive(int p_idx); void _dir_submitted(String p_dir); - void _file_submitted(const String &p_file); void _action_pressed(); void _save_confirm_pressed(); void _cancel_pressed(); @@ -240,6 +239,9 @@ protected: static void _bind_methods(); public: + // Public for use with callable_mp. + void _file_submitted(const String &p_file); + void popup_file_dialog(); void clear_filters(); void add_filter(const String &p_filter, const String &p_description = ""); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8eaddcb7e1..3a3169daab 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -465,15 +465,15 @@ void EditorNode::shortcut_input(const Ref<InputEvent> &p_event) { } if (ED_IS_SHORTCUT("editor/editor_2d", p_event)) { - _editor_select(EDITOR_2D); + editor_select(EDITOR_2D); } else if (ED_IS_SHORTCUT("editor/editor_3d", p_event)) { - _editor_select(EDITOR_3D); + editor_select(EDITOR_3D); } else if (ED_IS_SHORTCUT("editor/editor_script", p_event)) { - _editor_select(EDITOR_SCRIPT); + editor_select(EDITOR_SCRIPT); } else if (ED_IS_SHORTCUT("editor/editor_help", p_event)) { emit_signal(SNAME("request_help_search"), ""); } else if (ED_IS_SHORTCUT("editor/editor_assetlib", p_event) && AssetLibraryEditorPlugin::is_available()) { - _editor_select(EDITOR_ASSETLIB); + editor_select(EDITOR_ASSETLIB); } else if (ED_IS_SHORTCUT("editor/editor_next", p_event)) { _editor_select_next(); } else if (ED_IS_SHORTCUT("editor/editor_prev", p_event)) { @@ -584,7 +584,7 @@ void EditorNode::_update_from_settings() { void EditorNode::_select_default_main_screen_plugin() { if (EDITOR_3D < main_editor_buttons.size() && main_editor_buttons[EDITOR_3D]->is_visible()) { // If the 3D editor is enabled, use this as the default. - _editor_select(EDITOR_3D); + editor_select(EDITOR_3D); return; } @@ -593,12 +593,12 @@ void EditorNode::_select_default_main_screen_plugin() { for (int i = 0; i < main_editor_buttons.size(); i++) { Button *editor_button = main_editor_buttons[i]; if (editor_button->is_visible()) { - _editor_select(i); + editor_select(i); return; } } - _editor_select(-1); + editor_select(-1); } void EditorNode::_notification(int p_what) { @@ -1190,7 +1190,7 @@ void EditorNode::_editor_select_next() { } } while (!main_editor_buttons[editor]->is_visible()); - _editor_select(editor); + editor_select(editor); } void EditorNode::_open_command_palette() { @@ -1208,7 +1208,7 @@ void EditorNode::_editor_select_prev() { } } while (!main_editor_buttons[editor]->is_visible()); - _editor_select(editor); + editor_select(editor); } Error EditorNode::load_resource(const String &p_resource, bool p_ignore_broken_deps) { @@ -2390,7 +2390,7 @@ void EditorNode::_edit_current(bool p_skip_foreign) { else if (main_plugin != editor_plugin_screen && (!ScriptEditor::get_singleton() || !ScriptEditor::get_singleton()->is_visible_in_tree() || ScriptEditor::get_singleton()->can_take_away_focus())) { // Update screen main_plugin. - _editor_select(plugin_index); + editor_select(plugin_index); main_plugin->edit(current_obj); } else { editor_plugin_screen->edit(current_obj); @@ -3303,7 +3303,7 @@ VBoxContainer *EditorNode::get_main_screen_control() { return main_screen_vbox; } -void EditorNode::_editor_select(int p_which) { +void EditorNode::editor_select(int p_which) { static bool selecting = false; if (selecting || changing_scene) { return; @@ -3357,7 +3357,7 @@ void EditorNode::select_editor_by_name(const String &p_name) { for (int i = 0; i < main_editor_buttons.size(); i++) { if (main_editor_buttons[i]->get_text() == p_name) { - _editor_select(i); + editor_select(i); return; } } @@ -3370,7 +3370,7 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed Button *tb = memnew(Button); tb->set_flat(true); tb->set_toggle_mode(true); - tb->connect("pressed", callable_mp(singleton, &EditorNode::_editor_select).bind(singleton->main_editor_buttons.size())); + tb->connect("pressed", callable_mp(singleton, &EditorNode::editor_select).bind(singleton->main_editor_buttons.size())); tb->set_name(p_editor->get_name()); tb->set_text(p_editor->get_name()); @@ -3404,7 +3404,7 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor, bool p_config_chan for (int i = 0; i < singleton->main_editor_buttons.size(); i++) { if (p_editor->get_name() == singleton->main_editor_buttons[i]->get_text()) { if (singleton->main_editor_buttons[i]->is_pressed()) { - singleton->_editor_select(EDITOR_SCRIPT); + singleton->editor_select(EDITOR_SCRIPT); } memdelete(singleton->main_editor_buttons[i]); @@ -3628,7 +3628,7 @@ void EditorNode::_set_main_scene_state(Dictionary p_state, Node *p_for_scene) { int index = p_state["editor_index"]; if (current < 2) { // If currently in spatial/2d, only switch to spatial/2d. If currently in script, stay there. if (index < 2 || !get_edited_scene()) { - _editor_select(index); + editor_select(index); } } } @@ -3639,9 +3639,9 @@ void EditorNode::_set_main_scene_state(Dictionary p_state, Node *p_for_scene) { int n2d = 0, n3d = 0; _find_node_types(get_edited_scene(), n2d, n3d); if (n2d > n3d) { - _editor_select(EDITOR_2D); + editor_select(EDITOR_2D); } else if (n3d > n2d) { - _editor_select(EDITOR_3D); + editor_select(EDITOR_3D); } } } @@ -3668,10 +3668,6 @@ bool EditorNode::is_changing_scene() const { return changing_scene; } -void EditorNode::_clear_undo_history() { - get_undo_redo()->clear_history(false); -} - void EditorNode::set_current_scene(int p_idx) { // Save the folding in case the scene gets reloaded. if (editor_data.get_scene_path(p_idx) != "" && editor_data.get_edited_scene_root(p_idx)) { @@ -5937,7 +5933,7 @@ void EditorNode::_feature_profile_changed() { if ((profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D) && singleton->main_editor_buttons[EDITOR_3D]->is_pressed()) || (profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCRIPT) && singleton->main_editor_buttons[EDITOR_SCRIPT]->is_pressed()) || (AssetLibraryEditorPlugin::is_available() && profile->is_feature_disabled(EditorFeatureProfile::FEATURE_ASSET_LIB) && singleton->main_editor_buttons[EDITOR_ASSETLIB]->is_pressed())) { - _editor_select(EDITOR_2D); + editor_select(EDITOR_2D); } } else { import_tabs->set_tab_hidden(import_tabs->get_tab_idx_from_control(ImportDock::get_singleton()), false); @@ -5960,19 +5956,14 @@ void EditorNode::_bind_methods() { GLOBAL_DEF("editor/scene/scene_naming", SCENE_NAME_CASING_SNAKE_CASE); ProjectSettings::get_singleton()->set_custom_property_info("editor/scene/scene_naming", PropertyInfo(Variant::INT, "editor/scene/scene_naming", PROPERTY_HINT_ENUM, "Auto,PascalCase,snake_case")); ClassDB::bind_method("edit_current", &EditorNode::edit_current); - ClassDB::bind_method("_editor_select", &EditorNode::_editor_select); - ClassDB::bind_method("_node_renamed", &EditorNode::_node_renamed); ClassDB::bind_method("edit_node", &EditorNode::edit_node); ClassDB::bind_method(D_METHOD("push_item", "object", "property", "inspector_only"), &EditorNode::push_item, DEFVAL(""), DEFVAL(false)); - ClassDB::bind_method("_get_scene_metadata", &EditorNode::_get_scene_metadata); ClassDB::bind_method("set_edited_scene", &EditorNode::set_edited_scene); ClassDB::bind_method("open_request", &EditorNode::open_request); ClassDB::bind_method("edit_foreign_resource", &EditorNode::edit_foreign_resource); ClassDB::bind_method("is_resource_read_only", &EditorNode::is_resource_read_only); - ClassDB::bind_method("_close_messages", &EditorNode::_close_messages); - ClassDB::bind_method("_show_messages", &EditorNode::_show_messages); ClassDB::bind_method("stop_child_process", &EditorNode::stop_child_process); @@ -5981,19 +5972,10 @@ void EditorNode::_bind_methods() { ClassDB::bind_method("_set_main_scene_state", &EditorNode::_set_main_scene_state); ClassDB::bind_method("_update_recent_scenes", &EditorNode::_update_recent_scenes); - ClassDB::bind_method("_clear_undo_history", &EditorNode::_clear_undo_history); - ClassDB::bind_method("edit_item_resource", &EditorNode::edit_item_resource); 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); - - ClassDB::bind_method("_version_button_pressed", &EditorNode::_version_button_pressed); - ADD_SIGNAL(MethodInfo("play_pressed")); ADD_SIGNAL(MethodInfo("pause_pressed")); ADD_SIGNAL(MethodInfo("stop_pressed")); diff --git a/editor/editor_node.h b/editor/editor_node.h index 200d68908c..da45935f95 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -543,7 +543,6 @@ private: void _update_file_menu_opened(); void _update_file_menu_closed(); - void _on_plugin_ready(Object *p_script, const String &p_activate_name); void _remove_plugin_from_enabled(const String &p_name); void _fs_changed(); @@ -553,7 +552,6 @@ private: void _node_renamed(); void _editor_select_next(); void _editor_select_prev(); - void _editor_select(int p_which); void _set_scene_metadata(const String &p_file, int p_idx = -1); void _get_scene_metadata(const String &p_file); void _update_title(); @@ -658,8 +656,6 @@ private: void _update_layouts_menu(); void _layout_menu_option(int p_id); - void _clear_undo_history(); - void _update_addon_config(); void _toggle_distraction_free_mode(); @@ -703,7 +699,11 @@ protected: void set_current_tab(int p_tab); public: - void set_visible_editor(EditorTable p_table) { _editor_select(p_table); } + // Public for use with callable_mp. + void _on_plugin_ready(Object *p_script, const String &p_activate_name); + + void editor_select(int p_which); + void set_visible_editor(EditorTable p_table) { editor_select(p_table); } bool call_build(); diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index a8df486381..bd19df41fe 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -46,7 +46,7 @@ void EditorPluginSettings::_notification(int p_what) { } break; case Node::NOTIFICATION_READY: { - plugin_config_dialog->connect("plugin_ready", Callable(EditorNode::get_singleton(), "_on_plugin_ready")); + plugin_config_dialog->connect("plugin_ready", callable_mp(EditorNode::get_singleton(), &EditorNode::_on_plugin_ready)); plugin_list->connect("button_clicked", callable_mp(this, &EditorPluginSettings::_cell_button_pressed)); } break; } diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 8c67885971..43aac5e981 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -865,10 +865,10 @@ void ProjectExportDialog::_validate_export_path(const String &p_path) { if (invalid_path) { export_project->get_ok_button()->set_disabled(true); - export_project->get_line_edit()->disconnect("text_submitted", Callable(export_project, "_file_submitted")); + export_project->get_line_edit()->disconnect("text_submitted", callable_mp(export_project, &EditorFileDialog::_file_submitted)); } else { export_project->get_ok_button()->set_disabled(false); - export_project->get_line_edit()->connect("text_submitted", Callable(export_project, "_file_submitted")); + export_project->get_line_edit()->connect("text_submitted", callable_mp(export_project, &EditorFileDialog::_file_submitted)); } } @@ -901,9 +901,9 @@ void ProjectExportDialog::_export_project() { // with _validate_export_path. // FIXME: This is a hack, we should instead change EditorFileDialog to allow // disabling validation by the "text_submitted" signal. - if (!export_project->get_line_edit()->is_connected("text_submitted", Callable(export_project, "_file_submitted"))) { + if (!export_project->get_line_edit()->is_connected("text_submitted", callable_mp(export_project, &EditorFileDialog::_file_submitted))) { export_project->get_ok_button()->set_disabled(false); - export_project->get_line_edit()->connect("text_submitted", Callable(export_project, "_file_submitted")); + export_project->get_line_edit()->connect("text_submitted", callable_mp(export_project, &EditorFileDialog::_file_submitted)); } export_project->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 070834b33b..8dc08e3a93 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -4715,12 +4715,10 @@ void CanvasItemEditor::_reset_drag() { } void CanvasItemEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_update_override_camera_button", "game_running"), &CanvasItemEditor::_update_override_camera_button); ClassDB::bind_method("_get_editor_data", &CanvasItemEditor::_get_editor_data); ClassDB::bind_method(D_METHOD("set_state"), &CanvasItemEditor::set_state); ClassDB::bind_method(D_METHOD("update_viewport"), &CanvasItemEditor::update_viewport); - ClassDB::bind_method(D_METHOD("_zoom_on_position"), &CanvasItemEditor::_zoom_on_position); ClassDB::bind_method("_set_owner_for_node_and_children", &CanvasItemEditor::_set_owner_for_node_and_children); @@ -4984,8 +4982,8 @@ CanvasItemEditor::CanvasItemEditor() { SceneTreeDock::get_singleton()->connect("node_created", callable_mp(this, &CanvasItemEditor::_node_created)); SceneTreeDock::get_singleton()->connect("add_node_used", callable_mp(this, &CanvasItemEditor::_reset_create_position)); - EditorNode::get_singleton()->call_deferred(SNAME("connect"), "play_pressed", Callable(this, "_update_override_camera_button").bind(true)); - EditorNode::get_singleton()->call_deferred(SNAME("connect"), "stop_pressed", Callable(this, "_update_override_camera_button").bind(false)); + EditorNode::get_singleton()->call_deferred(SNAME("connect"), callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(true)); + EditorNode::get_singleton()->call_deferred(SNAME("connect"), "stop_pressed", callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(false)); // A fluid container for all toolbars. HFlowContainer *main_flow = memnew(HFlowContainer); @@ -5883,9 +5881,6 @@ void CanvasItemEditorViewport::_notification(int p_what) { } } -void CanvasItemEditorViewport::_bind_methods() { -} - CanvasItemEditorViewport::CanvasItemEditorViewport(CanvasItemEditor *p_canvas_item_editor) { default_texture_node_type = "Sprite2D"; // Node2D diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 0a840d6fd6..b731d3cc7d 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -618,8 +618,6 @@ class CanvasItemEditorViewport : public Control { void _show_resource_type_selector(); void _update_theme(); - static void _bind_methods(); - protected: void _notification(int p_what); diff --git a/editor/plugins/texture_3d_editor_plugin.cpp b/editor/plugins/texture_3d_editor_plugin.cpp index 3ea62184c6..4b2f28658a 100644 --- a/editor/plugins/texture_3d_editor_plugin.cpp +++ b/editor/plugins/texture_3d_editor_plugin.cpp @@ -138,10 +138,6 @@ void Texture3DEditor::edit(Ref<Texture3D> p_texture) { } } -void Texture3DEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_layer_changed"), &Texture3DEditor::_layer_changed); -} - Texture3DEditor::Texture3DEditor() { set_texture_repeat(TextureRepeat::TEXTURE_REPEAT_ENABLED); set_custom_minimum_size(Size2(1, 150)); @@ -173,7 +169,7 @@ Texture3DEditor::Texture3DEditor() { info->add_theme_constant_override("shadow_offset_y", 2); setting = false; - layer->connect("value_changed", Callable(this, "_layer_changed")); + layer->connect("value_changed", callable_mp(this, &Texture3DEditor::_layer_changed)); } Texture3DEditor::~Texture3DEditor() { diff --git a/editor/plugins/texture_3d_editor_plugin.h b/editor/plugins/texture_3d_editor_plugin.h index 357bdb0845..7795c83c8a 100644 --- a/editor/plugins/texture_3d_editor_plugin.h +++ b/editor/plugins/texture_3d_editor_plugin.h @@ -66,8 +66,6 @@ class Texture3DEditor : public Control { protected: void _notification(int p_what); - static void _bind_methods(); - public: void edit(Ref<Texture3D> p_texture); Texture3DEditor(); diff --git a/editor/plugins/texture_layered_editor_plugin.cpp b/editor/plugins/texture_layered_editor_plugin.cpp index dd8633360e..b0a174c1bc 100644 --- a/editor/plugins/texture_layered_editor_plugin.cpp +++ b/editor/plugins/texture_layered_editor_plugin.cpp @@ -214,10 +214,6 @@ void TextureLayeredEditor::edit(Ref<TextureLayered> p_texture) { } } -void TextureLayeredEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_layer_changed"), &TextureLayeredEditor::_layer_changed); -} - TextureLayeredEditor::TextureLayeredEditor() { set_texture_repeat(TextureRepeat::TEXTURE_REPEAT_ENABLED); set_custom_minimum_size(Size2(1, 150)); @@ -249,7 +245,7 @@ TextureLayeredEditor::TextureLayeredEditor() { info->add_theme_constant_override("shadow_offset_y", 2); setting = false; - layer->connect("value_changed", Callable(this, "_layer_changed")); + layer->connect("value_changed", callable_mp(this, &TextureLayeredEditor::_layer_changed)); } TextureLayeredEditor::~TextureLayeredEditor() { diff --git a/editor/plugins/texture_layered_editor_plugin.h b/editor/plugins/texture_layered_editor_plugin.h index f49aa83eb2..f4dbc104c8 100644 --- a/editor/plugins/texture_layered_editor_plugin.h +++ b/editor/plugins/texture_layered_editor_plugin.h @@ -68,7 +68,6 @@ class TextureLayeredEditor : public Control { protected: void _notification(int p_what); virtual void gui_input(const Ref<InputEvent> &p_event) override; - static void _bind_methods(); public: void edit(Ref<TextureLayered> p_texture); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index a437245c57..a2766da33d 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1235,14 +1235,14 @@ void SceneTreeDock::_notification(int p_what) { CanvasItemEditorPlugin *canvas_item_plugin = Object::cast_to<CanvasItemEditorPlugin>(editor_data->get_editor("2D")); if (canvas_item_plugin) { - canvas_item_plugin->get_canvas_item_editor()->connect("item_lock_status_changed", Callable(scene_tree, "_update_tree")); - canvas_item_plugin->get_canvas_item_editor()->connect("item_group_status_changed", Callable(scene_tree, "_update_tree")); + canvas_item_plugin->get_canvas_item_editor()->connect("item_lock_status_changed", callable_mp(scene_tree, &SceneTreeEditor::_update_tree)); + canvas_item_plugin->get_canvas_item_editor()->connect("item_group_status_changed", callable_mp(scene_tree, &SceneTreeEditor::_update_tree)); scene_tree->connect("node_changed", callable_mp((CanvasItem *)canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), &CanvasItem::queue_redraw)); } Node3DEditorPlugin *spatial_editor_plugin = Object::cast_to<Node3DEditorPlugin>(editor_data->get_editor("3D")); - spatial_editor_plugin->get_spatial_editor()->connect("item_lock_status_changed", Callable(scene_tree, "_update_tree")); - spatial_editor_plugin->get_spatial_editor()->connect("item_group_status_changed", Callable(scene_tree, "_update_tree")); + spatial_editor_plugin->get_spatial_editor()->connect("item_lock_status_changed", callable_mp(scene_tree, &SceneTreeEditor::_update_tree)); + spatial_editor_plugin->get_spatial_editor()->connect("item_group_status_changed", callable_mp(scene_tree, &SceneTreeEditor::_update_tree)); button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); button_instance->set_icon(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons"))); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 137574640e..7806ee1892 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -1332,7 +1332,7 @@ void SceneTreeEditor::set_connecting_signal(bool p_enable) { } void SceneTreeEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_update_tree"), &SceneTreeEditor::_update_tree, DEFVAL(false)); // Still used by some connect_compat. + ClassDB::bind_method(D_METHOD("_update_tree"), &SceneTreeEditor::_update_tree, DEFVAL(false)); // Still used by UndoRedo. ClassDB::bind_method("_rename_node", &SceneTreeEditor::_rename_node); ClassDB::bind_method("_test_update_tree", &SceneTreeEditor::_test_update_tree); diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h index 28ffa4b11b..8fbc3ab6d6 100644 --- a/editor/scene_tree_editor.h +++ b/editor/scene_tree_editor.h @@ -76,7 +76,6 @@ class SceneTreeEditor : public Control { void _add_nodes(Node *p_node, TreeItem *p_parent); void _test_update_tree(); - void _update_tree(bool p_scroll_to_selected = false); bool _update_filter(TreeItem *p_parent = nullptr, bool p_scroll_to_selected = false); bool _item_matches_all_terms(TreeItem *p_item, PackedStringArray p_terms); void _tree_changed(); @@ -138,6 +137,9 @@ class SceneTreeEditor : public Control { Vector<StringName> valid_types; public: + // Public for use with callable_mp. + void _update_tree(bool p_scroll_to_selected = false); + void set_filter(const String &p_filter); String get_filter() const; diff --git a/editor/shader_globals_editor.cpp b/editor/shader_globals_editor.cpp index eef0f3eae1..473bbd69d9 100644 --- a/editor/shader_globals_editor.cpp +++ b/editor/shader_globals_editor.cpp @@ -483,7 +483,7 @@ ShaderGlobalsEditor::ShaderGlobalsEditor() { inspector->connect("property_deleted", callable_mp(this, &ShaderGlobalsEditor::_variable_deleted), CONNECT_DEFERRED); interface = memnew(ShaderGlobalsEditorInterface); - interface->connect("var_changed", Callable(this, "_changed")); + interface->connect("var_changed", callable_mp(this, &ShaderGlobalsEditor::_changed)); } ShaderGlobalsEditor::~ShaderGlobalsEditor() { diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp index 6f42ad6916..91392c8f79 100644 --- a/modules/mono/editor/editor_internal_calls.cpp +++ b/modules/mono/editor/editor_internal_calls.cpp @@ -152,7 +152,7 @@ bool godot_icall_Internal_ScriptEditorEdit(Resource *p_resource, int32_t p_line, } void godot_icall_Internal_EditorNodeShowScriptScreen() { - EditorNode::get_singleton()->call("_editor_select", EditorNode::EDITOR_SCRIPT); + EditorNode::get_singleton()->editor_select(EditorNode::EDITOR_SCRIPT); } void godot_icall_Internal_EditorRunPlay() { diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index e04e1866db..85b2c5154b 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -45,7 +45,6 @@ void SkinReference::_skin_changed() { } void SkinReference::_bind_methods() { - ClassDB::bind_method(D_METHOD("_skin_changed"), &SkinReference::_skin_changed); ClassDB::bind_method(D_METHOD("get_skeleton"), &SkinReference::get_skeleton); ClassDB::bind_method(D_METHOD("get_skin"), &SkinReference::get_skin); } @@ -1007,7 +1006,7 @@ Ref<SkinReference> Skeleton3D::register_skin(const Ref<Skin> &p_skin) { skin_bindings.insert(skin_ref.operator->()); - skin_ref->skin->connect("changed", Callable(skin_ref.operator->(), "_skin_changed")); + skin_ref->skin->connect("changed", callable_mp(skin_ref.operator->(), &SkinReference::_skin_changed)); _make_dirty(); // Skin needs to be updated, so update skeleton. diff --git a/scene/3d/skeleton_3d.h b/scene/3d/skeleton_3d.h index 5e49dfa1f4..c2e9cfcced 100644 --- a/scene/3d/skeleton_3d.h +++ b/scene/3d/skeleton_3d.h @@ -51,12 +51,14 @@ class SkinReference : public RefCounted { uint64_t skeleton_version = 0; Vector<uint32_t> skin_bone_indices; uint32_t *skin_bone_indices_ptrs = nullptr; - void _skin_changed(); protected: static void _bind_methods(); public: + // Public for use with callable_mp. + void _skin_changed(); + RID get_skeleton() const; Ref<Skin> get_skin() const; ~SkinReference(); |