summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-12-16 13:05:18 +0100
committerGitHub <noreply@github.com>2017-12-16 13:05:18 +0100
commita68d15d509721587c1a38a34a861a0f7ce754eb2 (patch)
treed5d819b37c444e7533c887f066c2f74478fd3c45 /editor
parenta9ddc8f7cfa8c2e0a685a9bba3dcd8bc8feae3ab (diff)
parentf89d78a7a474612ec715e5c5da150f97dd716057 (diff)
Merge pull request #14597 from NathanWarden/linux_extensions
Updated Linux template extensions to match architecture.
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_export.cpp18
-rw-r--r--editor/editor_export.h8
-rw-r--r--editor/project_export.cpp4
3 files changed, 21 insertions, 9 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index b330f5d177..3585417d13 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -1288,8 +1288,18 @@ bool EditorExportPlatformPC::can_export(const Ref<EditorExportPreset> &p_preset,
return valid;
}
-String EditorExportPlatformPC::get_binary_extension() const {
- return extension;
+String EditorExportPlatformPC::get_binary_extension(const Ref<EditorExportPreset> &p_preset) const {
+ for (Map<String, String>::Element *E = extensions.front(); E; E = E->next()) {
+ if (p_preset->get(E->key())) {
+ return extensions[E->key()];
+ }
+ }
+
+ if (extensions.has("default")) {
+ return extensions["default"];
+ }
+
+ return "";
}
Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
@@ -1337,8 +1347,8 @@ Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_pr
return save_pack(p_preset, pck_path);
}
-void EditorExportPlatformPC::set_extension(const String &p_extension) {
- extension = p_extension;
+void EditorExportPlatformPC::set_extension(const String &p_extension, const String &p_feature_key) {
+ extensions[p_feature_key] = p_extension;
}
void EditorExportPlatformPC::set_name(const String &p_name) {
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 8b1cf4bcff..02b15aff10 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -240,7 +240,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 = 0;
+ virtual String get_binary_extension(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 void get_platform_features(List<String> *r_features) = 0;
@@ -363,7 +363,7 @@ class EditorExportPlatformPC : public EditorExportPlatform {
Ref<ImageTexture> logo;
String name;
String os_name;
- String extension;
+ Map<String, String> extensions;
String release_file_32;
String release_file_64;
@@ -385,10 +385,10 @@ 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;
+ virtual String get_binary_extension(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);
+ void set_extension(const String &p_extension, const String &p_feature_key = "default");
void set_name(const String &p_name);
void set_os_name(const String &p_name);
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 767dbcc27b..3c31b70564 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -718,7 +718,9 @@ void ProjectExportDialog::_export_project() {
export_project->set_access(FileDialog::ACCESS_FILESYSTEM);
export_project->clear_filters();
export_project->set_current_file(default_filename);
- String extension = platform->get_binary_extension();
+
+ String extension = platform->get_binary_extension(current);
+
if (extension != String()) {
export_project->add_filter("*." + extension + " ; " + platform->get_name() + " Export");
}