diff options
Diffstat (limited to 'editor/editor_settings.cpp')
-rw-r--r-- | editor/editor_settings.cpp | 52 |
1 files changed, 8 insertions, 44 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 1ac1d6f048..bb0a2ed7c1 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -142,7 +142,7 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const { if (builtin_list.has(shortcut_definition.key)) { // This shortcut was auto-generated from built in actions: don't save. - // If the builtin is overriden, it will be saved in the "builtin_action_overrides" section below. + // If the builtin is overridden, it will be saved in the "builtin_action_overrides" section below. continue; } @@ -431,7 +431,11 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("interface/editor/hide_console_window", false); _initial_set("interface/editor/mouse_extra_buttons_navigate_history", true); _initial_set("interface/editor/save_each_scene_on_quit", true); // Regression - EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/show_internal_errors_in_toast_notifications", 0, "Auto,Enabled,Disabled") +#ifdef DEV_ENABLED + EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/show_internal_errors_in_toast_notifications", 0, "Auto (Enabled),Enabled,Disabled") +#else + EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/show_internal_errors_in_toast_notifications", 0, "Auto (Disabled),Enabled,Disabled") +#endif // Inspector EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/inspector/max_array_dictionary_items_per_page", 20, "10,100,1") @@ -781,43 +785,6 @@ bool EditorSettings::_is_default_text_editor_theme(String p_theme_name) { return p_theme_name == "default" || p_theme_name == "godot 2" || p_theme_name == "custom"; } -static Dictionary _get_builtin_script_templates() { - Dictionary templates; - - // No Comments - templates["no_comments.gd"] = - "extends %BASE%\n" - "\n" - "\n" - "func _ready()%VOID_RETURN%:\n" - "%TS%pass\n"; - - // Empty - templates["empty.gd"] = - "extends %BASE%" - "\n" - "\n"; - - return templates; -} - -static void _create_script_templates(const String &p_path) { - Dictionary templates = _get_builtin_script_templates(); - List<Variant> keys; - templates.get_key_list(&keys); - FileAccessRef file = FileAccess::create(FileAccess::ACCESS_FILESYSTEM); - DirAccessRef dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - dir->change_dir(p_path); - for (int i = 0; i < keys.size(); i++) { - if (!dir->file_exists(keys[i])) { - Error err = file->reopen(p_path.plus_file((String)keys[i]), FileAccess::WRITE); - ERR_FAIL_COND(err != OK); - file->store_string(templates[keys[i]]); - file->close(); - } - } -} - // PUBLIC METHODS EditorSettings *EditorSettings::get_singleton() { @@ -852,10 +819,7 @@ void EditorSettings::create() { } if (EditorPaths::get_singleton()->are_paths_valid()) { - _create_script_templates(EditorPaths::get_singleton()->get_config_dir().plus_file("script_templates")); - // Validate editor config file. - DirAccessRef dir = DirAccess::open(EditorPaths::get_singleton()->get_config_dir()); String config_file_name = "editor_settings-" + itos(VERSION_MAJOR) + ".tres"; config_file_path = EditorPaths::get_singleton()->get_config_dir().plus_file(config_file_name); |