diff --git a/CUE4Parse b/CUE4Parse index 5655c30f..80140f6d 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 5655c30f180a50bd07dc0282daace6b6edc9ea72 +Subproject commit 80140f6d70b42d904687c2afca1abb8ea1ddb1f2 diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 17cd9345..589f10e4 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -523,7 +523,15 @@ private void BulkFolder(CancellationToken cancellationToken, TreeItem folder, Ac } public void ExportFolder(CancellationToken cancellationToken, TreeItem folder) - => BulkFolder(cancellationToken, folder, asset => ExportData(asset.FullPath)); + { + Parallel.ForEach(folder.AssetsList.Assets, asset => + { + cancellationToken.ThrowIfCancellationRequested(); + ExportData(asset.FullPath, false); + }); + + foreach (var f in folder.Folders) ExportFolder(cancellationToken, f); + } public void ExtractFolder(CancellationToken cancellationToken, TreeItem folder) => BulkFolder(cancellationToken, folder, asset => Extract(cancellationToken, asset.FullPath, TabControl.HasNoTabs)); @@ -899,23 +907,27 @@ private void SaveExport(UObject export, bool auto) } } - public void ExportData(string fullPath) + public void ExportData(string fullPath, bool updateUi = true) { var fileName = fullPath.SubstringAfterLast('/'); if (Provider.TrySavePackage(fullPath, out var assets)) { - foreach (var kvp in assets) + Parallel.ForEach(assets, kvp => { var path = Path.Combine(UserSettings.Default.RawDataDirectory, UserSettings.Default.KeepDirectoryStructure ? kvp.Key : kvp.Key.SubstringAfterLast('/')).Replace('\\', '/'); Directory.CreateDirectory(path.SubstringBeforeLast('/')); File.WriteAllBytes(path, kvp.Value); - } + }); - Log.Information("{FileName} successfully exported", fileName); - FLogger.AppendInformation(); - FLogger.AppendText($"Successfully exported '{fileName}'", Constants.WHITE, true); + if (updateUi) + { + Log.Information("{FileName} successfully exported", fileName); + FLogger.AppendInformation(); + FLogger.AppendText($"Successfully exported '{fileName}'", Constants.WHITE, true); + } + else ApplicationService.ApplicationView.Status.UpdateStatusLabel($"Raw Data for {fullPath.SubstringAfterLast('/')}"); } - else + else if (updateUi) { Log.Error("{FileName} could not be exported", fileName); FLogger.AppendError();