Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export conflict #669

Merged
merged 11 commits into from
Apr 19, 2022
7 changes: 6 additions & 1 deletion src/Autoload/Export.gd
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ func export_processed_images(ignore_overwrites: bool, export_dialog: AcceptDialo
# Stop export if directory path or file name are not valid
var dir = Directory.new()
if not dir.dir_exists(directory_path) or not file_name.is_valid_filename():
export_dialog.open_path_validation_alert_popup()
if not dir.dir_exists(directory_path) and file_name.is_valid_filename():
export_dialog.open_path_validation_alert_popup(0)
elif not file_name.is_valid_filename() and dir.dir_exists(directory_path):
export_dialog.open_path_validation_alert_popup(1)
else:
export_dialog.open_path_validation_alert_popup()
return false

# Check export paths
Expand Down
10 changes: 9 additions & 1 deletion src/UI/Dialogs/ExportDialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,15 @@ func create_frame_tag_list() -> void:
spritesheet_frames.add_item(item.name)


func open_path_validation_alert_popup() -> void:
func open_path_validation_alert_popup(path_or_name: int = -1) -> void:
# 0 is invalid path, 1 is invalid name
if path_or_name == 0:
path_validation_alert_popup.dialog_text = "Directory path is not valid!"
elif path_or_name == 1:
path_validation_alert_popup.dialog_text = "File name is not valid!"
else:
path_validation_alert_popup.dialog_text = "Directory path and file name are not valid!"

path_validation_alert_popup.popup_centered()


Expand Down
2 changes: 1 addition & 1 deletion src/UI/Dialogs/ExportDialog.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ size_flags_horizontal = 0
size_flags_vertical = 0
window_title = "Alarm!"
resizable = true
dialog_text = "Directory path or file name is not valid!"
dialog_text = "Directory path and file name are not valid!"
__meta__ = {
"_edit_use_anchors_": false
}
Expand Down