summaryrefslogtreecommitdiff
path: root/editor/project_export.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/project_export.cpp')
-rw-r--r--editor/project_export.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index cc110f309c..c78a81dbe0 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -88,14 +88,7 @@ void ProjectExportDialog::popup_export() {
if (saved_size != Rect2()) {
popup(saved_size);
} else {
-
- Size2 popup_size = Size2(900, 700) * editor_get_scale();
- Size2 window_size = get_viewport_rect().size;
-
- popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
- popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
-
- popup_centered(popup_size);
+ popup_centered_clamped(Size2(900, 700) * EDSCALE, 0.8);
}
}
@@ -173,7 +166,7 @@ void ProjectExportDialog::_update_presets() {
void ProjectExportDialog::_update_export_all() {
- bool can_export = EditorExport::get_singleton()->get_export_preset_count() > 0 ? true : false;
+ bool can_export = EditorExport::get_singleton()->get_export_preset_count() > 0;
for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) {
Ref<EditorExportPreset> preset = EditorExport::get_singleton()->get_export_preset(i);
@@ -938,8 +931,17 @@ void ProjectExportDialog::_export_project() {
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());
+ String current_preset_export_path = current->get_export_path();
+
+ if (current_preset_export_path != "") {
+
+ if (!DirAccess::exists(current_preset_export_path.get_base_dir())) {
+
+ DirAccessRef da(DirAccess::create(DirAccess::ACCESS_FILESYSTEM));
+ da->make_dir_recursive(current_preset_export_path.get_base_dir());
+ }
+
+ export_project->set_current_path(current_preset_export_path);
} else {
if (extension_list.size() >= 1) {
export_project->set_current_file(default_filename + "." + extension_list[0]);
@@ -993,7 +995,7 @@ void ProjectExportDialog::_export_all_dialog_action(const String &p_str) {
export_all_dialog->hide();
- _export_all(p_str == "release" ? false : true);
+ _export_all(p_str != "release");
}
void ProjectExportDialog::_export_all(bool p_debug) {