1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-05 17:15:09 +00:00

Reworked signal connection system, added support for Callable and Signal objects and made them default.

This commit is contained in:
Juan Linietsky
2020-02-19 16:27:19 -03:00
committed by Juan Linietsky
parent 1a4be2cd8f
commit 69c95f4b4c
275 changed files with 3831 additions and 2948 deletions

View File

@@ -412,7 +412,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
tabs = memnew(TabContainer);
tabs->set_tab_align(TabContainer::ALIGN_LEFT);
tabs->connect("tab_changed", this, "_tabs_tab_changed");
tabs->connect_compat("tab_changed", this, "_tabs_tab_changed");
add_child(tabs);
// General Tab
@@ -435,8 +435,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("property_edited", this, "_settings_property_edited");
inspector->get_inspector()->connect("restart_requested", this, "_editor_restart_request");
inspector->get_inspector()->connect_compat("property_edited", this, "_settings_property_edited");
inspector->get_inspector()->connect_compat("restart_requested", this, "_editor_restart_request");
restart_container = memnew(PanelContainer);
tab_general->add_child(restart_container);
@@ -450,11 +450,11 @@ EditorSettingsDialog::EditorSettingsDialog() {
restart_hb->add_child(restart_label);
restart_hb->add_spacer();
Button *restart_button = memnew(Button);
restart_button->connect("pressed", this, "_editor_restart");
restart_button->connect_compat("pressed", this, "_editor_restart");
restart_hb->add_child(restart_button);
restart_button->set_text(TTR("Save & Restart"));
restart_close_button = memnew(ToolButton);
restart_close_button->connect("pressed", this, "_editor_restart_close");
restart_close_button->connect_compat("pressed", this, "_editor_restart_close");
restart_hb->add_child(restart_close_button);
restart_container->hide();
@@ -471,7 +471,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("text_changed", this, "_filter_shortcuts");
shortcut_search_box->connect_compat("text_changed", this, "_filter_shortcuts");
shortcuts = memnew(Tree);
tab_shortcuts->add_child(shortcuts, true);
@@ -481,7 +481,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("button_pressed", this, "_shortcut_button_pressed");
shortcuts->connect_compat("button_pressed", this, "_shortcut_button_pressed");
press_a_key = memnew(ConfirmationDialog);
press_a_key->set_focus_mode(FOCUS_ALL);
@@ -495,17 +495,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("gui_input", this, "_wait_for_key");
press_a_key->connect("confirmed", this, "_press_a_key_confirm");
press_a_key->connect_compat("gui_input", this, "_wait_for_key");
press_a_key->connect_compat("confirmed", this, "_press_a_key_confirm");
set_hide_on_ok(true);
timer = memnew(Timer);
timer->set_wait_time(1.5);
timer->connect("timeout", this, "_settings_save");
timer->connect_compat("timeout", this, "_settings_save");
timer->set_one_shot(true);
add_child(timer);
EditorSettings::get_singleton()->connect("settings_changed", this, "_settings_changed");
EditorSettings::get_singleton()->connect_compat("settings_changed", this, "_settings_changed");
get_ok()->set_text(TTR("Close"));
updating = false;