diff --git a/CUE4Parse b/CUE4Parse index 56074f41..566bc1f7 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 56074f412a45b24b0595c76ef383f13fa94572be +Subproject commit 566bc1f731b993a09b50772fef8de4d9d5e36243 diff --git a/FModel/Enums.cs b/FModel/Enums.cs index 1412b013..59700533 100644 --- a/FModel/Enums.cs +++ b/FModel/Enums.cs @@ -60,7 +60,9 @@ public enum ELoadingMode [Description("All (New)")] AllButNew, [Description("All (Modified)")] - AllButModified + AllButModified, + [Description("All (Except Patched Assets)")] + AllButPatched, } // public enum EUpdateMode diff --git a/FModel/ViewModels/Commands/LoadCommand.cs b/FModel/ViewModels/Commands/LoadCommand.cs index 0a2683bb..4a4ea0b6 100644 --- a/FModel/ViewModels/Commands/LoadCommand.cs +++ b/FModel/ViewModels/Commands/LoadCommand.cs @@ -87,6 +87,11 @@ public class LoadCommand : ViewModelCommand FilterNewOrModifiedFilesToDisplay(cancellationToken); break; } + case ELoadingMode.AllButPatched: + { + FilterPacthedFilesToDisplay(cancellationToken); + break; + } default: throw new ArgumentOutOfRangeException(); } @@ -273,4 +278,26 @@ public class LoadCommand : ViewModelCommand entries.Add(asset); } + + private void FilterPacthedFilesToDisplay(CancellationToken cancellationToken) + { + var loaded = new Dictionary(_applicationView.CUE4Parse.Provider.PathComparer); + + foreach (var (key, asset) in _applicationView.CUE4Parse.Provider.Files) + { + cancellationToken.ThrowIfCancellationRequested(); // cancel if needed + if (asset.IsUePackagePayload) continue; + + if (asset is VfsEntry entry && loaded.TryGetValue(key, out var file) && + file is VfsEntry existingEntry && entry.Vfs.ReadOrder < existingEntry.Vfs.ReadOrder) + { + continue; + } + + loaded[key] = asset; + } + + _applicationView.Status.UpdateStatusLabel($"{loaded.Count:### ### ###} Packages"); + _applicationView.CUE4Parse.AssetsFolder.BulkPopulate(loaded.Values); + } }