diff options
Diffstat (limited to 'core/config')
-rw-r--r-- | core/config/engine.cpp | 8 | ||||
-rw-r--r-- | core/config/project_settings.cpp | 10 | ||||
-rw-r--r-- | core/config/project_settings.h | 2 |
3 files changed, 13 insertions, 7 deletions
diff --git a/core/config/engine.cpp b/core/config/engine.cpp index d8fbb50a75..dc5b3e25c6 100644 --- a/core/config/engine.cpp +++ b/core/config/engine.cpp @@ -111,7 +111,7 @@ Dictionary Engine::get_version_info() const { static Array array_from_info(const char *const *info_list) { Array arr; for (int i = 0; info_list[i] != nullptr; i++) { - arr.push_back(info_list[i]); + arr.push_back(String::utf8(info_list[i])); } return arr; } @@ -119,7 +119,7 @@ static Array array_from_info(const char *const *info_list) { static Array array_from_info_count(const char *const *info_list, int info_count) { Array arr; for (int i = 0; i < info_count; i++) { - arr.push_back(info_list[i]); + arr.push_back(String::utf8(info_list[i])); } return arr; } @@ -140,14 +140,14 @@ Array Engine::get_copyright_info() const { for (int component_index = 0; component_index < COPYRIGHT_INFO_COUNT; component_index++) { const ComponentCopyright &cp_info = COPYRIGHT_INFO[component_index]; Dictionary component_dict; - component_dict["name"] = cp_info.name; + component_dict["name"] = String::utf8(cp_info.name); Array parts; for (int i = 0; i < cp_info.part_count; i++) { const ComponentCopyrightPart &cp_part = cp_info.parts[i]; Dictionary part_dict; part_dict["files"] = array_from_info_count(cp_part.files, cp_part.file_count); part_dict["copyright"] = array_from_info_count(cp_part.copyright_statements, cp_part.copyright_count); - part_dict["license"] = cp_part.license; + part_dict["license"] = String::utf8(cp_part.license); parts.push_back(part_dict); } component_dict["parts"] = parts; diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 57833fe42f..562cbbdd27 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -49,12 +49,11 @@ ProjectSettings *ProjectSettings::get_singleton() { } String ProjectSettings::get_project_data_dir_name() const { - return ".godot"; + return project_data_dir_name; } String ProjectSettings::get_project_data_path() const { - String project_data_dir_name = get_project_data_dir_name(); - return "res://" + project_data_dir_name; + return "res://" + get_project_data_dir_name(); } String ProjectSettings::get_resource_path() const { @@ -520,6 +519,10 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bo _load_settings_text(custom_settings); } } + + // Updating the default value after the project settings have loaded. + project_data_dir_name = GLOBAL_GET("application/config/project_data_dir_name"); + // 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"); Compression::zstd_level = GLOBAL_GET("compression/formats/zstd/compression_level"); @@ -1091,6 +1094,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("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 b642051402..82f04b94df 100644 --- a/core/config/project_settings.h +++ b/core/config/project_settings.h @@ -93,6 +93,8 @@ protected: OrderedHashMap<StringName, AutoloadInfo> autoloads; + String project_data_dir_name; + bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; void _get_property_list(List<PropertyInfo> *p_list) const; |