diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-11-22 17:58:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-22 17:58:36 +0100 |
commit | f2beac49bb9f3271c2369d64dca19b542f52e146 (patch) | |
tree | e41fbc79bdf21e5dbc33cddfe8cdedbe18aa2237 | |
parent | 66ba19a435fb53ce53c1c0a355920cf8fb111e58 (diff) | |
parent | 7dc97d6558915486d4e1bed85da98422c4830894 (diff) |
Merge pull request #55230 from KoBeWi/project_settings_black_hole_fixed
-rw-r--r-- | core/config/project_settings.cpp | 16 | ||||
-rw-r--r-- | core/config/project_settings.h | 4 | ||||
-rw-r--r-- | main/main.cpp | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index f37e7f5956..336f95c925 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -368,12 +368,12 @@ void ProjectSettings::_convert_to_last_version(int p_from_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, bool p_ignore_override) { // If looking for files in a network client, use it directly if (FileAccessNetworkClient::get_singleton()) { Error err = _load_settings_text_or_binary("res://project.godot", "res://project.binary"); - if (err == OK) { + if (err == OK && !p_ignore_override) { // Optional, we don't mind if it fails _load_settings_text("res://override.cfg"); } @@ -387,7 +387,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b ERR_FAIL_COND_V_MSG(!ok, ERR_CANT_OPEN, "Cannot open resource pack '" + p_main_pack + "'."); Error err = _load_settings_text_or_binary("res://project.godot", "res://project.binary"); - if (err == OK) { + if (err == OK && !p_ignore_override) { // Load override from location of the main pack // Optional, we don't mind if it fails _load_settings_text(p_main_pack.get_base_dir().plus_file("override.cfg")); @@ -437,7 +437,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b // If we opened our package, try and load our project. if (found) { Error err = _load_settings_text_or_binary("res://project.godot", "res://project.binary"); - if (err == OK) { + if (err == OK && !p_ignore_override) { // Load override from location of the executable. // Optional, we don't mind if it fails. _load_settings_text(exec_path.get_base_dir().plus_file("override.cfg")); @@ -458,7 +458,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b } Error err = _load_settings_text_or_binary("res://project.godot", "res://project.binary"); - if (err == OK) { + if (err == OK && !p_ignore_override) { // Optional, we don't mind if it fails. _load_settings_text("res://override.cfg"); } @@ -481,7 +481,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b resource_path = current_dir; resource_path = resource_path.replace("\\", "/"); // Windows path to Unix path just in case. err = _load_settings_text_or_binary(current_dir.plus_file("project.godot"), current_dir.plus_file("project.binary")); - if (err == OK) { + if (err == OK && !p_ignore_override) { // Optional, we don't mind if it fails. _load_settings_text(current_dir.plus_file("override.cfg")); found = true; @@ -513,8 +513,8 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b 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); +Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bool p_upwards, bool p_ignore_override) { + Error err = _setup(p_path, p_main_pack, p_upwards, p_ignore_override); if (err == OK) { String custom_settings = GLOBAL_DEF("application/config/project_settings_override", ""); if (custom_settings != "") { diff --git a/core/config/project_settings.h b/core/config/project_settings.h index ca37401751..aaa8e383f7 100644 --- a/core/config/project_settings.h +++ b/core/config/project_settings.h @@ -117,7 +117,7 @@ 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); + Error _setup(const String &p_path, const String &p_main_pack, bool p_upwards = false, bool p_ignore_override = false); void _add_builtin_input_map(); @@ -156,7 +156,7 @@ public: void set_builtin_order(const String &p_name); bool is_builtin_setting(const String &p_name) const; - Error setup(const String &p_path, const String &p_main_pack, bool p_upwards = false); + Error setup(const String &p_path, const String &p_main_pack, bool p_upwards = false, bool p_ignore_override = false); Error save_custom(const String &p_path = "", const CustomMap &p_custom = CustomMap(), const Vector<String> &p_custom_features = Vector<String>(), bool p_merge_with_current = true); Error save(); diff --git a/main/main.cpp b/main/main.cpp index f0f8c01592..9f51025cc3 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1136,7 +1136,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph FileAccess::make_default<FileAccessNetwork>(FileAccess::ACCESS_RESOURCES); } - if (globals->setup(project_path, main_pack, upwards) == OK) { + if (globals->setup(project_path, main_pack, upwards, editor) == OK) { #ifdef TOOLS_ENABLED found_project = true; #endif |