X Tutup
Skip to content

Commit 6c387ea

Browse files
When exporting, do not ask for overwrite file confirmation twice
1 parent b88bdc5 commit 6c387ea

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/Autoload/Export.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var export_json := false
5353
var split_layers := false
5454
var trim_images := false
5555
var erase_unselected_area := false
56+
var overwrite_asked := false
5657

5758
# Spritesheet options
5859
var orientation := Orientation.COLUMNS
@@ -393,7 +394,7 @@ func export_processed_images(
393394
if is_single_file_format(project) or OS.get_name() == "Android":
394395
break
395396

396-
if not paths_of_existing_files.is_empty(): # If files already exist
397+
if not paths_of_existing_files.is_empty() and not overwrite_asked: # If files already exist
397398
# Ask user if they want to overwrite the files
398399
export_dialog.open_file_exists_alert_popup(tr(file_exists_alert) % paths_of_existing_files)
399400
# Stops the function until the user decides if they want to overwrite

src/UI/Dialogs/ExportDialog.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ func _on_about_to_popup() -> void:
300300
path_line_edit.text = project.export_directory_path.path_join(project.file_name) + file_ext
301301
path_dialog_popup.current_dir = project.export_directory_path
302302
Export.cache_blended_frames()
303+
Export.overwrite_asked = false
303304
show_tab()
304305

305306
# Set the size of the preview checker
@@ -388,12 +389,14 @@ func _on_path_line_edit_text_changed(new_text: String) -> void:
388389
var show_quality := file_format == Export.FileFormat.JPEG
389390
%QualityLabel.visible = show_quality
390391
%Quality.visible = show_quality
392+
Export.overwrite_asked = false
391393
set_preview()
392394

393395

394396
func _on_path_dialog_file_selected(path: String) -> void:
395397
path_line_edit.text = path
396398
_on_path_line_edit_text_changed(path)
399+
Export.overwrite_asked = true
397400
# Needed because if native file dialogs are enabled
398401
# the export dialog closes when the path dialog closes
399402
if not visible:

src/UI/Dialogs/ExportDialog.tscn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ size = Vector2i(675, 500)
331331
always_on_top = true
332332
ok_button_text = "Select Current Folder"
333333
access = 2
334-
overwrite_warning_enabled = false
335334

336335
[node name="PathValidationAlert" type="AcceptDialog" parent="." unique_id=355024950]
337336
always_on_top = true

0 commit comments

Comments
 (0)
X Tutup