From f0caf246b5cae6a7b94aabfc75a2e66bc2e6ec76 Mon Sep 17 00:00:00 2001 From: iAmAsval Date: Wed, 22 Dec 2021 18:21:57 +0100 Subject: [PATCH] just getting rid of some output folders --- FModel/App.xaml.cs | 5 +---- FModel/ViewModels/AudioPlayerViewModel.cs | 4 ++-- FModel/ViewModels/CUE4ParseViewModel.cs | 2 +- FModel/ViewModels/TabControlViewModel.cs | 8 ++++---- FModel/Views/AudioPlayer.xaml.cs | 8 ++++---- FModel/Views/MapViewer.xaml.cs | 8 ++++---- FModel/Views/SearchView.xaml.cs | 4 ++-- 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/FModel/App.xaml.cs b/FModel/App.xaml.cs index b10a118f..c66b1fc3 100644 --- a/FModel/App.xaml.cs +++ b/FModel/App.xaml.cs @@ -46,14 +46,11 @@ namespace FModel if (!Directory.Exists(UserSettings.Default.OutputDirectory)) UserSettings.Default.OutputDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Output"); if (!Directory.Exists(UserSettings.Default.ModelDirectory)) - UserSettings.Default.ModelDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Saves"); + UserSettings.Default.ModelDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Exports"); Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FModel")); Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, "Backups")); Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, "Exports")); - Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, "Saves")); - Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, "Textures")); - Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, "Sounds")); Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, "Logs")); Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, ".data")); diff --git a/FModel/ViewModels/AudioPlayerViewModel.cs b/FModel/ViewModels/AudioPlayerViewModel.cs index 7d0c7ce6..7b7d8b71 100644 --- a/FModel/ViewModels/AudioPlayerViewModel.cs +++ b/FModel/ViewModels/AudioPlayerViewModel.cs @@ -307,7 +307,7 @@ namespace FModel.ViewModels { Title = "Save Audio", FileName = fileToSave.FileName, - InitialDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Sounds") + InitialDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Exports") }; if (!(bool) saveFileDialog.ShowDialog()) return; path = saveFileDialog.FileName; @@ -580,4 +580,4 @@ namespace FModel.ViewModels return vgmProcess?.ExitCode == 0 && File.Exists(wavFilePath); } } -} \ No newline at end of file +} diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index e7946573..0be1e452 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -730,7 +730,7 @@ namespace FModel.ViewModels private void SaveAndPlaySound(string fullPath, string ext, byte[] data) { - var userDir = Path.Combine(UserSettings.Default.OutputDirectory, "Sounds"); + var userDir = Path.Combine(UserSettings.Default.OutputDirectory, "Exports"); if (fullPath.StartsWith("/")) fullPath = fullPath[1..]; var savedAudioPath = Path.Combine(userDir, UserSettings.Default.KeepDirectoryStructure ? fullPath : fullPath.SubstringAfterLast('/')).Replace('\\', '/') + $".{ext.ToLower()}"; diff --git a/FModel/ViewModels/TabControlViewModel.cs b/FModel/ViewModels/TabControlViewModel.cs index cda2e627..77a8ac6c 100644 --- a/FModel/ViewModels/TabControlViewModel.cs +++ b/FModel/ViewModels/TabControlViewModel.cs @@ -187,7 +187,7 @@ namespace FModel.ViewModels public void SaveProperty(bool autoSave) { var fileName = Path.ChangeExtension(Header, ".json"); - var directory = Path.Combine(UserSettings.Default.OutputDirectory, "Saves", + var directory = Path.Combine(UserSettings.Default.OutputDirectory, "Exports", UserSettings.Default.KeepDirectoryStructure ? Directory : "", fileName).Replace('\\', '/'); if (!autoSave) @@ -196,7 +196,7 @@ namespace FModel.ViewModels { Title = "Save Property", FileName = fileName, - InitialDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Saves"), + InitialDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Exports"), Filter = "JSON Files (*.json)|*.json|INI Files (*.ini)|*.ini|XML Files (*.xml)|*.xml|All Files (*.*)|*.*" }; var result = saveFileDialog.ShowDialog(); @@ -236,7 +236,7 @@ namespace FModel.ViewModels { if (!HasImage) return; var fileName = Path.ChangeExtension(Header, ".png"); - var directory = Path.Combine(UserSettings.Default.OutputDirectory, "Textures", + var directory = Path.Combine(UserSettings.Default.OutputDirectory, "Exports", UserSettings.Default.KeepDirectoryStructure ? Directory : "", fileName!).Replace('\\', '/'); if (!autoSave) @@ -245,7 +245,7 @@ namespace FModel.ViewModels { Title = "Save Texture", FileName = fileName, - InitialDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Textures"), + InitialDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Exports"), Filter = "PNG Files (*.png)|*.png|All Files (*.*)|*.*" }; var result = saveFileDialog.ShowDialog(); diff --git a/FModel/Views/AudioPlayer.xaml.cs b/FModel/Views/AudioPlayer.xaml.cs index 739a59a7..290c0b07 100644 --- a/FModel/Views/AudioPlayer.xaml.cs +++ b/FModel/Views/AudioPlayer.xaml.cs @@ -53,13 +53,13 @@ namespace FModel.Views { if (e.OriginalSource is TextBox) return; - + if (UserSettings.Default.AddAudio.IsTriggered(e.Key)) { var openFileDialog = new OpenFileDialog { Title = "Select an audio file", - InitialDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Sounds"), + InitialDirectory = Path.Combine(UserSettings.Default.OutputDirectory, "Exports"), Filter = "OGG Files (*.ogg)|*.ogg|WAV Files (*.wav)|*.wav|WEM Files (*.wem)|*.wem|ADPCM Files (*.adpcm)|*.adpcm|All Files (*.*)|*.*", Multiselect = true }; @@ -82,7 +82,7 @@ namespace FModel.Views { _applicationView.AudioPlayer.PlayPauseOnForce(); } - + private void OnFilterTextChanged(object sender, TextChangedEventArgs e) { if (sender is not TextBox textBox) @@ -95,4 +95,4 @@ namespace FModel.Views }; } } -} \ No newline at end of file +} diff --git a/FModel/Views/MapViewer.xaml.cs b/FModel/Views/MapViewer.xaml.cs index 80f888e4..de81a677 100644 --- a/FModel/Views/MapViewer.xaml.cs +++ b/FModel/Views/MapViewer.xaml.cs @@ -30,7 +30,7 @@ namespace FModel.Views private void OnClick(object sender, RoutedEventArgs e) { if (_applicationView.MapViewer.MapImage == null) return; - var path = Path.Combine(UserSettings.Default.OutputDirectory, "Textures", "MiniMap.png"); + var path = Path.Combine(UserSettings.Default.OutputDirectory, "Exports", "MiniMap.png"); var saveFileDialog = new SaveFileDialog { @@ -61,7 +61,7 @@ namespace FModel.Views FLogger.AppendText("Could not save 'MiniMap.png'", Constants.WHITE, true); } } - + private void OnSelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) { var i = 0; @@ -72,10 +72,10 @@ namespace FModel.Views i++; continue; } - + _applicationView.MapViewer.MapIndex = i; break; } } } -} \ No newline at end of file +} diff --git a/FModel/Views/SearchView.xaml.cs b/FModel/Views/SearchView.xaml.cs index 89fb8b8c..a367536d 100644 --- a/FModel/Views/SearchView.xaml.cs +++ b/FModel/Views/SearchView.xaml.cs @@ -11,6 +11,7 @@ namespace FModel.Views { public partial class SearchView { + private ThreadWorkerViewModel _threadWorkerView => ApplicationService.ThreadWorkerView; private ApplicationViewModel _applicationView => ApplicationService.ApplicationView; public SearchView() @@ -57,8 +58,7 @@ namespace FModel.Views return; WindowState = WindowState.Minimized; - await ApplicationService.ThreadWorkerView.Begin(_ => - _applicationView.CUE4Parse.Extract(assetItem.FullPath, true)); + await _threadWorkerView.Begin(_ => _applicationView.CUE4Parse.Extract(assetItem.FullPath, true)); MainWindow.YesWeCats.Activate(); }