You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
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.)
This commit is contained in:
@@ -388,19 +388,7 @@ void EditorSettingsDialog::_editor_restart_close() {
|
||||
void EditorSettingsDialog::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_unhandled_input"), &EditorSettingsDialog::_unhandled_input);
|
||||
ClassDB::bind_method(D_METHOD("_settings_save"), &EditorSettingsDialog::_settings_save);
|
||||
ClassDB::bind_method(D_METHOD("_settings_changed"), &EditorSettingsDialog::_settings_changed);
|
||||
ClassDB::bind_method(D_METHOD("_settings_property_edited"), &EditorSettingsDialog::_settings_property_edited);
|
||||
ClassDB::bind_method(D_METHOD("_shortcut_button_pressed"), &EditorSettingsDialog::_shortcut_button_pressed);
|
||||
ClassDB::bind_method(D_METHOD("_filter_shortcuts"), &EditorSettingsDialog::_filter_shortcuts);
|
||||
ClassDB::bind_method(D_METHOD("_update_shortcuts"), &EditorSettingsDialog::_update_shortcuts);
|
||||
ClassDB::bind_method(D_METHOD("_press_a_key_confirm"), &EditorSettingsDialog::_press_a_key_confirm);
|
||||
ClassDB::bind_method(D_METHOD("_wait_for_key"), &EditorSettingsDialog::_wait_for_key);
|
||||
ClassDB::bind_method(D_METHOD("_tabs_tab_changed"), &EditorSettingsDialog::_tabs_tab_changed);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_editor_restart_request"), &EditorSettingsDialog::_editor_restart_request);
|
||||
ClassDB::bind_method(D_METHOD("_editor_restart"), &EditorSettingsDialog::_editor_restart);
|
||||
ClassDB::bind_method(D_METHOD("_editor_restart_close"), &EditorSettingsDialog::_editor_restart_close);
|
||||
}
|
||||
|
||||
EditorSettingsDialog::EditorSettingsDialog() {
|
||||
@@ -411,7 +399,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
|
||||
|
||||
tabs = memnew(TabContainer);
|
||||
tabs->set_tab_align(TabContainer::ALIGN_LEFT);
|
||||
tabs->connect_compat("tab_changed", this, "_tabs_tab_changed");
|
||||
tabs->connect("tab_changed", callable_mp(this, &EditorSettingsDialog::_tabs_tab_changed));
|
||||
add_child(tabs);
|
||||
|
||||
// General Tab
|
||||
@@ -434,8 +422,8 @@ EditorSettingsDialog::EditorSettingsDialog() {
|
||||
inspector->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
inspector->get_inspector()->set_undo_redo(undo_redo);
|
||||
tab_general->add_child(inspector);
|
||||
inspector->get_inspector()->connect_compat("property_edited", this, "_settings_property_edited");
|
||||
inspector->get_inspector()->connect_compat("restart_requested", this, "_editor_restart_request");
|
||||
inspector->get_inspector()->connect("property_edited", callable_mp(this, &EditorSettingsDialog::_settings_property_edited));
|
||||
inspector->get_inspector()->connect("restart_requested", callable_mp(this, &EditorSettingsDialog::_editor_restart_request));
|
||||
|
||||
restart_container = memnew(PanelContainer);
|
||||
tab_general->add_child(restart_container);
|
||||
@@ -449,11 +437,11 @@ EditorSettingsDialog::EditorSettingsDialog() {
|
||||
restart_hb->add_child(restart_label);
|
||||
restart_hb->add_spacer();
|
||||
Button *restart_button = memnew(Button);
|
||||
restart_button->connect_compat("pressed", this, "_editor_restart");
|
||||
restart_button->connect("pressed", callable_mp(this, &EditorSettingsDialog::_editor_restart));
|
||||
restart_hb->add_child(restart_button);
|
||||
restart_button->set_text(TTR("Save & Restart"));
|
||||
restart_close_button = memnew(ToolButton);
|
||||
restart_close_button->connect_compat("pressed", this, "_editor_restart_close");
|
||||
restart_close_button->connect("pressed", callable_mp(this, &EditorSettingsDialog::_editor_restart_close));
|
||||
restart_hb->add_child(restart_close_button);
|
||||
restart_container->hide();
|
||||
|
||||
@@ -470,7 +458,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
|
||||
shortcut_search_box = memnew(LineEdit);
|
||||
shortcut_search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
hbc->add_child(shortcut_search_box);
|
||||
shortcut_search_box->connect_compat("text_changed", this, "_filter_shortcuts");
|
||||
shortcut_search_box->connect("text_changed", callable_mp(this, &EditorSettingsDialog::_filter_shortcuts));
|
||||
|
||||
shortcuts = memnew(Tree);
|
||||
tab_shortcuts->add_child(shortcuts, true);
|
||||
@@ -480,7 +468,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
|
||||
shortcuts->set_column_titles_visible(true);
|
||||
shortcuts->set_column_title(0, TTR("Name"));
|
||||
shortcuts->set_column_title(1, TTR("Binding"));
|
||||
shortcuts->connect_compat("button_pressed", this, "_shortcut_button_pressed");
|
||||
shortcuts->connect("button_pressed", callable_mp(this, &EditorSettingsDialog::_shortcut_button_pressed));
|
||||
|
||||
press_a_key = memnew(ConfirmationDialog);
|
||||
press_a_key->set_focus_mode(FOCUS_ALL);
|
||||
@@ -494,17 +482,17 @@ EditorSettingsDialog::EditorSettingsDialog() {
|
||||
l->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 30);
|
||||
press_a_key_label = l;
|
||||
press_a_key->add_child(l);
|
||||
press_a_key->connect_compat("gui_input", this, "_wait_for_key");
|
||||
press_a_key->connect_compat("confirmed", this, "_press_a_key_confirm");
|
||||
press_a_key->connect("gui_input", callable_mp(this, &EditorSettingsDialog::_wait_for_key));
|
||||
press_a_key->connect("confirmed", callable_mp(this, &EditorSettingsDialog::_press_a_key_confirm));
|
||||
|
||||
set_hide_on_ok(true);
|
||||
|
||||
timer = memnew(Timer);
|
||||
timer->set_wait_time(1.5);
|
||||
timer->connect_compat("timeout", this, "_settings_save");
|
||||
timer->connect("timeout", callable_mp(this, &EditorSettingsDialog::_settings_save));
|
||||
timer->set_one_shot(true);
|
||||
add_child(timer);
|
||||
EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_settings_changed");
|
||||
EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &EditorSettingsDialog::_settings_changed));
|
||||
get_ok()->set_text(TTR("Close"));
|
||||
|
||||
updating = false;
|
||||
|
||||
Reference in New Issue
Block a user