summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorne0fhyk <fhuyakou@gmail.com>2021-10-11 08:02:03 -0700
committerne0fhyk <fhuyakou@gmail.com>2021-10-11 08:24:21 -0700
commit431ccdb057b3b712372bcea49b28273d469e0d97 (patch)
tree0e79d2e0ea5d0bd87d2b00aedd9f5df9f911b69f /platform
parent91e681fe193a583095557aaeb2ae09b1ffcba7fb (diff)
Pass the correct `export_format` argument to locate the assets directory when exporting.
Diffstat (limited to 'platform')
-rw-r--r--platform/android/export/export_plugin.cpp7
-rw-r--r--platform/android/export/export_plugin.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index 60ba1c558a..727ce0ae46 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -429,9 +429,8 @@ String EditorExportPlatformAndroid::get_package_name(const String &p_package) co
return pname;
}
-String EditorExportPlatformAndroid::get_assets_directory(const Ref<EditorExportPreset> &p_preset) const {
- int export_format = int(p_preset->get("custom_template/export_format"));
- return export_format == EXPORT_FORMAT_AAB ? AAB_ASSETS_DIRECTORY : APK_ASSETS_DIRECTORY;
+String EditorExportPlatformAndroid::get_assets_directory(const Ref<EditorExportPreset> &p_preset, int p_export_format) const {
+ return p_export_format == EXPORT_FORMAT_AAB ? AAB_ASSETS_DIRECTORY : APK_ASSETS_DIRECTORY;
}
bool EditorExportPlatformAndroid::is_package_name_valid(const String &p_package, String *r_error) const {
@@ -2477,7 +2476,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
return ERR_UNCONFIGURED;
}
}
- const String assets_directory = get_assets_directory(p_preset);
+ const String assets_directory = get_assets_directory(p_preset, export_format);
String sdk_path = EDITOR_GET("export/android/android_sdk_path");
ERR_FAIL_COND_V_MSG(sdk_path.is_empty(), ERR_UNCONFIGURED, "Android SDK path must be configured in Editor Settings at 'export/android/android_sdk_path'.");
print_verbose("Android sdk path: " + sdk_path);
diff --git a/platform/android/export/export_plugin.h b/platform/android/export/export_plugin.h
index d33f616f11..e0ffaa718b 100644
--- a/platform/android/export/export_plugin.h
+++ b/platform/android/export/export_plugin.h
@@ -104,7 +104,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
String get_package_name(const String &p_package) const;
- String get_assets_directory(const Ref<EditorExportPreset> &p_preset) const;
+ String get_assets_directory(const Ref<EditorExportPreset> &p_preset, int p_export_format) const;
bool is_package_name_valid(const String &p_package, String *r_error = nullptr) const;