diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-10-29 12:08:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-29 12:08:50 +0100 |
commit | 69ccccaf719d488d3a5d3417265f8d822d0c970e (patch) | |
tree | 5ad68045b5f71a1667722244e6d442daea818afe | |
parent | 7f95ec0ead7fad25b6f4c857a7ac9085d49c91af (diff) | |
parent | 9814446ea040160b1943236a7f9de087b7324df5 (diff) |
Merge pull request #23322 from marcelofg55/export_path
Save last export path when exporting
-rw-r--r-- | editor/editor_export.cpp | 14 | ||||
-rw-r--r-- | editor/editor_export.h | 4 | ||||
-rw-r--r-- | editor/project_export.cpp | 15 |
3 files changed, 28 insertions, 5 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 1a6188862f..218063566a 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -144,6 +144,17 @@ String EditorExportPreset::get_include_filter() const { return include_filter; } +void EditorExportPreset::set_export_path(const String &p_path) { + + export_path = p_path; + EditorExport::singleton->save_presets(); +} + +String EditorExportPreset::get_export_path() const { + + return export_path; +} + void EditorExportPreset::set_exclude_filter(const String &p_exclude) { exclude_filter = p_exclude; @@ -213,6 +224,7 @@ String EditorExportPreset::get_custom_features() const { EditorExportPreset::EditorExportPreset() { + export_path = ""; export_filter = EXPORT_ALL_RESOURCES; runnable = false; } @@ -1034,6 +1046,7 @@ void EditorExport::_save() { } config->set_value(section, "include_filter", preset->get_include_filter()); config->set_value(section, "exclude_filter", preset->get_exclude_filter()); + config->set_value(section, "export_path", preset->get_export_path()); config->set_value(section, "patch_list", preset->get_patches()); String option_section = "preset." + itos(i) + ".options"; @@ -1189,6 +1202,7 @@ void EditorExport::load_config() { preset->set_include_filter(config->get_value(section, "include_filter")); preset->set_exclude_filter(config->get_value(section, "exclude_filter")); + preset->set_export_path(config->get_value(section, "export_path", "")); Vector<String> patch_list = config->get_value(section, "patch_list"); diff --git a/editor/editor_export.h b/editor/editor_export.h index b4ee5b89e7..d1165fd042 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -57,6 +57,7 @@ private: ExportFilter export_filter; String include_filter; String exclude_filter; + String export_path; String exporter; Set<String> selected_files; @@ -114,6 +115,9 @@ public: void set_custom_features(const String &p_custom_features); String get_custom_features() const; + void set_export_path(const String &p_path); + String get_export_path() const; + const List<PropertyInfo> &get_properties() const { return properties; } EditorExportPreset(); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index adb150d52d..d2dccdb425 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -804,12 +804,16 @@ void ProjectExportDialog::_export_project() { export_project->set_access(FileDialog::ACCESS_FILESYSTEM); export_project->clear_filters(); - 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 (current->get_export_path() != "") { + export_project->set_current_path(current->get_export_path()); } else { - export_project->set_current_file(default_filename); + 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); + } else { + export_project->set_current_file(default_filename); + } } // Ensure that signal is connected if previous attempt left it disconnected with _validate_export_path @@ -831,6 +835,7 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) { ERR_FAIL_COND(current.is_null()); Ref<EditorExportPlatform> platform = current->get_platform(); ERR_FAIL_COND(platform.is_null()); + current->set_export_path(p_path); Error err = platform->export_project(current, export_debug->is_pressed(), p_path, 0); if (err != OK) { |