summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2018-10-29 18:18:49 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2018-11-01 10:08:26 -0300
commitd51999f11d7f6c1b30310a08cde7b12666e673ac (patch)
tree40d186e0623366287b7377df609f6346b5b11c4d /editor
parent4761c6bb7bbaacd20583be502901a8ab834a8718 (diff)
Export for OS X on OS X now lets you select .dmg or .zip
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_export.cpp11
-rw-r--r--editor/editor_export.h4
-rw-r--r--editor/project_export.cpp11
3 files changed, 16 insertions, 10 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 218063566a..209a006a06 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -1351,18 +1351,21 @@ bool EditorExportPlatformPC::can_export(const Ref<EditorExportPreset> &p_preset,
return valid;
}
-String EditorExportPlatformPC::get_binary_extension(const Ref<EditorExportPreset> &p_preset) const {
+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()) {
if (p_preset->get(E->key())) {
- return extensions[E->key()];
+ list.push_back(extensions[E->key()]);
+ return list;
}
}
if (extensions.has("default")) {
- return extensions["default"];
+ list.push_back(extensions["default"]);
+ return list;
}
- return "";
+ return list;
}
Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
diff --git a/editor/editor_export.h b/editor/editor_export.h
index d1165fd042..380b33cd17 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -245,7 +245,7 @@ public:
virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const = 0;
- virtual String get_binary_extension(const Ref<EditorExportPreset> &p_preset) const = 0;
+ virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const = 0;
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) = 0;
virtual Error export_pack(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
virtual Error export_zip(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
@@ -392,7 +392,7 @@ public:
virtual Ref<Texture> get_logo() const;
virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const;
- virtual String get_binary_extension(const Ref<EditorExportPreset> &p_preset) const;
+ virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const;
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
void set_extension(const String &p_extension, const String &p_feature_key = "default");
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index d2dccdb425..a297f2d47e 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -804,13 +804,16 @@ void ProjectExportDialog::_export_project() {
export_project->set_access(FileDialog::ACCESS_FILESYSTEM);
export_project->clear_filters();
+ List<String> extension_list = platform->get_binary_extensions(current);
+ for (int i = 0; i < extension_list.size(); i++) {
+ export_project->add_filter("*." + extension_list[i] + " ; " + platform->get_name() + " Export");
+ }
+
if (current->get_export_path() != "") {
export_project->set_current_path(current->get_export_path());
} else {
- String extension = platform->get_binary_extension(current);
- if (extension != String()) {
- export_project->add_filter("*." + extension + " ; " + platform->get_name() + " Export");
- export_project->set_current_file(default_filename + "." + extension);
+ if (extension_list.size() >= 1) {
+ export_project->set_current_file(default_filename + "." + extension_list[0]);
} else {
export_project->set_current_file(default_filename);
}