summaryrefslogtreecommitdiffstats
path: root/platform/osx/export/export.cpp
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-11-30 01:26:51 +0100
committerest31 <MTest31@outlook.com>2015-11-30 01:36:08 +0100
commit15f6d3cebf9e8c9288132454816f1152e16dde36 (patch)
tree21ebe9b3a928e682f195e66cc171f3c05efacd3a /platform/osx/export/export.cpp
parent5e0419012a00631aac200739680b04446285eb14 (diff)
downloadredot-engine-15f6d3cebf9e8c9288132454816f1152e16dde36.tar.gz
Add way to look for templates at system wide level too
Useful for everybody wanting to package godot. Fixes #1026. -> Retain the old behaviour: path in error msg only when exporting. -> User templates override system templates
Diffstat (limited to 'platform/osx/export/export.cpp')
-rw-r--r--platform/osx/export/export.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index 79ee91bc61..0bece6ec76 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -251,15 +251,19 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug
EditorProgress ep("export","Exporting for OSX",104);
- String pkg_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/osx.zip";
-
- if (p_debug) {
-
- src_pkg=custom_debug_package!=""?custom_debug_package:pkg_path;
- } else {
-
- src_pkg=custom_release_package!=""?custom_release_package:pkg_path;
+ if (p_debug)
+ src_pkg=custom_debug_package;
+ else
+ src_pkg=custom_release_package;
+
+ if (src_pkg=="") {
+ String err;
+ src_pkg=find_export_template("osx.zip", &err);
+ if (src_pkg=="") {
+ EditorNode::add_io_error(err);
+ return ERR_FILE_NOT_FOUND;
+ }
}
@@ -464,9 +468,8 @@ bool EditorExportPlatformOSX::can_export(String *r_error) const {
bool valid=true;
String err;
- String exe_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/";
- if (!FileAccess::exists(exe_path+"osx.zip")) {
+ if (!exists_export_template("osx.zip")) {
valid=false;
err+="No export templates found.\nDownload and install export templates.\n";
}