Skip to content

Commit

Permalink
Prompt the user to create a new folder if the export folder does not …
Browse files Browse the repository at this point in the history
…exist in Hitsound Studio.
  • Loading branch information
OliBomby committed Jul 11, 2023
1 parent 71b0a77 commit 663e99d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Mapping_Tools/Views/HitsoundStudio/HitsoundStudioView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,24 @@ private async void Start_Click(object sender, RoutedEventArgs e) {
MessageBox.Show("Please select a base beatmap first.");
return;
}

if (!Directory.Exists(settings.ExportFolder))
{
var folderResult = MessageBox.Show(
$"Folder at path \"{settings.ExportFolder}\" does not exist.\nCreate a new folder?",
"Export path not found.", MessageBoxButton.YesNo, MessageBoxImage.Warning);

if (folderResult == MessageBoxResult.Yes) {
try {
Directory.CreateDirectory(settings.ExportFolder);
} catch (Exception ex) {
ex.Show();
return;
}
} else {
return;
}
}

// Remove logical focus to trigger LostFocus on any fields that didn't yet update the ViewModel
FocusManager.SetFocusedElement(FocusManager.GetFocusScope(this), null);
Expand Down

0 comments on commit 663e99d

Please sign in to comment.