From 4023ace08d4c5d91fa9d1096a0a0b98885a475e1 Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 2 Sep 2024 14:04:02 +0200 Subject: [PATCH] Add Advanced Settings switch to Editor Settings --- editor/editor_settings.cpp | 358 ++++++++++++++++------------- editor/editor_settings.h | 7 +- editor/editor_settings_dialog.cpp | 14 ++ editor/editor_settings_dialog.h | 4 + platform/android/export/export.cpp | 10 +- platform/macos/export/export.cpp | 2 +- platform/windows/export/export.cpp | 8 +- 7 files changed, 225 insertions(+), 178 deletions(-) diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 96a7700c34a..312140da670 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -228,16 +228,18 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const { return true; } -void EditorSettings::_initial_set(const StringName &p_name, const Variant &p_value) { +void EditorSettings::_initial_set(const StringName &p_name, const Variant &p_value, bool p_basic) { set(p_name, p_value); props[p_name].initial = p_value; props[p_name].has_default_value = true; + props[p_name].basic = p_basic; } struct _EVCSort { String name; Variant::Type type = Variant::Type::NIL; int order = 0; + bool basic = false; bool save = false; bool restart_if_changed = false; @@ -260,12 +262,13 @@ void EditorSettings::_get_property_list(List *p_list) const { vc.name = E.key; vc.order = v->order; vc.type = v->variant.get_type(); + vc.basic = v->basic; vc.save = v->save; - /*if (vc.save) { this should be implemented, but lets do after 3.1 is out. + if (vc.save) { if (v->initial.get_type() != Variant::NIL && v->initial == v->variant) { vc.save = false; } - }*/ + } vc.restart_if_changed = v->restart_if_changed; vclist.insert(vc); @@ -289,6 +292,10 @@ void EditorSettings::_get_property_list(List *p_list) const { pi = hints[E.name]; } + if (E.basic) { + pi.usage |= PROPERTY_USAGE_EDITOR_BASIC_SETTING; + } + if (E.restart_if_changed) { pi.usage |= PROPERTY_USAGE_RESTART_IF_CHANGED; } @@ -341,6 +348,10 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { _initial_set(m_name, m_default_value); \ hints[m_name] = PropertyInfo(m_type, m_name, m_property_hint, m_hint_string); +#define EDITOR_SETTING_BASIC(m_type, m_property_hint, m_name, m_default_value, m_hint_string) \ + _initial_set(m_name, m_default_value, true); \ + hints[m_name] = PropertyInfo(m_type, m_name, m_property_hint, m_hint_string); + #define EDITOR_SETTING_USAGE(m_type, m_property_hint, m_name, m_default_value, m_hint_string, m_usage) \ _initial_set(m_name, m_default_value); \ hints[m_name] = PropertyInfo(m_type, m_name, m_property_hint, m_hint_string, m_usage); @@ -397,7 +408,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { best = "en"; } - EDITOR_SETTING_USAGE(Variant::STRING, PROPERTY_HINT_ENUM, "interface/editor/editor_language", best, lang_hint, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + EDITOR_SETTING_USAGE(Variant::STRING, PROPERTY_HINT_ENUM, "interface/editor/editor_language", best, lang_hint, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING); } // Asset library @@ -407,13 +418,13 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // Editor EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/localize_settings", true, "") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/dock_tab_style", 0, "Text Only,Icon Only,Text and Icon") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/dock_tab_style", 0, "Text Only,Icon Only,Text and Icon") EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/ui_layout_direction", 0, "Based on Application Locale,Left-to-Right,Right-to-Left,Based on System Locale", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) // Display what the Auto display scale setting effectively corresponds to. const String display_scale_hint_string = vformat("Auto (%d%%),75%%,100%%,125%%,150%%,175%%,200%%,Custom", Math::round(get_auto_display_scale() * 100)); - EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/display_scale", 0, display_scale_hint_string, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) - EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/editor/custom_display_scale", 1.0, "0.5,3,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) + EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/display_scale", 0, display_scale_hint_string, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING) + EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/editor/custom_display_scale", 1.0, "0.5,3,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING) String ed_screen_hints = "Screen With Mouse Pointer:-4,Screen With Keyboard Focus:-3,Primary Screen:-2"; // Note: Main Window Screen:-1 is not used for the main window. for (int i = 0; i < DisplayServer::get_singleton()->get_screen_count(); i++) { @@ -427,23 +438,23 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { if (String(VERSION_STATUS) == String("stable")) { default_update_mode = EngineUpdateLabel::UpdateMode::NEWEST_STABLE; } - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "network/connection/engine_version_update_mode", int(default_update_mode), "Disable Update Checks,Check Newest Preview,Check Newest Stable,Check Newest Patch"); // Uses EngineUpdateLabel::UpdateMode. + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "network/connection/engine_version_update_mode", int(default_update_mode), "Disable Update Checks,Check Newest Preview,Check Newest Stable,Check Newest Patch"); // Uses EngineUpdateLabel::UpdateMode. } - EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/use_embedded_menu", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) + EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/use_embedded_menu", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING) EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/use_native_file_dialogs", false, "", PROPERTY_USAGE_DEFAULT) - EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/expand_to_title", true, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) + EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/expand_to_title", true, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING) - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/editor/main_font_size", 14, "8,48,1") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/editor/code_font_size", 14, "8,48,1") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "interface/editor/main_font_size", 14, "8,48,1") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "interface/editor/code_font_size", 14, "8,48,1") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/code_font_contextual_ligatures", 1, "Enabled,Disable Contextual Alternates (Coding Ligatures),Use Custom OpenType Feature Set") _initial_set("interface/editor/code_font_custom_opentype_features", ""); _initial_set("interface/editor/code_font_custom_variations", ""); - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/font_antialiasing", 1, "None,Grayscale,LCD Subpixel") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/font_antialiasing", 1, "None,Grayscale,LCD Subpixel") #ifdef MACOS_ENABLED - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/font_hinting", 0, "Auto (None),None,Light,Normal") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/font_hinting", 0, "Auto (None),None,Light,Normal") #else - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/font_hinting", 0, "Auto (Light),None,Light,Normal") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/font_hinting", 0, "Auto (Light),None,Light,Normal") #endif EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/font_subpixel_positioning", 1, "Disabled,Auto,One Half of a Pixel,One Quarter of a Pixel") EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/font_disable_embedded_bitmaps", true, ""); @@ -452,13 +463,13 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/editor/main_font", "", "*.ttf,*.otf,*.woff,*.woff2,*.pfb,*.pfm") EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/editor/main_font_bold", "", "*.ttf,*.otf,*.woff,*.woff2,*.pfb,*.pfm") EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/editor/code_font", "", "*.ttf,*.otf,*.woff,*.woff2,*.pfb,*.pfm") - _initial_set("interface/editor/separate_distraction_mode", false); - _initial_set("interface/editor/automatically_open_screenshots", true); - EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/single_window_mode", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) - _initial_set("interface/editor/remember_window_size_and_position", true); + _initial_set("interface/editor/separate_distraction_mode", false, true); + _initial_set("interface/editor/automatically_open_screenshots", true, true); + EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/single_window_mode", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING) + _initial_set("interface/editor/remember_window_size_and_position", true, true); _initial_set("interface/editor/mouse_extra_buttons_navigate_history", true); - _initial_set("interface/editor/save_each_scene_on_quit", true); // Regression - EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/save_on_focus_loss", false, "") + _initial_set("interface/editor/save_each_scene_on_quit", true, true); // Regression + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/save_on_focus_loss", false, "") EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/accept_dialog_cancel_ok_buttons", 0, vformat("Auto (%s),Cancel First,OK First", DisplayServer::get_singleton()->get_swap_cancel_ok() ? "OK First" : "Cancel First"), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); @@ -470,7 +481,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/show_update_spinner", 0, "Auto (Disabled),Enabled,Disabled") #endif - _initial_set("interface/editor/keep_screen_on", false); + _initial_set("interface/editor/keep_screen_on", false, true); EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_RANGE, "interface/editor/low_processor_mode_sleep_usec", 6900, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) // Default unfocused usec sleep is for 10 FPS. Allow an unfocused FPS limit // as low as 1 FPS for those who really need low power usage (but don't need @@ -479,9 +490,9 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // being focused again, so this should be used at the user's discretion. EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_RANGE, "interface/editor/unfocused_low_processor_mode_sleep_usec", 100000, "1,1000000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) - EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/import_resources_when_unfocused", false, "") + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/import_resources_when_unfocused", false, "") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/vsync_mode", 1, "Disabled,Enabled,Adaptive,Mailbox") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/vsync_mode", 1, "Disabled,Enabled,Adaptive,Mailbox") EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/update_continuously", false, "") _initial_set("interface/editors/show_scene_tree_root_selection", true); @@ -489,15 +500,15 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { _initial_set("docks/scene_tree/ask_before_revoking_unique_name", true); // Inspector - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/inspector/max_array_dictionary_items_per_page", 20, "10,100,1") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "interface/inspector/max_array_dictionary_items_per_page", 20, "10,100,1") EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/show_low_level_opentype_features", false, "") - EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/inspector/float_drag_speed", 5.0, "0.1,100,0.01") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/nested_color_mode", 0, "Containers & Resources,Resources,External Resources") + EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/inspector/float_drag_speed", 5.0, "0.1,100,0.01") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/nested_color_mode", 0, "Containers & Resources,Resources,External Resources") EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/delimitate_all_container_and_resources", true, "") EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_property_name_style", EditorPropertyNameProcessor::STYLE_CAPITALIZED, "Raw (e.g. \"z_index\"),Capitalized (e.g. \"Z Index\"),Localized (e.g. \"Z Index\")", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); // The lowest value is equal to the minimum float step for 32-bit floats. // The step must be set manually, as changing this setting should not change the step here. - EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/inspector/default_float_step", 0.001, "0.0000001,1,0.0000001", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/inspector/default_float_step", 0.001, "0.0000001,1,0.0000001", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING); EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/disable_folding", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/auto_unfold_foreign_scenes", true, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/horizontal_vector2_editing", false, "") @@ -511,18 +522,18 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { open_in_new_inspector_defaults.push_back("MeshLibrary"); _initial_set("interface/inspector/resources_to_open_in_new_inspector", open_in_new_inspector_defaults); - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_color_picker_mode", (int32_t)ColorPicker::MODE_RGB, "RGB,HSV,RAW,OKHSL") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_color_picker_shape", (int32_t)ColorPicker::SHAPE_OKHSL_CIRCLE, "HSV Rectangle,HSV Rectangle Wheel,VHS Circle,OKHSL Circle") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_color_picker_mode", (int32_t)ColorPicker::MODE_RGB, "RGB,HSV,RAW,OKHSL") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_color_picker_shape", (int32_t)ColorPicker::SHAPE_OKHSL_CIRCLE, "HSV Rectangle,HSV Rectangle Wheel,VHS Circle,OKHSL Circle") // Theme - EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_ENUM, "interface/theme/follow_system_theme", false, "") - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "interface/theme/preset", "Default", "Default,Breeze Dark,Godot 2,Gray,Light,Solarized (Dark),Solarized (Light),Black (OLED),Custom") - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "interface/theme/spacing_preset", "Default", "Compact,Default,Spacious,Custom") + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_ENUM, "interface/theme/follow_system_theme", false, "") + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_ENUM, "interface/theme/preset", "Default", "Default,Breeze Dark,Godot 2,Gray,Light,Solarized (Dark),Solarized (Light),Black (OLED),Custom") + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_ENUM, "interface/theme/spacing_preset", "Default", "Compact,Default,Spacious,Custom") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/theme/icon_and_font_color", 0, "Auto,Dark,Light") - EDITOR_SETTING(Variant::COLOR, PROPERTY_HINT_NONE, "interface/theme/base_color", Color(0.2, 0.23, 0.31), "") - EDITOR_SETTING(Variant::COLOR, PROPERTY_HINT_NONE, "interface/theme/accent_color", Color(0.41, 0.61, 0.91), "") - EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/theme/use_system_accent_color", false, "") - EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/theme/contrast", 0.3, "-1,1,0.01") + EDITOR_SETTING_BASIC(Variant::COLOR, PROPERTY_HINT_NONE, "interface/theme/base_color", Color(0.2, 0.23, 0.31), "") + EDITOR_SETTING_BASIC(Variant::COLOR, PROPERTY_HINT_NONE, "interface/theme/accent_color", Color(0.41, 0.61, 0.91), "") + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/theme/use_system_accent_color", false, "") + EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/theme/contrast", 0.3, "-1,1,0.01") EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/theme/draw_extra_borders", false, "") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/theme/icon_saturation", 1.0, "0,2,0.01") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/theme/relationship_line_opacity", 0.1, "0.00,1,0.01") @@ -550,29 +561,29 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/scene_tabs/display_close_button", 1, "Never,If Tab Active,Always"); // TabBar::CloseButtonDisplayPolicy _initial_set("interface/scene_tabs/show_thumbnail_on_hover", true); EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_RANGE, "interface/scene_tabs/maximum_width", 350, "0,9999,1", PROPERTY_USAGE_DEFAULT) - _initial_set("interface/scene_tabs/show_script_button", false); - EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/scene_tabs/restore_scenes_on_load", true, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) + _initial_set("interface/scene_tabs/show_script_button", false, true); + _initial_set("interface/scene_tabs/restore_scenes_on_load", true, true); // Multi Window - EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/multi_window/enable", true, ""); - EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/multi_window/restore_windows_on_load", true, ""); - EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/multi_window/maximize_window", false, ""); + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/multi_window/enable", true, ""); + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/multi_window/restore_windows_on_load", true, ""); + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/multi_window/maximize_window", false, ""); set_restart_if_changed("interface/multi_window/enable", true); /* Filesystem */ // External Programs - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/raster_image_editor", "", "") - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/vector_image_editor", "", "") - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/audio_editor", "", "") - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/3d_model_editor", "", "") - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/terminal_emulator", "", "") + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/raster_image_editor", "", "") + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/vector_image_editor", "", "") + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/audio_editor", "", "") + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/3d_model_editor", "", "") + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/external_programs/terminal_emulator", "", "") EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_PLACEHOLDER_TEXT, "filesystem/external_programs/terminal_emulator_flags", "", "Call flags with placeholder: {directory}."); // Directories EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_DIR, "filesystem/directories/autoscan_project_path", "", "") const String fs_dir_default_project_path = OS::get_singleton()->has_environment("HOME") ? OS::get_singleton()->get_environment("HOME") : OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS); - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_DIR, "filesystem/directories/default_project_path", fs_dir_default_project_path, "") + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_GLOBAL_DIR, "filesystem/directories/default_project_path", fs_dir_default_project_path, "") // On save _initial_set("filesystem/on_save/compress_binary_resources", true); @@ -588,7 +599,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "filesystem/file_dialog/thumbnail_size", 64, "32,128,16") // Import (for glft module) - EDITOR_SETTING_USAGE(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/import/blender/blender_path", "", "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) + EDITOR_SETTING_USAGE(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/import/blender/blender_path", "", "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING) EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_RANGE, "filesystem/import/blender/rpc_port", 6011, "0,65535,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_RANGE, "filesystem/import/blender/rpc_server_uptime", 5, "0,300,1,or_greater,suffix:s", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) EDITOR_SETTING_USAGE(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "filesystem/import/fbx/fbx2gltf_path", "", "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) @@ -618,7 +629,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // Theme _initial_set("text_editor/theme/line_spacing", 6); - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "text_editor/theme/color_theme", "Default", "Default,Godot 2,Custom") + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_ENUM, "text_editor/theme/color_theme", "Default", "Default,Godot 2,Custom") // Theme: Highlighting _load_godot2_text_editor_theme(); @@ -626,52 +637,52 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // Appearance // Appearance: Caret EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/appearance/caret/type", 0, "Line,Block") - _initial_set("text_editor/appearance/caret/caret_blink", true); + _initial_set("text_editor/appearance/caret/caret_blink", true, true); EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "text_editor/appearance/caret/caret_blink_interval", 0.5, "0.1,10,0.01") - _initial_set("text_editor/appearance/caret/highlight_current_line", true); - _initial_set("text_editor/appearance/caret/highlight_all_occurrences", true); + _initial_set("text_editor/appearance/caret/highlight_current_line", true, true); + _initial_set("text_editor/appearance/caret/highlight_all_occurrences", true, true); // Appearance: Guidelines - _initial_set("text_editor/appearance/guidelines/show_line_length_guidelines", true); + _initial_set("text_editor/appearance/guidelines/show_line_length_guidelines", true, true); EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/appearance/guidelines/line_length_guideline_soft_column", 80, "20,160,1") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/appearance/guidelines/line_length_guideline_hard_column", 100, "20,160,1") // Appearance: Gutters - _initial_set("text_editor/appearance/gutters/show_line_numbers", true); - _initial_set("text_editor/appearance/gutters/line_numbers_zero_padded", false); - _initial_set("text_editor/appearance/gutters/highlight_type_safe_lines", true); - _initial_set("text_editor/appearance/gutters/show_info_gutter", true); + _initial_set("text_editor/appearance/gutters/show_line_numbers", true, true); + _initial_set("text_editor/appearance/gutters/line_numbers_zero_padded", false, true); + _initial_set("text_editor/appearance/gutters/highlight_type_safe_lines", true, true); + _initial_set("text_editor/appearance/gutters/show_info_gutter", true, true); // Appearance: Minimap - _initial_set("text_editor/appearance/minimap/show_minimap", true); + _initial_set("text_editor/appearance/minimap/show_minimap", true, true); EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/appearance/minimap/minimap_width", 80, "50,250,1") // Appearance: Lines - _initial_set("text_editor/appearance/lines/code_folding", true); - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/appearance/lines/word_wrap", 0, "None,Boundary") + _initial_set("text_editor/appearance/lines/code_folding", true, true); + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/appearance/lines/word_wrap", 0, "None,Boundary") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/appearance/lines/autowrap_mode", 3, "Arbitrary:1,Word:2,Word (Smart):3") // Appearance: Whitespace - _initial_set("text_editor/appearance/whitespace/draw_tabs", true); - _initial_set("text_editor/appearance/whitespace/draw_spaces", false); + _initial_set("text_editor/appearance/whitespace/draw_tabs", true, true); + _initial_set("text_editor/appearance/whitespace/draw_spaces", false, true); EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/appearance/whitespace/line_spacing", 4, "0,50,1") // Behavior // Behavior: Navigation - _initial_set("text_editor/behavior/navigation/move_caret_on_right_click", true); - _initial_set("text_editor/behavior/navigation/scroll_past_end_of_file", false); - _initial_set("text_editor/behavior/navigation/smooth_scrolling", true); + _initial_set("text_editor/behavior/navigation/move_caret_on_right_click", true, true); + _initial_set("text_editor/behavior/navigation/scroll_past_end_of_file", false, true); + _initial_set("text_editor/behavior/navigation/smooth_scrolling", true, true); EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/behavior/navigation/v_scroll_speed", 80, "1,10000,1") - _initial_set("text_editor/behavior/navigation/drag_and_drop_selection", true); - _initial_set("text_editor/behavior/navigation/stay_in_script_editor_on_node_selected", true); - _initial_set("text_editor/behavior/navigation/open_script_when_connecting_signal_to_existing_method", true); + _initial_set("text_editor/behavior/navigation/drag_and_drop_selection", true, true); + _initial_set("text_editor/behavior/navigation/stay_in_script_editor_on_node_selected", true, true); + _initial_set("text_editor/behavior/navigation/open_script_when_connecting_signal_to_existing_method", true, true); _initial_set("text_editor/behavior/navigation/use_default_word_separators", true); // Includes ยด`~$^=+|<> General punctuation and CJK punctuation. _initial_set("text_editor/behavior/navigation/use_custom_word_separators", false); _initial_set("text_editor/behavior/navigation/custom_word_separators", ""); // Custom word separators. // Behavior: Indent - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/behavior/indent/type", 0, "Tabs,Spaces") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/behavior/indent/size", 4, "1,64,1") // size of 0 crashes. + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/behavior/indent/type", 0, "Tabs,Spaces") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/behavior/indent/size", 4, "1,64,1") // size of 0 crashes. _initial_set("text_editor/behavior/indent/auto_indent", true); _initial_set("text_editor/behavior/indent/indent_wrapped_lines", true); @@ -683,11 +694,11 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { _initial_set("text_editor/behavior/files/convert_indent_on_save", true); _initial_set("text_editor/behavior/files/auto_reload_scripts_on_external_change", false); _initial_set("text_editor/behavior/files/auto_reload_and_parse_scripts_on_save", true); - _initial_set("text_editor/behavior/files/open_dominant_script_on_scene_change", false); + _initial_set("text_editor/behavior/files/open_dominant_script_on_scene_change", false, true); // Script list - _initial_set("text_editor/script_list/show_members_overview", true); - _initial_set("text_editor/script_list/sort_members_outline_alphabetically", false); + _initial_set("text_editor/script_list/show_members_overview", true, true); + _initial_set("text_editor/script_list/sort_members_outline_alphabetically", false, true); _initial_set("text_editor/script_list/script_temperature_enabled", true); _initial_set("text_editor/script_list/script_temperature_history_size", 15); _initial_set("text_editor/script_list/group_help_pages", true); @@ -698,27 +709,27 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // Completion EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "text_editor/completion/idle_parse_delay", 1.5, "0.1,10,0.01") - _initial_set("text_editor/completion/auto_brace_complete", true); - _initial_set("text_editor/completion/code_complete_enabled", true); + _initial_set("text_editor/completion/auto_brace_complete", true, true); + _initial_set("text_editor/completion/code_complete_enabled", true, true); EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "text_editor/completion/code_complete_delay", 0.3, "0.01,5,0.01,or_greater") _initial_set("text_editor/completion/put_callhint_tooltip_below_current_line", true); _initial_set("text_editor/completion/complete_file_paths", true); - _initial_set("text_editor/completion/add_type_hints", true); - _initial_set("text_editor/completion/add_string_name_literals", false); - _initial_set("text_editor/completion/add_node_path_literals", false); - _initial_set("text_editor/completion/use_single_quotes", false); + _initial_set("text_editor/completion/add_type_hints", true, true); + _initial_set("text_editor/completion/add_string_name_literals", false, true); + _initial_set("text_editor/completion/add_node_path_literals", false, true); + _initial_set("text_editor/completion/use_single_quotes", false, true); _initial_set("text_editor/completion/colorize_suggestions", true); // External editor (ScriptEditorPlugin) - _initial_set("text_editor/external/use_external_editor", false); + _initial_set("text_editor/external/use_external_editor", false, true); _initial_set("text_editor/external/exec_path", ""); // Help _initial_set("text_editor/help/show_help_index", true); - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_font_size", 16, "8,48,1") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_source_font_size", 15, "8,48,1") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_title_font_size", 23, "8,64,1") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/help/class_reference_examples", 0, "GDScript,C#,GDScript and C#") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_font_size", 16, "8,48,1") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_source_font_size", 15, "8,48,1") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_title_font_size", 23, "8,64,1") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/help/class_reference_examples", 0, "GDScript,C#,GDScript and C#") _initial_set("text_editor/help/sort_functions_alphabetically", true); /* Editors */ @@ -733,8 +744,8 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/grid_map/editor_side", 1, "Left,Right"); // 3D - EDITOR_SETTING(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d/primary_grid_color", Color(0.56, 0.56, 0.56, 0.5), "") - EDITOR_SETTING(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d/secondary_grid_color", Color(0.38, 0.38, 0.38, 0.5), "") + EDITOR_SETTING_BASIC(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d/primary_grid_color", Color(0.56, 0.56, 0.56, 0.5), "") + EDITOR_SETTING_BASIC(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d/secondary_grid_color", Color(0.38, 0.38, 0.38, 0.5), "") // 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) @@ -766,8 +777,8 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // 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. - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "editors/3d/primary_grid_steps", 8, "1,100,1") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "editors/3d/grid_size", 200, "1,2000,1") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "editors/3d/primary_grid_steps", 8, "1,100,1") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "editors/3d/grid_size", 200, "1,2000,1") // Higher values produce graphical artifacts when far away unless View Z-Far // is increased significantly more than it really should need to be. EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "editors/3d/grid_division_level_max", 2, "-1,3,1") @@ -783,25 +794,25 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // Use a lower default FOV for the 3D camera compared to the // Camera3D node as the 3D viewport doesn't span the whole screen. // This means it's technically viewed from a further distance, which warrants a narrower FOV. - EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/default_fov", 70.0, "1,179,0.1,degrees") - EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/default_z_near", 0.05, "0.01,10,0.01,or_greater,suffix:m") - EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/default_z_far", 4000.0, "0.1,4000,0.1,or_greater,suffix:m") + EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/default_fov", 70.0, "1,179,0.1,degrees") + EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/default_z_near", 0.05, "0.01,10,0.01,or_greater,suffix:m") + EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/default_z_far", 4000.0, "0.1,4000,0.1,or_greater,suffix:m") // 3D: Navigation - _initial_set("editors/3d/navigation/invert_x_axis", false); - _initial_set("editors/3d/navigation/invert_y_axis", false); - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/navigation_scheme", 0, "Godot,Maya,Modo,Custom") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/orbit_mouse_button", 1, "Left Mouse,Middle Mouse,Right Mouse") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/pan_mouse_button", 1, "Left Mouse,Middle Mouse,Right Mouse") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/zoom_mouse_button", 1, "Left Mouse,Middle Mouse,Right Mouse") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/zoom_style", 0, "Vertical,Horizontal") + _initial_set("editors/3d/navigation/invert_x_axis", false, true); + _initial_set("editors/3d/navigation/invert_y_axis", false, true); + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/navigation_scheme", 0, "Godot,Maya,Modo,Custom") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/orbit_mouse_button", 1, "Left Mouse,Middle Mouse,Right Mouse") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/pan_mouse_button", 1, "Left Mouse,Middle Mouse,Right Mouse") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/zoom_mouse_button", 1, "Left Mouse,Middle Mouse,Right Mouse") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/navigation/zoom_style", 0, "Vertical,Horizontal") - _initial_set("editors/3d/navigation/emulate_numpad", false); - _initial_set("editors/3d/navigation/emulate_3_button_mouse", false); - _initial_set("editors/3d/navigation/warped_mouse_panning", true); + _initial_set("editors/3d/navigation/emulate_numpad", false, true); + _initial_set("editors/3d/navigation/emulate_3_button_mouse", false, true); + _initial_set("editors/3d/navigation/warped_mouse_panning", true, true); // 3D: Navigation feel - EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_sensitivity", 0.25, "0.01,2,0.001") + EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_sensitivity", 0.25, "0.01,2,0.001") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_inertia", 0.0, "0,1,0.001") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/translation_inertia", 0.05, "0,1,0.001") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/zoom_inertia", 0.05, "0,1,0.001") @@ -809,11 +820,11 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { _initial_set("editors/3d/navigation/show_viewport_navigation_gizmo", DisplayServer::get_singleton()->is_touchscreen_available()); // 3D: Freelook - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/freelook/freelook_navigation_scheme", 0, "Default,Partially Axis-Locked (id Tech),Fully Axis-Locked (Minecraft)") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/freelook/freelook_navigation_scheme", 0, "Default,Partially Axis-Locked (id Tech),Fully Axis-Locked (Minecraft)") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/freelook/freelook_sensitivity", 0.25, "0.01,2,0.001") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/freelook/freelook_inertia", 0.0, "0,1,0.001") - EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/freelook/freelook_base_speed", 5.0, "0,10,0.01") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/freelook/freelook_activation_modifier", 0, "None,Shift,Alt,Meta,Ctrl") + EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/freelook/freelook_base_speed", 5.0, "0,10,0.01") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/freelook/freelook_activation_modifier", 0, "None,Shift,Alt,Meta,Ctrl") _initial_set("editors/3d/freelook/freelook_speed_zoom_link", false); // 3D: Manipulator @@ -821,9 +832,9 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/manipulator_gizmo_opacity", 0.9, "0,1,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) // 2D - _initial_set("editors/2d/grid_color", Color(1.0, 1.0, 1.0, 0.07)); - _initial_set("editors/2d/guides_color", Color(0.6, 0.0, 0.8)); - _initial_set("editors/2d/smart_snapping_line_color", Color(0.9, 0.1, 0.1)); + _initial_set("editors/2d/grid_color", Color(1.0, 1.0, 1.0, 0.07), true); + _initial_set("editors/2d/guides_color", Color(0.6, 0.0, 0.8), true); + _initial_set("editors/2d/smart_snapping_line_color", Color(0.9, 0.1, 0.1), true); EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/2d/bone_width", 5.0, "0.01,20,0.01,or_greater") _initial_set("editors/2d/bone_color1", Color(1.0, 1.0, 1.0, 0.7)); _initial_set("editors/2d/bone_color2", Color(0.6, 0.6, 0.6, 0.7)); @@ -831,9 +842,9 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { _initial_set("editors/2d/bone_ik_color", Color(0.9, 0.9, 0.45, 0.7)); _initial_set("editors/2d/bone_outline_color", Color(0.35, 0.35, 0.35, 0.5)); EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/2d/bone_outline_size", 2.0, "0.01,8,0.01,or_greater") - _initial_set("editors/2d/viewport_border_color", Color(0.4, 0.4, 1.0, 0.4)); - _initial_set("editors/2d/use_integer_zoom_by_default", false); - EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/2d/zoom_speed_factor", 1.1, "1.01,2,0.01") + _initial_set("editors/2d/viewport_border_color", Color(0.4, 0.4, 1.0, 0.4), true); + _initial_set("editors/2d/use_integer_zoom_by_default", false, true); + EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/2d/zoom_speed_factor", 1.1, "1.01,2,0.01") // Bone mapper (BoneMapEditorPlugin) _initial_set("editors/bone_mapper/handle_colors/unset", Color(0.3, 0.3, 0.3)); @@ -843,12 +854,12 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // Panning // Enum should be in sync with ControlScheme in ViewPanner. - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/2d_editor_panning_scheme", 0, "Scroll Zooms,Scroll Pans"); - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/sub_editors_panning_scheme", 0, "Scroll Zooms,Scroll Pans"); - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/animation_editors_panning_scheme", 1, "Scroll Zooms,Scroll Pans"); + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/2d_editor_panning_scheme", 0, "Scroll Zooms,Scroll Pans"); + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/sub_editors_panning_scheme", 0, "Scroll Zooms,Scroll Pans"); + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/animation_editors_panning_scheme", 1, "Scroll Zooms,Scroll Pans"); _initial_set("editors/panning/simple_panning", false); _initial_set("editors/panning/warped_mouse_panning", true); - _initial_set("editors/panning/2d_editor_pan_speed", 20); + _initial_set("editors/panning/2d_editor_pan_speed", 20, true); // Tiles editor _initial_set("editors/tiles_editor/display_grid", true); @@ -862,14 +873,14 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // Animation _initial_set("editors/animation/autorename_animation_tracks", true); - _initial_set("editors/animation/confirm_insert_track", true); - _initial_set("editors/animation/default_create_bezier_tracks", false); - _initial_set("editors/animation/default_create_reset_tracks", true); + _initial_set("editors/animation/confirm_insert_track", true, true); + _initial_set("editors/animation/default_create_bezier_tracks", false, true); + _initial_set("editors/animation/default_create_reset_tracks", true, true); _initial_set("editors/animation/onion_layers_past_color", Color(1, 0, 0)); _initial_set("editors/animation/onion_layers_future_color", Color(0, 1, 0)); // Shader editor - _initial_set("editors/shader_editor/behavior/files/restore_shaders_on_load", true); + _initial_set("editors/shader_editor/behavior/files/restore_shaders_on_load", true, true); // Visual editors EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "editors/visual_editors/color_theme", "Default", "Default,Legacy,Custom") @@ -889,46 +900,46 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { // Window placement #ifndef ANDROID_ENABLED - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "run/window_placement/rect", 1, "Top Left,Centered,Custom Position,Force Maximized,Force Fullscreen") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/window_placement/rect", 1, "Top Left,Centered,Custom Position,Force Maximized,Force Fullscreen") // Keep the enum values in sync with the `DisplayServer::SCREEN_` enum. String screen_hints = "Same as Editor:-5,Previous Screen:-4,Next Screen:-3,Primary Screen:-2"; // Note: Main Window Screen:-1 is not used for the main window. for (int i = 0; i < DisplayServer::get_singleton()->get_screen_count(); i++) { screen_hints += ",Screen " + itos(i + 1) + ":" + itos(i); } _initial_set("run/window_placement/rect_custom_position", Vector2()); - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "run/window_placement/screen", -5, screen_hints) + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/window_placement/screen", -5, screen_hints) #endif // Should match the ANDROID_WINDOW_* constants in 'platform/android/java/editor/src/main/java/org/godotengine/editor/GodotEditor.kt' String android_window_hints = "Auto (based on screen size):0,Same as Editor:1,Side-by-side with Editor:2,Launch in PiP mode:3"; - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "run/window_placement/android_window", 0, android_window_hints) + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/window_placement/android_window", 0, android_window_hints) int default_play_window_pip_mode = 0; #ifdef ANDROID_ENABLED default_play_window_pip_mode = 2; #endif - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "run/window_placement/play_window_pip_mode", default_play_window_pip_mode, "Disabled:0,Enabled:1,Enabled when Play window is same as Editor:2") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/window_placement/play_window_pip_mode", default_play_window_pip_mode, "Disabled:0,Enabled:1,Enabled when Play window is same as Editor:2") // Auto save - _initial_set("run/auto_save/save_before_running", true); + _initial_set("run/auto_save/save_before_running", true, true); // Bottom panel - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "run/bottom_panel/action_on_play", EditorNode::ACTION_ON_PLAY_OPEN_OUTPUT, "Do Nothing,Open Output,Open Debugger") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "run/bottom_panel/action_on_stop", EditorNode::ACTION_ON_STOP_DO_NOTHING, "Do Nothing,Close Bottom Panel") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/bottom_panel/action_on_play", EditorNode::ACTION_ON_PLAY_OPEN_OUTPUT, "Do Nothing,Open Output,Open Debugger") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "run/bottom_panel/action_on_stop", EditorNode::ACTION_ON_STOP_DO_NOTHING, "Do Nothing,Close Bottom Panel") // Output - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "run/output/font_size", 13, "8,48,1") - _initial_set("run/output/always_clear_output_on_play", true); + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "run/output/font_size", 13, "8,48,1") + _initial_set("run/output/always_clear_output_on_play", true, true); EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "run/output/max_lines", 10000, "100,100000,1") // Platform - _initial_set("run/platforms/linuxbsd/prefer_wayland", false); + _initial_set("run/platforms/linuxbsd/prefer_wayland", false, true); set_restart_if_changed("run/platforms/linuxbsd/prefer_wayland", true); /* Network */ // General - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "network/connection/network_mode", 0, "Offline,Online"); + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "network/connection/network_mode", 0, "Offline,Online"); // HTTP Proxy _initial_set("network/http_proxy/host", ""); @@ -943,37 +954,42 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { /* Debugger/profiler */ - EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "debugger/auto_switch_to_remote_scene_tree", false, "") + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "debugger/auto_switch_to_remote_scene_tree", false, "") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "debugger/profiler_frame_history_size", 3600, "60,10000,1") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "debugger/profiler_frame_max_functions", 64, "16,512,1") EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "debugger/profiler_target_fps", 60, "1,1000,1") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "debugger/remote_scene_tree_refresh_interval", 1.0, "0.1,10,0.01,or_greater") EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "debugger/remote_inspect_refresh_interval", 0.2, "0.02,10,0.01,or_greater") - EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "debugger/profile_native_calls", false, "") + EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "debugger/profile_native_calls", false, "") // Version control (VersionControlEditorPlugin) - _initial_set("version_control/username", ""); + _initial_set("version_control/username", "", true); _initial_set("version_control/ssh_public_key_path", ""); _initial_set("version_control/ssh_private_key_path", ""); /* Extra config */ - EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "input/buffering/agile_event_flushing", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) - EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "input/buffering/use_accumulated_input", true, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) + EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "input/buffering/agile_event_flushing", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING) + EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "input/buffering/use_accumulated_input", true, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING) // TRANSLATORS: Project Manager here refers to the tool used to create/manage Godot projects. EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/sorting_order", 0, "Last Edited,Name,Path") - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/directory_naming_convention", 1, "No convention,kebab-case,snake_case,camelCase,PascalCase,Title Case") + EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/directory_naming_convention", 1, "No convention,kebab-case,snake_case,camelCase,PascalCase,Title Case") #if defined(WEB_ENABLED) // Web platform only supports `gl_compatibility`. - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "project_manager/default_renderer", "gl_compatibility", "forward_plus,mobile,gl_compatibility") + const String default_renderer = "gl_compatibility"; #elif defined(ANDROID_ENABLED) // Use more suitable rendering method by default. - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "project_manager/default_renderer", "mobile", "forward_plus,mobile,gl_compatibility") + const String default_renderer = "mobile"; #else - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "project_manager/default_renderer", "forward_plus", "forward_plus,mobile,gl_compatibility") + const String default_renderer = "forward_plus"; #endif + EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_ENUM, "project_manager/default_renderer", default_renderer, "forward_plus,mobile,gl_compatibility") + +#undef EDITOR_SETTING +#undef EDITOR_SETTING_BASIC +#undef EDITOR_SETTING_USAGE if (p_extra_config.is_valid()) { if (p_extra_config->has_section("init_projects") && p_extra_config->has_section_key("init_projects", "list")) { @@ -998,37 +1014,37 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { void EditorSettings::_load_godot2_text_editor_theme() { // Godot 2 is only a dark theme; it doesn't have a light theme counterpart. - _initial_set("text_editor/theme/highlighting/symbol_color", Color(0.73, 0.87, 1.0)); - _initial_set("text_editor/theme/highlighting/keyword_color", Color(1.0, 1.0, 0.7)); - _initial_set("text_editor/theme/highlighting/control_flow_keyword_color", Color(1.0, 0.85, 0.7)); - _initial_set("text_editor/theme/highlighting/base_type_color", Color(0.64, 1.0, 0.83)); - _initial_set("text_editor/theme/highlighting/engine_type_color", Color(0.51, 0.83, 1.0)); - _initial_set("text_editor/theme/highlighting/user_type_color", Color(0.42, 0.67, 0.93)); - _initial_set("text_editor/theme/highlighting/comment_color", Color(0.4, 0.4, 0.4)); - _initial_set("text_editor/theme/highlighting/doc_comment_color", Color(0.5, 0.6, 0.7)); - _initial_set("text_editor/theme/highlighting/string_color", Color(0.94, 0.43, 0.75)); - _initial_set("text_editor/theme/highlighting/background_color", Color(0.13, 0.12, 0.15)); + _initial_set("text_editor/theme/highlighting/symbol_color", Color(0.73, 0.87, 1.0), true); + _initial_set("text_editor/theme/highlighting/keyword_color", Color(1.0, 1.0, 0.7), true); + _initial_set("text_editor/theme/highlighting/control_flow_keyword_color", Color(1.0, 0.85, 0.7), true); + _initial_set("text_editor/theme/highlighting/base_type_color", Color(0.64, 1.0, 0.83), true); + _initial_set("text_editor/theme/highlighting/engine_type_color", Color(0.51, 0.83, 1.0), true); + _initial_set("text_editor/theme/highlighting/user_type_color", Color(0.42, 0.67, 0.93), true); + _initial_set("text_editor/theme/highlighting/comment_color", Color(0.4, 0.4, 0.4), true); + _initial_set("text_editor/theme/highlighting/doc_comment_color", Color(0.5, 0.6, 0.7), true); + _initial_set("text_editor/theme/highlighting/string_color", Color(0.94, 0.43, 0.75), true); + _initial_set("text_editor/theme/highlighting/background_color", Color(0.13, 0.12, 0.15), true); _initial_set("text_editor/theme/highlighting/completion_background_color", Color(0.17, 0.16, 0.2)); _initial_set("text_editor/theme/highlighting/completion_selected_color", Color(0.26, 0.26, 0.27)); _initial_set("text_editor/theme/highlighting/completion_existing_color", Color(0.87, 0.87, 0.87, 0.13)); _initial_set("text_editor/theme/highlighting/completion_scroll_color", Color(1, 1, 1, 0.29)); _initial_set("text_editor/theme/highlighting/completion_scroll_hovered_color", Color(1, 1, 1, 0.4)); _initial_set("text_editor/theme/highlighting/completion_font_color", Color(0.67, 0.67, 0.67)); - _initial_set("text_editor/theme/highlighting/text_color", Color(0.67, 0.67, 0.67)); - _initial_set("text_editor/theme/highlighting/line_number_color", Color(0.67, 0.67, 0.67, 0.4)); - _initial_set("text_editor/theme/highlighting/safe_line_number_color", Color(0.67, 0.78, 0.67, 0.6)); - _initial_set("text_editor/theme/highlighting/caret_color", Color(0.67, 0.67, 0.67)); - _initial_set("text_editor/theme/highlighting/caret_background_color", Color(0, 0, 0)); - _initial_set("text_editor/theme/highlighting/text_selected_color", Color(0, 0, 0, 0)); - _initial_set("text_editor/theme/highlighting/selection_color", Color(0.41, 0.61, 0.91, 0.35)); - _initial_set("text_editor/theme/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2)); - _initial_set("text_editor/theme/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15)); - _initial_set("text_editor/theme/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1)); - _initial_set("text_editor/theme/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15)); - _initial_set("text_editor/theme/highlighting/number_color", Color(0.92, 0.58, 0.2)); - _initial_set("text_editor/theme/highlighting/function_color", Color(0.4, 0.64, 0.81)); - _initial_set("text_editor/theme/highlighting/member_variable_color", Color(0.9, 0.31, 0.35)); - _initial_set("text_editor/theme/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); + _initial_set("text_editor/theme/highlighting/text_color", Color(0.67, 0.67, 0.67), true); + _initial_set("text_editor/theme/highlighting/line_number_color", Color(0.67, 0.67, 0.67, 0.4), true); + _initial_set("text_editor/theme/highlighting/safe_line_number_color", Color(0.67, 0.78, 0.67, 0.6), true); + _initial_set("text_editor/theme/highlighting/caret_color", Color(0.67, 0.67, 0.67), true); + _initial_set("text_editor/theme/highlighting/caret_background_color", Color(0, 0, 0), true); + _initial_set("text_editor/theme/highlighting/text_selected_color", Color(0, 0, 0, 0), true); + _initial_set("text_editor/theme/highlighting/selection_color", Color(0.41, 0.61, 0.91, 0.35), true); + _initial_set("text_editor/theme/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2), true); + _initial_set("text_editor/theme/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15), true); + _initial_set("text_editor/theme/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1), true); + _initial_set("text_editor/theme/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15), true); + _initial_set("text_editor/theme/highlighting/number_color", Color(0.92, 0.58, 0.2), true); + _initial_set("text_editor/theme/highlighting/function_color", Color(0.4, 0.64, 0.81), true); + _initial_set("text_editor/theme/highlighting/member_variable_color", Color(0.9, 0.31, 0.35), true); + _initial_set("text_editor/theme/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4), true); _initial_set("text_editor/theme/highlighting/bookmark_color", Color(0.08, 0.49, 0.98)); _initial_set("text_editor/theme/highlighting/breakpoint_color", Color(0.9, 0.29, 0.3)); _initial_set("text_editor/theme/highlighting/executing_line_color", Color(0.98, 0.89, 0.27)); @@ -1349,6 +1365,15 @@ void EditorSettings::set_restart_if_changed(const StringName &p_setting, bool p_ props[p_setting].restart_if_changed = p_restart; } +void EditorSettings::set_basic(const StringName &p_setting, bool p_basic) { + _THREAD_SAFE_METHOD_ + + if (!props.has(p_setting)) { + return; + } + props[p_setting].basic = p_basic; +} + void EditorSettings::set_initial_value(const StringName &p_setting, const Variant &p_value, bool p_update_current) { _THREAD_SAFE_METHOD_ @@ -1362,7 +1387,7 @@ void EditorSettings::set_initial_value(const StringName &p_setting, const Varian } } -Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_restart_if_changed) { +Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_restart_if_changed, bool p_basic) { ERR_FAIL_NULL_V_MSG(EditorSettings::get_singleton(), p_default, "EditorSettings not instantiated yet."); Variant ret = p_default; @@ -1372,6 +1397,7 @@ Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_re EditorSettings::get_singleton()->set_manually(p_setting, p_default); } EditorSettings::get_singleton()->set_restart_if_changed(p_setting, p_restart_if_changed); + EditorSettings::get_singleton()->set_basic(p_setting, p_basic); if (!EditorSettings::get_singleton()->has_default_value(p_setting)) { EditorSettings::get_singleton()->set_initial_value(p_setting, p_default); diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 6338f9105c5..e850406839d 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -67,6 +67,7 @@ private: int order = 0; Variant variant; Variant initial; + bool basic = false; bool has_default_value = false; bool hide_from_editor = false; bool save = false; @@ -103,7 +104,7 @@ private: bool _set(const StringName &p_name, const Variant &p_value); bool _set_only(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; - void _initial_set(const StringName &p_name, const Variant &p_value); + void _initial_set(const StringName &p_name, const Variant &p_value, bool p_basic = false); void _get_property_list(List *p_list) const; void _add_property_info_bind(const Dictionary &p_info); bool _property_can_revert(const StringName &p_name) const; @@ -147,6 +148,7 @@ public: void raise_order(const String &p_setting); void set_initial_value(const StringName &p_setting, const Variant &p_value, bool p_update_current = false); void set_restart_if_changed(const StringName &p_setting, bool p_restart); + void set_basic(const StringName &p_setting, bool p_basic); void set_manually(const StringName &p_setting, const Variant &p_value, bool p_emit_signal = false) { if (p_emit_signal) { _set(p_setting, p_value); @@ -204,7 +206,8 @@ public: #define EDITOR_DEF(m_var, m_val) _EDITOR_DEF(m_var, Variant(m_val)) #define EDITOR_DEF_RST(m_var, m_val) _EDITOR_DEF(m_var, Variant(m_val), true) -Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_restart_if_changed = false); +#define EDITOR_DEF_BASIC(m_var, m_val) _EDITOR_DEF(m_var, Variant(m_val), false, true) +Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_restart_if_changed = false, bool p_basic = false); #define EDITOR_GET(m_var) _EDITOR_GET(m_var) Variant _EDITOR_GET(const String &p_setting); diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 7e4dec86e9f..81bc9c8fbe8 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -45,6 +45,7 @@ #include "editor/plugins/node_3d_editor_plugin.h" #include "editor/themes/editor_scale.h" #include "editor/themes/editor_theme_manager.h" +#include "scene/gui/check_button.h" #include "scene/gui/panel_container.h" #include "scene/gui/tab_container.h" #include "scene/gui/texture_rect.h" @@ -803,6 +804,11 @@ void EditorSettingsDialog::_focus_current_search_box() { } } +void EditorSettingsDialog::_advanced_toggled(bool p_button_pressed) { + EditorSettings::get_singleton()->set("_editor_settings_advanced_mode", p_button_pressed); + inspector->set_restrict_to_basic_settings(!p_button_pressed); +} + void EditorSettingsDialog::_editor_restart() { EditorNode::get_singleton()->save_all_scenes(); EditorNode::get_singleton()->restart_editor(); @@ -845,8 +851,16 @@ EditorSettingsDialog::EditorSettingsDialog() { search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->add_child(search_box); + advanced_switch = memnew(CheckButton(TTR("Advanced Settings"))); + hbc->add_child(advanced_switch); + + bool use_advanced = EDITOR_DEF("_editor_settings_advanced_mode", false); + advanced_switch->set_pressed(use_advanced); + advanced_switch->connect(SceneStringName(toggled), callable_mp(this, &EditorSettingsDialog::_advanced_toggled)); + inspector = memnew(SectionedInspector); inspector->get_inspector()->set_use_filter(true); + inspector->set_restrict_to_basic_settings(!use_advanced); inspector->register_search_box(search_box); inspector->set_v_size_flags(Control::SIZE_EXPAND_FILL); tab_general->add_child(inspector); diff --git a/editor/editor_settings_dialog.h b/editor/editor_settings_dialog.h index c213f737e2c..edc75951079 100644 --- a/editor/editor_settings_dialog.h +++ b/editor/editor_settings_dialog.h @@ -34,6 +34,7 @@ #include "editor/action_map_editor.h" #include "scene/gui/dialogs.h" +class CheckButton; class PanelContainer; class SectionedInspector; class TabContainer; @@ -51,6 +52,7 @@ class EditorSettingsDialog : public AcceptDialog { Control *tab_shortcuts = nullptr; LineEdit *search_box = nullptr; + CheckButton *advanced_switch = nullptr; LineEdit *shortcut_search_box = nullptr; EventListenerLineEdit *shortcut_search_by_event = nullptr; SectionedInspector *inspector = nullptr; @@ -100,6 +102,8 @@ class EditorSettingsDialog : public AcceptDialog { void _tabs_tab_changed(int p_tab); void _focus_current_search_box(); + void _advanced_toggled(bool p_button_pressed); + void _update_dynamic_property_hints(); PropertyInfo _create_mouse_shortcut_property_info(const String &p_property_name, const String &p_shortcut_1_name, const String &p_shortcut_2_name); String _get_shortcut_button_string(const String &p_shortcut_name); diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 1bc600c56f0..93ac498ab3e 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -43,16 +43,16 @@ void register_android_exporter_types() { void register_android_exporter() { // TODO: Move to editor_settings.cpp - EDITOR_DEF("export/android/debug_keystore", EditorPaths::get_singleton()->get_debug_keystore_path()); + EDITOR_DEF_BASIC("export/android/debug_keystore", EditorPaths::get_singleton()->get_debug_keystore_path()); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/debug_keystore", PROPERTY_HINT_GLOBAL_FILE, "*.keystore,*.jks")); - EDITOR_DEF("export/android/debug_keystore_user", DEFAULT_ANDROID_KEYSTORE_DEBUG_USER); - EDITOR_DEF("export/android/debug_keystore_pass", DEFAULT_ANDROID_KEYSTORE_DEBUG_PASSWORD); + EDITOR_DEF_BASIC("export/android/debug_keystore_user", DEFAULT_ANDROID_KEYSTORE_DEBUG_USER); + EDITOR_DEF_BASIC("export/android/debug_keystore_pass", DEFAULT_ANDROID_KEYSTORE_DEBUG_PASSWORD); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/debug_keystore_pass", PROPERTY_HINT_PASSWORD)); #ifndef ANDROID_ENABLED - EDITOR_DEF("export/android/java_sdk_path", OS::get_singleton()->get_environment("JAVA_HOME")); + EDITOR_DEF_BASIC("export/android/java_sdk_path", OS::get_singleton()->get_environment("JAVA_HOME")); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/java_sdk_path", PROPERTY_HINT_GLOBAL_DIR)); - EDITOR_DEF("export/android/android_sdk_path", OS::get_singleton()->get_environment("ANDROID_HOME")); + EDITOR_DEF_BASIC("export/android/android_sdk_path", OS::get_singleton()->get_environment("ANDROID_HOME")); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/android_sdk_path", PROPERTY_HINT_GLOBAL_DIR)); EDITOR_DEF("export/android/force_system_user", false); diff --git a/platform/macos/export/export.cpp b/platform/macos/export/export.cpp index df31ccfb564..0c7018d2a8f 100644 --- a/platform/macos/export/export.cpp +++ b/platform/macos/export/export.cpp @@ -39,7 +39,7 @@ void register_macos_exporter_types() { void register_macos_exporter() { // TODO: Move to editor_settings.cpp #ifndef ANDROID_ENABLED - EDITOR_DEF("export/macos/rcodesign", ""); + EDITOR_DEF_BASIC("export/macos/rcodesign", ""); #ifdef WINDOWS_ENABLED EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/macos/rcodesign", PROPERTY_HINT_GLOBAL_FILE, "*.exe")); #else diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index a062963c2e5..8c963e9a9d9 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -41,16 +41,16 @@ void register_windows_exporter_types() { void register_windows_exporter() { // TODO: Move to editor_settings.cpp #ifndef ANDROID_ENABLED - EDITOR_DEF("export/windows/rcedit", ""); + EDITOR_DEF_BASIC("export/windows/rcedit", ""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/rcedit", PROPERTY_HINT_GLOBAL_FILE, "*.exe")); #ifdef WINDOWS_ENABLED - EDITOR_DEF("export/windows/signtool", ""); + EDITOR_DEF_BASIC("export/windows/signtool", ""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/signtool", PROPERTY_HINT_GLOBAL_FILE, "*.exe")); #else - EDITOR_DEF("export/windows/osslsigncode", ""); + EDITOR_DEF_BASIC("export/windows/osslsigncode", ""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/osslsigncode", PROPERTY_HINT_GLOBAL_FILE)); // On non-Windows we need WINE to run rcedit - EDITOR_DEF("export/windows/wine", ""); + EDITOR_DEF_BASIC("export/windows/wine", ""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/wine", PROPERTY_HINT_GLOBAL_FILE)); #endif #endif