mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	Check if folder exists before letting the user import/export saves
This commit is contained in:
		@@ -66,15 +66,23 @@ class ImportExportSavesFragment : DialogFragment() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
 | 
			
		||||
        return MaterialAlertDialogBuilder(requireContext())
 | 
			
		||||
            .setTitle("Import/Export Saves")
 | 
			
		||||
            .setPositiveButton("Export") { _, _ ->
 | 
			
		||||
                exportSave()
 | 
			
		||||
            }
 | 
			
		||||
            .setNeutralButton("Import") { _, _ ->
 | 
			
		||||
                documentPicker.launch(arrayOf("application/zip"))
 | 
			
		||||
            }
 | 
			
		||||
            .show()
 | 
			
		||||
        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()
 | 
			
		||||
                }
 | 
			
		||||
                .setNeutralButton("Import") { _, _ ->
 | 
			
		||||
                    documentPicker.launch(arrayOf("application/zip"))
 | 
			
		||||
                }
 | 
			
		||||
                .show()
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user