Merge pull request #17226 from marcelofg55/osx_export_logic

Modify OSX can_export logic to match the logic from EditorExportPlatformPC::can_export
This commit is contained in:
Rémi Verschelde 2018-03-03 16:20:10 +01:00 committed by GitHub
commit cf0bc13588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 9 deletions

View File

@ -614,21 +614,27 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
bool EditorExportPlatformOSX::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
bool valid = true;
bool valid = false;
String err;
if (!exists_export_template("osx.zip", &err)) {
valid = false;
if (exists_export_template("osx.zip", &err)) {
valid = true;
}
if (p_preset->get("custom_package/debug") != "" && !FileAccess::exists(p_preset->get("custom_package/debug"))) {
valid = false;
err += "Custom debug package not found.\n";
if (p_preset->get("custom_package/debug") != "") {
if (FileAccess::exists(p_preset->get("custom_package/debug"))) {
valid = true;
} else {
err += "Custom debug package not found.\n";
}
}
if (p_preset->get("custom_package/release") != "" && !FileAccess::exists(p_preset->get("custom_package/release"))) {
valid = false;
err += "Custom release package not found.\n";
if (p_preset->get("custom_package/release") != "") {
if (FileAccess::exists(p_preset->get("custom_package/release"))) {
valid = true;
} else {
err += "Custom release package not found.\n";
}
}
if (!err.empty())