mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 21:06:58 -05:00
Check if folder exists before letting the user import/export saves
This commit is contained in:
parent
33d36ded28
commit
9650c1d02d
1 changed files with 17 additions and 9 deletions
|
@ -66,7 +66,14 @@ class ImportExportSavesFragment : DialogFragment() {
|
|||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
return MaterialAlertDialogBuilder(requireContext())
|
||||
return if (savesFolderRoot == "") {
|
||||
MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.import_export_saves)
|
||||
.setMessage("No profileID found. Launch a game first and then come back.")
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show()
|
||||
} else {
|
||||
MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle("Import/Export Saves")
|
||||
.setPositiveButton("Export") { _, _ ->
|
||||
exportSave()
|
||||
|
@ -76,6 +83,7 @@ class ImportExportSavesFragment : DialogFragment() {
|
|||
}
|
||||
.show()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Zips the save files located in the given folder path and creates a new zip file with the current date and time.
|
||||
|
|
Loading…
Reference in a new issue