public static void CheckDrive() { IoController.DiskCheck(CommonVariables.SaveLocation); if (!CommonVariables.IsDriveReady) { MessageBox.Show("The storage drive that stores the save files isn't ready.", "Drive not ready", MessageBoxButton.OK, MessageBoxImage.Warning); } if (CommonVariables.PermissionError) { MessageBox.Show( "The game can't write on the save folder. Please check the folder permissions.", "Permission Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); } if (CommonVariables.SpaceError) { MessageBox.Show("The game needs at least 1MB of free space. Please free up some space from this machine, so you can save your progress and settings.", "Not enough space", MessageBoxButton.OK, MessageBoxImage.Warning); } }
private void ImportButton_Click(object sender, RoutedEventArgs e) { var importdlg = new Microsoft.Win32.OpenFileDialog { DefaultExt = "GameSave*.isgsf", Filter = "Immortal Sins GameSave File|GameSave*.isgsf|Immortal Sins Save Archive v2|*.isarc2", Title = "Select the files/archive to import.", Multiselect = true }; var importresult = importdlg.ShowDialog(); if (importresult != true) { return; } try { if (Path.GetExtension(importdlg.SafeFileName) == ".isarc2") { if (!Directory.Exists(CommonVariables.SaveLocation)) { Directory.CreateDirectory(CommonVariables.SaveLocation); } IoController.ArchiveCodec(true, importdlg.FileName, CommonVariables.SaveLocation); } else { CommonProcedures.ImportCode(importdlg.FileNames, ChangeSaveSlotCheckbox.IsEnabled, SlotSelector.Value); } CommonVariables.IsSaveAvailable = CommonProcedures.GetFolderSaves(); MessageBox.Show(Resources.ImportSavesComplete, Resources.CommonWordsFinish, MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception) { MessageBox.Show(Resources.ImportSavesFailedString, Resources.CommonWordsError, MessageBoxButtons.OK, MessageBoxIcon.Information); } }