aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/editor_import_export.cpp
diff options
context:
space:
mode:
authorblackwc2015-07-22 12:51:17 -0400
committerblackwc2015-07-22 12:51:17 -0400
commit31fa1bb8bd6b6ed3c9e8ebcae78d50482ccd9538 (patch)
tree9b5a6b10ee56a6ca638a7ad67cb9d2d30738382c /tools/editor/editor_import_export.cpp
parentf697ec2fe022583dde5f3ae650f49cfd7f237c33 (diff)
downloadgodot-31fa1bb8bd6b6ed3c9e8ebcae78d50482ccd9538.tar.gz
godot-31fa1bb8bd6b6ed3c9e8ebcae78d50482ccd9538.tar.zst
godot-31fa1bb8bd6b6ed3c9e8ebcae78d50482ccd9538.zip
Improve export validation
Diffstat (limited to 'tools/editor/editor_import_export.cpp')
-rw-r--r--tools/editor/editor_import_export.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp
index 4e6435b22..bd5e87c3d 100644
--- a/tools/editor/editor_import_export.cpp
+++ b/tools/editor/editor_import_export.cpp
@@ -1119,30 +1119,42 @@ bool EditorExportPlatformPC::can_export(String *r_error) const {
String exe_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/";
- if (!FileAccess::exists(exe_path+debug_binary32) || !FileAccess::exists(exe_path+release_binary32)) {
+ if (use64 && (!FileAccess::exists(exe_path+debug_binary64) || !FileAccess::exists(exe_path+release_binary64))) {
valid=false;
- err="No 32 bits export templates found.\nDownload and install export templates.\n";
+ err="No 64 bits export templates found.\nDownload and install export templates.\n";
}
- if (!FileAccess::exists(exe_path+debug_binary64) || !FileAccess::exists(exe_path+release_binary64)) {
+
+ if (!use64 && (!FileAccess::exists(exe_path+debug_binary32) || !FileAccess::exists(exe_path+release_binary32))) {
valid=false;
- err="No 64 bits export templates found.\nDownload and install export templates.\n";
+ err="No 32 bits export templates found.\nDownload and install export templates.\n";
+ }
+
+ if(custom_debug_binary=="" && custom_release_binary=="") {
+ if (r_error) *r_error=err;
+ return valid;
}
+ bool dvalid = true;
+ bool rvalid = true;
- if (custom_debug_binary!="" && !FileAccess::exists(custom_debug_binary)) {
- valid=false;
- err+="Custom debug binary not found.\n";
+ if(!FileAccess::exists(custom_debug_binary)) {
+ dvalid = false;
+ err = "Custom debug binary not found.\n";
}
- if (custom_release_binary!="" && !FileAccess::exists(custom_release_binary)) {
- valid=false;
- err+="Custom release binary not found.\n";
+ if(!FileAccess::exists(custom_release_binary)) {
+ rvalid = false;
+ err = "Custom release binary not found.\n";
}
+ if (dvalid || rvalid)
+ valid = true;
+ else
+ valid = false;
+
if (r_error)
*r_error=err;
return valid;
-
}