mirror of
https://github.com/4sval/FModel.git
synced 2026-04-15 14:06:42 -05:00
Neverness to Everness and Terminull Brigade support
Some checks failed
FModel QA Builder / build (push) Has been cancelled
Some checks failed
FModel QA Builder / build (push) Has been cancelled
Add new loading mode that skips patched assets
This commit is contained in:
parent
03a4f79c3a
commit
394bcf356f
|
|
@ -1 +1 @@
|
|||
Subproject commit 56074f412a45b24b0595c76ef383f13fa94572be
|
||||
Subproject commit 566bc1f731b993a09b50772fef8de4d9d5e36243
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user