diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-12-14 08:58:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 08:58:29 +0100 |
commit | 29a527fb9057afd534ea0d6ef6c4b36cc4b3deef (patch) | |
tree | 9f451f4b584c93b9f36eb6abda6aafb5b85fc7e0 /core | |
parent | 4148eed9437d8d01afc3cfa69279f2c3d9dc48c6 (diff) | |
parent | 8dad3811c52a23ce53b8e165dc065f38ab5c4ccc (diff) |
Merge pull request #23799 from marcelofg55/custom_ps
Add application/config/project_settings_override option to override project settings
Diffstat (limited to 'core')
-rw-r--r-- | core/project_settings.cpp | 15 | ||||
-rw-r--r-- | core/project_settings.h | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 407bb78375..031ac06063 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -307,7 +307,7 @@ void ProjectSettings::_convert_to_last_version() { * If a project file is found, load it or fail. * If nothing was found, error out. */ -Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bool p_upwards) { +Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, bool p_upwards) { // If looking for files in a network client, use it directly @@ -450,6 +450,18 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bo return OK; } +Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bool p_upwards) { + Error err = _setup(p_path, p_main_pack, p_upwards); + if (err == OK) { + String custom_settings = GLOBAL_DEF("application/config/project_settings_override", ""); + if (custom_settings != "") { + _load_settings_text(custom_settings); + } + } + + return err; +} + bool ProjectSettings::has_setting(String p_var) const { _THREAD_SAFE_METHOD_ @@ -995,6 +1007,7 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF("application/run/disable_stderr", false); GLOBAL_DEF("application/config/use_custom_user_dir", false); GLOBAL_DEF("application/config/custom_user_dir_name", ""); + GLOBAL_DEF("application/config/project_settings_override", ""); action = Dictionary(); action["deadzone"] = Variant(0.5f); diff --git a/core/project_settings.h b/core/project_settings.h index 611355f2ef..f150e4499b 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -112,6 +112,8 @@ protected: void _add_property_info_bind(const Dictionary &p_info); + Error _setup(const String &p_path, const String &p_main_pack, bool p_upwards = false); + protected: static void _bind_methods(); |