diff options
Diffstat (limited to 'editor/editor_settings.cpp')
-rw-r--r-- | editor/editor_settings.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 6bd11fcdd6..52ff7e3c19 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -63,6 +63,7 @@ bool EditorSettings::_set(const StringName &p_name, const Variant &p_value) { bool changed = _set_only(p_name, p_value); if (changed) { + changed_settings.insert(p_name); emit_signal(SNAME("settings_changed")); } return true; @@ -553,6 +554,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("text_editor/behavior/files/autosave_interval_secs", 0); _initial_set("text_editor/behavior/files/restore_scripts_on_load", true); _initial_set("text_editor/behavior/files/convert_indent_on_save", true); + _initial_set("text_editor/behavior/files/auto_reload_scripts_on_external_change", false); // Script list _initial_set("text_editor/script_list/show_members_overview", true); @@ -585,6 +587,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Use a similar color to the 2D editor selection. EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d/selection_box_color", Color(1.0, 0.5, 0), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) + _initial_set("editors/3d_gizmos/gizmo_colors/instantiated", Color(0.7, 0.7, 0.7, 0.6)); + _initial_set("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1)); + _initial_set("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1)); // If a line is a multiple of this, it uses the primary grid color. // Use a power of 2 value by default as it's more common to use powers of 2 in level design. @@ -708,6 +713,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // SSL EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "network/ssl/editor_ssl_certificates", _SYSTEM_CERTS_PATH, "*.crt,*.pem") + // Profiler + _initial_set("debugger/profiler_frame_history_size", 600); + /* Extra config */ EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/sorting_order", 0, "Name,Path,Last Edited") @@ -941,10 +949,34 @@ void EditorSettings::save() { if (err != OK) { ERR_PRINT("Error saving editor settings to " + singleton->config_file_path); } else { + singleton->changed_settings.clear(); print_verbose("EditorSettings: Save OK!"); } } +Array EditorSettings::get_changed_settings() const { + Array arr; + for (const String &setting : changed_settings) { + arr.push_back(setting); + } + + return arr; +} + +bool EditorSettings::check_changed_settings_in_group(const String &p_setting_prefix) const { + for (const String &setting : changed_settings) { + if (setting.begins_with(p_setting_prefix)) { + return true; + } + } + + return false; +} + +void EditorSettings::mark_setting_changed(const String &p_setting) { + changed_settings.insert(p_setting); +} + void EditorSettings::destroy() { if (!singleton.ptr()) { return; @@ -1621,6 +1653,10 @@ void EditorSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("set_builtin_action_override", "name", "actions_list"), &EditorSettings::set_builtin_action_override); + ClassDB::bind_method(D_METHOD("check_changed_settings_in_group", "setting_prefix"), &EditorSettings::check_changed_settings_in_group); + ClassDB::bind_method(D_METHOD("get_changed_settings"), &EditorSettings::get_changed_settings); + ClassDB::bind_method(D_METHOD("mark_setting_changed", "setting"), &EditorSettings::mark_setting_changed); + ADD_SIGNAL(MethodInfo("settings_changed")); BIND_CONSTANT(NOTIFICATION_EDITOR_SETTINGS_CHANGED); |