diff options
author | ne0fhyk <fhuyakou@gmail.com> | 2021-10-13 13:56:18 -0700 |
---|---|---|
committer | ne0fhyk <fhuyakou@gmail.com> | 2021-10-18 14:10:38 -0700 |
commit | b5c750fa65af018eabd339d63666316b9ca4a2d4 (patch) | |
tree | 0efaeb97caf0cbdf9b79861c115cb37eba43a588 /core/config | |
parent | f4d9749e230130fd9b462c8eb745b6d01a3accf1 (diff) |
Restrict the project data directory configuration
Diffstat (limited to 'core/config')
-rw-r--r-- | core/config/project_settings.cpp | 7 | ||||
-rw-r--r-- | core/config/project_settings.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 562cbbdd27..f37e7f5956 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -42,6 +42,8 @@ #include "core/os/os.h" #include "core/variant/variant_parser.h" +const String ProjectSettings::PROJECT_DATA_DIR_NAME_SUFFIX = "godot"; + ProjectSettings *ProjectSettings::singleton = nullptr; ProjectSettings *ProjectSettings::get_singleton() { @@ -521,7 +523,8 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bo } // Updating the default value after the project settings have loaded. - project_data_dir_name = GLOBAL_GET("application/config/project_data_dir_name"); + bool use_hidden_directory = GLOBAL_GET("application/config/use_hidden_project_data_directory"); + project_data_dir_name = (use_hidden_directory ? "." : "") + PROJECT_DATA_DIR_NAME_SUFFIX; // Using GLOBAL_GET on every block for compressing can be slow, so assigning here. Compression::zstd_long_distance_matching = GLOBAL_GET("compression/formats/zstd/long_distance_matching"); @@ -1094,7 +1097,7 @@ ProjectSettings::ProjectSettings() { custom_prop_info["application/run/main_scene"] = PropertyInfo(Variant::STRING, "application/run/main_scene", PROPERTY_HINT_FILE, "*.tscn,*.scn,*.res"); GLOBAL_DEF("application/run/disable_stdout", false); GLOBAL_DEF("application/run/disable_stderr", false); - project_data_dir_name = GLOBAL_DEF_RST("application/config/project_data_dir_name", ".godot"); + GLOBAL_DEF_RST("application/config/use_hidden_project_data_directory", true); GLOBAL_DEF("application/config/use_custom_user_dir", false); GLOBAL_DEF("application/config/custom_user_dir_name", ""); GLOBAL_DEF("application/config/project_settings_override", ""); diff --git a/core/config/project_settings.h b/core/config/project_settings.h index 82f04b94df..ca37401751 100644 --- a/core/config/project_settings.h +++ b/core/config/project_settings.h @@ -42,6 +42,7 @@ class ProjectSettings : public Object { public: typedef Map<String, Variant> CustomMap; + static const String PROJECT_DATA_DIR_NAME_SUFFIX; enum { //properties that are not for built in values begin from this value, so builtin ones are displayed first |