| 1129 | } |
| 1130 | |
| 1131 | Error GDRESettings::load_project_config() { |
| 1132 | Error err; |
| 1133 | ERR_FAIL_COND_V_MSG(!is_pack_loaded(), ERR_FILE_CANT_OPEN, "Pack not loaded!"); |
| 1134 | ERR_FAIL_COND_V_MSG(is_project_config_loaded(), ERR_ALREADY_IN_USE, "Project config is already loaded!"); |
| 1135 | ERR_FAIL_COND_V_MSG(!pack_has_project_config(), ERR_FILE_NOT_FOUND, "Could not find project config!"); |
| 1136 | if (get_ver_major() == 2) { |
| 1137 | err = current_project->pcfg->load_cfb(has_path_loaded("res://engine.cfb") ? "res://engine.cfb" : "res://engine.cfg", get_ver_major(), get_ver_minor()); |
| 1138 | ERR_FAIL_COND_V_MSG(err, err, "Failed to load project config!"); |
| 1139 | } else if (get_ver_major() >= 3) { |
| 1140 | err = current_project->pcfg->load_cfb(has_path_loaded("res://project.binary") ? "res://project.binary" : "res://project.godot", get_ver_major(), get_ver_minor()); |
| 1141 | ERR_FAIL_COND_V_MSG(err, err, "Failed to load project config!"); |
| 1142 | } else { |
| 1143 | ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, |
| 1144 | "Godot version not set or project uses unsupported Godot version"); |
| 1145 | } |
| 1146 | return OK; |
| 1147 | } |
| 1148 | |
| 1149 | Error GDRESettings::save_project_config(const String &p_out_dir = "") { |
| 1150 | String output_dir = p_out_dir; |
nothing calls this directly
no test coverage detected