1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

Refactor the export checking logic to improve separation of concerns

This commit is contained in:
Fredia Huya-Kouadio
2022-07-17 10:22:54 -04:00
parent 1806e414b8
commit d2213f76a9
9 changed files with 120 additions and 21 deletions

View File

@@ -1656,7 +1656,7 @@ Ref<Texture> EditorExportPlatformPC::get_logo() const {
return logo;
}
bool EditorExportPlatformPC::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
bool EditorExportPlatformPC::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
String err;
bool valid = false;
@@ -1688,6 +1688,28 @@ bool EditorExportPlatformPC::can_export(const Ref<EditorExportPreset> &p_preset,
return valid;
}
bool EditorExportPlatformPC::has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
return true;
}
bool EditorExportPlatform::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
String templates_error;
bool valid_export_configuration = has_valid_export_configuration(p_preset, templates_error, r_missing_templates);
String project_configuration_error;
bool valid_project_configuration = has_valid_project_configuration(p_preset, project_configuration_error);
if (!templates_error.empty()) {
r_error += templates_error;
}
if (!project_configuration_error.empty()) {
r_error += project_configuration_error;
}
return valid_export_configuration && valid_project_configuration;
}
List<String> EditorExportPlatformPC::get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const {
List<String> list;
for (Map<String, String>::Element *E = extensions.front(); E; E = E->next()) {