diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/export/editor_export_platform.cpp | 36 | ||||
-rw-r--r-- | editor/export/editor_export_platform.h | 7 | ||||
-rw-r--r-- | editor/export/project_export.cpp | 3 |
3 files changed, 21 insertions, 25 deletions
diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index 34b407779e..b4d3973705 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -429,24 +429,21 @@ void EditorExportPlatform::_edit_filter_list(HashSet<String> &r_list, const Stri _edit_files_with_filter(da, filters, r_list, exclude); } -EditorExportPlatform::FeatureContainers EditorExportPlatform::get_feature_containers(const Ref<EditorExportPreset> &p_preset, bool p_debug) const { +HashSet<String> EditorExportPlatform::get_features(const Ref<EditorExportPreset> &p_preset, bool p_debug) const { Ref<EditorExportPlatform> platform = p_preset->get_platform(); List<String> feature_list; platform->get_platform_features(&feature_list); platform->get_preset_features(p_preset, &feature_list); - FeatureContainers result; + HashSet<String> result; for (const String &E : feature_list) { - result.features.insert(E); - result.features_pv.push_back(E); + result.insert(E); } if (p_debug) { - result.features.insert("debug"); - result.features_pv.push_back("debug"); + result.insert("debug"); } else { - result.features.insert("release"); - result.features_pv.push_back("release"); + result.insert("release"); } if (!p_preset->get_custom_features().is_empty()) { @@ -455,8 +452,7 @@ EditorExportPlatform::FeatureContainers EditorExportPlatform::get_feature_contai for (int i = 0; i < tmp_custom_list.size(); i++) { String f = tmp_custom_list[i].strip_edges(); if (!f.is_empty()) { - result.features.insert(f); - result.features_pv.push_back(f); + result.insert(f); } } } @@ -465,14 +461,18 @@ EditorExportPlatform::FeatureContainers EditorExportPlatform::get_feature_contai } EditorExportPlatform::ExportNotifier::ExportNotifier(EditorExportPlatform &p_platform, const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) { - FeatureContainers features = p_platform.get_feature_containers(p_preset, p_debug); + HashSet<String> features = p_platform.get_features(p_preset, p_debug); Vector<Ref<EditorExportPlugin>> export_plugins = EditorExport::get_singleton()->get_export_plugins(); //initial export plugin callback for (int i = 0; i < export_plugins.size(); i++) { if (export_plugins[i]->get_script_instance()) { //script based - export_plugins.write[i]->_export_begin_script(features.features_pv, p_debug, p_path, p_flags); + PackedStringArray features_psa; + for (const String &feature : features) { + features_psa.push_back(feature); + } + export_plugins.write[i]->_export_begin_script(features_psa, p_debug, p_path, p_flags); } else { - export_plugins.write[i]->_export_begin(features.features, p_debug, p_path, p_flags); + export_plugins.write[i]->_export_begin(features, p_debug, p_path, p_flags); } } } @@ -621,9 +621,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & export_plugins.write[i]->_clear(); } - FeatureContainers feature_containers = get_feature_containers(p_preset, p_debug); - HashSet<String> &features = feature_containers.features; - Vector<String> &features_pv = feature_containers.features_pv; + HashSet<String> features = get_features(p_preset, p_debug); //store everything in the export medium int idx = 0; @@ -709,7 +707,11 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & bool do_export = true; for (int i = 0; i < export_plugins.size(); i++) { if (export_plugins[i]->get_script_instance()) { //script based - export_plugins.write[i]->_export_file_script(path, type, features_pv); + PackedStringArray features_psa; + for (const String &feature : features) { + features_psa.push_back(feature); + } + export_plugins.write[i]->_export_file_script(path, type, features_psa); } else { export_plugins.write[i]->_export_file(path, type, features); } diff --git a/editor/export/editor_export_platform.h b/editor/export/editor_export_platform.h index 832a0cf846..ad1bcc1996 100644 --- a/editor/export/editor_export_platform.h +++ b/editor/export/editor_export_platform.h @@ -85,11 +85,6 @@ private: EditorProgress *ep = nullptr; }; - struct FeatureContainers { - HashSet<String> features; - Vector<String> features_pv; - }; - Vector<ExportMessage> messages; void _export_find_resources(EditorFileSystemDirectory *p_dir, HashSet<String> &p_paths); @@ -110,7 +105,7 @@ protected: ~ExportNotifier(); }; - FeatureContainers get_feature_containers(const Ref<EditorExportPreset> &p_preset, bool p_debug) const; + HashSet<String> get_features(const Ref<EditorExportPreset> &p_preset, bool p_debug) const; bool exists_export_template(String template_file_name, String *err) const; String find_export_template(String template_file_name, String *err = nullptr) const; diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index cb82cefbbb..76493d330f 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -219,6 +219,7 @@ void ProjectExportDialog::_edit_preset(int p_index) { export_path->show(); duplicate_preset->set_disabled(false); delete_preset->set_disabled(false); + get_ok_button()->set_disabled(false); name->set_text(current->get_name()); List<String> extension_list = current->get_platform()->get_binary_extensions(current); @@ -265,7 +266,6 @@ void ProjectExportDialog::_edit_preset(int p_index) { export_warning->hide(); export_button->set_disabled(true); - get_ok_button()->set_disabled(true); } else { if (error != String()) { Vector<String> items = error.split("\n", false); @@ -285,7 +285,6 @@ void ProjectExportDialog::_edit_preset(int p_index) { export_error->hide(); export_templates_error->hide(); export_button->set_disabled(false); - get_ok_button()->set_disabled(false); } custom_features->set_text(current->get_custom_features()); |