From d664469ec72337c2ec31c2e0d5a3d82c30305b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 28 Aug 2017 18:15:41 +0200 Subject: [PATCH] Fix inability to change project settings Regression from 565600e8445a3073e4188a1a2bde1f47dd299c5a, fixes #10712. --- editor/project_settings_editor.cpp | 9 ++++++++- editor/project_settings_editor.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 58ac5bc561c..94fce457336 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -866,6 +866,12 @@ void ProjectSettingsEditor::_save() { message->popup_centered(Size2(300, 100) * EDSCALE); } +void ProjectSettingsEditor::_settings_prop_edited(const String &p_name) { + + // Method needed to discard the mandatory argument of the property_edited signal + _settings_changed(); +} + void ProjectSettingsEditor::_settings_changed() { timer->start(); @@ -1334,6 +1340,7 @@ void ProjectSettingsEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_add_item"), &ProjectSettingsEditor::_add_item, DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("_device_input_add"), &ProjectSettingsEditor::_device_input_add); ClassDB::bind_method(D_METHOD("_press_a_key_confirm"), &ProjectSettingsEditor::_press_a_key_confirm); + ClassDB::bind_method(D_METHOD("_settings_prop_edited"), &ProjectSettingsEditor::_settings_prop_edited); ClassDB::bind_method(D_METHOD("_copy_to_platform"), &ProjectSettingsEditor::_copy_to_platform); ClassDB::bind_method(D_METHOD("_update_translations"), &ProjectSettingsEditor::_update_translations); ClassDB::bind_method(D_METHOD("_translation_delete"), &ProjectSettingsEditor::_translation_delete); @@ -1448,7 +1455,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { globals_editor->register_search_box(search_box); globals_editor->get_property_editor()->get_scene_tree()->connect("cell_selected", this, "_item_selected"); globals_editor->get_property_editor()->connect("property_toggled", this, "_item_checked", varray(), CONNECT_DEFERRED); - globals_editor->get_property_editor()->connect("property_edited", this, "_settings_changed"); + globals_editor->get_property_editor()->connect("property_edited", this, "_settings_prop_edited"); Button *del = memnew(Button); hbc->add_child(del); diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h index c8c5e3265b2..e4e2345692d 100644 --- a/editor/project_settings_editor.h +++ b/editor/project_settings_editor.h @@ -121,6 +121,7 @@ class ProjectSettingsEditor : public AcceptDialog { void _press_a_key_confirm(); void _show_last_added(const Ref &p_event, const String &p_name); + void _settings_prop_edited(const String &p_name); void _settings_changed(); void _copy_to_platform(int p_which);