From 01afc442c73661df677c2b93f4037a21992ee45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 21 Feb 2020 18:28:45 +0100 Subject: Signals: Port connect calls to use callable_mp Remove now unnecessary bindings of signal callbacks in the public API. There might be some false positives that need rebinding if they were meant to be public. No regular expressions were harmed in the making of this commit. (Nah, just kidding.) --- editor/plugins/sprite_editor_plugin.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'editor/plugins/sprite_editor_plugin.cpp') diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp index c35afa0644..135807e88c 100644 --- a/editor/plugins/sprite_editor_plugin.cpp +++ b/editor/plugins/sprite_editor_plugin.cpp @@ -504,10 +504,6 @@ void SpriteEditor::_debug_uv_draw() { void SpriteEditor::_bind_methods() { - ClassDB::bind_method("_menu_option", &SpriteEditor::_menu_option); - ClassDB::bind_method("_debug_uv_draw", &SpriteEditor::_debug_uv_draw); - ClassDB::bind_method("_update_mesh_data", &SpriteEditor::_update_mesh_data); - ClassDB::bind_method("_create_node", &SpriteEditor::_create_node); ClassDB::bind_method("_add_as_sibling_or_child", &SpriteEditor::_add_as_sibling_or_child); } @@ -526,7 +522,7 @@ SpriteEditor::SpriteEditor() { options->get_popup()->add_item(TTR("Create LightOccluder2D Sibling"), MENU_OPTION_CREATE_LIGHT_OCCLUDER_2D); options->set_switch_on_hover(true); - options->get_popup()->connect_compat("id_pressed", this, "_menu_option"); + options->get_popup()->connect("id_pressed", callable_mp(this, &SpriteEditor::_menu_option)); err_dialog = memnew(AcceptDialog); add_child(err_dialog); @@ -542,9 +538,9 @@ SpriteEditor::SpriteEditor() { scroll->set_enable_v_scroll(true); vb->add_margin_child(TTR("Preview:"), scroll, true); debug_uv = memnew(Control); - debug_uv->connect_compat("draw", this, "_debug_uv_draw"); + debug_uv->connect("draw", callable_mp(this, &SpriteEditor::_debug_uv_draw)); scroll->add_child(debug_uv); - debug_uv_dialog->connect_compat("confirmed", this, "_create_node"); + debug_uv_dialog->connect("confirmed", callable_mp(this, &SpriteEditor::_create_node)); HBoxContainer *hb = memnew(HBoxContainer); hb->add_child(memnew(Label(TTR("Simplification: ")))); @@ -573,7 +569,7 @@ SpriteEditor::SpriteEditor() { hb->add_spacer(); update_preview = memnew(Button); update_preview->set_text(TTR("Update Preview")); - update_preview->connect_compat("pressed", this, "_update_mesh_data"); + update_preview->connect("pressed", callable_mp(this, &SpriteEditor::_update_mesh_data)); hb->add_child(update_preview); vb->add_margin_child(TTR("Settings:"), hb); -- cgit v1.2.3