diff --git a/CUE4Parse b/CUE4Parse index 2c550160..80c90735 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 2c550160f238380d0ce5712450f92adad0d044fc +Subproject commit 80c9073527c1588c9d28159e8672c94a96ec510b diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 16950b14..9b468d16 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -116,7 +116,8 @@ public class CUE4ParseViewModel : ViewModel public SearchViewModel SearchVm { get; } public TabControlViewModel TabControl { get; } public ConfigIni IoStoreOnDemand { get; } - public WwiseProvider WwiseProvider { get; set; } + private Lazy _wwiseProviderLazy; + public WwiseProvider WwiseProvider => _wwiseProviderLazy.Value; public CUE4ParseViewModel() { @@ -264,7 +265,8 @@ public class CUE4ParseViewModel : ViewModel } } - Provider.Initialize(); + Provider.Initialize(); + _wwiseProviderLazy = new Lazy(() => new WwiseProvider(Provider)); Log.Information($"{Provider.Versions.Game} ({Provider.Versions.Platform}) | Archives: x{Provider.UnloadedVfs.Count} | AES: x{Provider.RequiredKeys.Count} | Loose Files: x{Provider.Files.Count}"); }); } @@ -843,9 +845,7 @@ public class CUE4ParseViewModel : ViewModel } case UAkAudioEvent when isNone && pointer.Object.Value is UAkAudioEvent audioEvent: { - WwiseProvider ??= new WwiseProvider(Provider, audioEvent); - - var extractedSounds = WwiseProvider.ExtractAudioEventSounds(audioEvent, UserSettings.Default.AudioDirectory); + var extractedSounds = WwiseProvider.ExtractAudioEventSounds(audioEvent); foreach (var sound in extractedSounds) { SaveAndPlaySound(sound.OutputPath, sound.Extension, sound.Data);