summaryrefslogtreecommitdiff
path: root/editor/settings_config_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/settings_config_dialog.cpp')
-rw-r--r--editor/settings_config_dialog.cpp49
1 files changed, 18 insertions, 31 deletions
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index 44962323e5..cf93fab9a8 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -32,13 +32,13 @@
#include "core/os/keyboard.h"
#include "core/project_settings.h"
+#include "editor/debugger/editor_debugger_node.h"
#include "editor_file_system.h"
#include "editor_log.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "editor_settings.h"
#include "scene/gui/margin_container.h"
-#include "script_editor_debugger.h"
void EditorSettingsDialog::ok_pressed() {
@@ -119,9 +119,8 @@ void EditorSettingsDialog::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
- ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
- undo_redo->set_method_notify_callback(sed->_method_changeds, sed);
- undo_redo->set_property_notify_callback(sed->_property_changeds, sed);
+ undo_redo->set_method_notify_callback(EditorDebuggerNode::_method_changeds, NULL);
+ undo_redo->set_property_notify_callback(EditorDebuggerNode::_property_changeds, NULL);
undo_redo->set_commit_notify_callback(_undo_redo_callback, this);
} break;
case NOTIFICATION_ENTER_TREE: {
@@ -164,7 +163,7 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
handled = true;
}
- if (k->get_scancode_with_modifiers() == (KEY_MASK_CMD | KEY_F)) {
+ if (k->get_keycode_with_modifiers() == (KEY_MASK_CMD | KEY_F)) {
_focus_current_search_box();
handled = true;
}
@@ -318,10 +317,10 @@ void EditorSettingsDialog::_wait_for_key(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> k = p_event;
- if (k.is_valid() && k->is_pressed() && k->get_scancode() != 0) {
+ if (k.is_valid() && k->is_pressed() && k->get_keycode() != 0) {
last_wait_for_key = k;
- const String str = keycode_get_string(k->get_scancode_with_modifiers());
+ const String str = keycode_get_string(k->get_keycode_with_modifiers());
press_a_key_label->set_text(str);
press_a_key->accept_event();
@@ -335,7 +334,7 @@ void EditorSettingsDialog::_press_a_key_confirm() {
Ref<InputEventKey> ie;
ie.instance();
- ie->set_scancode(last_wait_for_key->get_scancode());
+ ie->set_keycode(last_wait_for_key->get_keycode());
ie->set_shift(last_wait_for_key->get_shift());
ie->set_control(last_wait_for_key->get_control());
ie->set_alt(last_wait_for_key->get_alt());
@@ -389,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() {
@@ -412,7 +399,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
tabs = memnew(TabContainer);
tabs->set_tab_align(TabContainer::ALIGN_LEFT);
- tabs->connect("tab_changed", this, "_tabs_tab_changed");
+ tabs->connect("tab_changed", callable_mp(this, &EditorSettingsDialog::_tabs_tab_changed));
add_child(tabs);
// General Tab
@@ -435,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("property_edited", this, "_settings_property_edited");
- inspector->get_inspector()->connect("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);
@@ -450,11 +437,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("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("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();
@@ -471,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("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);
@@ -481,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("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);
@@ -495,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("gui_input", this, "_wait_for_key");
- press_a_key->connect("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("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("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;