Neverness to Everness and Terminull Brigade support
Some checks failed
FModel QA Builder / build (push) Has been cancelled

Add new loading mode that skips patched assets
This commit is contained in:
LongerWarrior
2025-07-03 17:27:32 +03:00
parent 03a4f79c3a
commit 394bcf356f
3 changed files with 31 additions and 2 deletions

View File

@@ -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

View File

@@ -87,6 +87,11 @@ public class LoadCommand : ViewModelCommand<LoadingModesViewModel>
FilterNewOrModifiedFilesToDisplay(cancellationToken);
break;
}
case ELoadingMode.AllButPatched:
{
FilterPacthedFilesToDisplay(cancellationToken);
break;
}
default: throw new ArgumentOutOfRangeException();
}
@@ -273,4 +278,26 @@ public class LoadCommand : ViewModelCommand<LoadingModesViewModel>
entries.Add(asset);
}
private void FilterPacthedFilesToDisplay(CancellationToken cancellationToken)
{
var loaded = new Dictionary<string, GameFile>(_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);
}
}