diff --git a/CUE4Parse b/CUE4Parse index 8e6e2ce8..ed78044b 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 8e6e2ce8e73b191d3ec4778998368c1ab46ea6cd +Subproject commit ed78044b52621127b353871464af889258de3ef9 diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index fd857ab7..b975a700 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -63,6 +63,7 @@ namespace FModel.ViewModels public SearchViewModel SearchVm { get; } public TabControlViewModel TabControl { get; } public int LocalizedResourcesCount { get; set; } + public int VirtualPathCount { get; set; } public CUE4ParseViewModel(string gameDirectory) { @@ -337,6 +338,27 @@ namespace FModel.ViewModels }); } + public async Task LoadVirtualPaths() + { + if (VirtualPathCount > 0) return; + await _threadWorkerView.Begin(cancellationToken => + { + VirtualPathCount = Provider.LoadVirtualPaths(cancellationToken); +#if DEBUG + if (VirtualPathCount > 0) + { + FLogger.AppendInformation(); + FLogger.AppendText($"{VirtualPathCount} virtual paths loaded!", Constants.WHITE, true); + } + else + { + FLogger.AppendError(); + FLogger.AppendText("Could not load virtual paths, plugin manifest may not exist", Constants.WHITE, true); + } +#endif + }); + } + public void ExtractFolder(CancellationToken cancellationToken, TreeItem folder) { foreach (var asset in folder.AssetsList.Assets) diff --git a/FModel/ViewModels/Commands/LoadCommand.cs b/FModel/ViewModels/Commands/LoadCommand.cs index 86ca6251..cfae5816 100644 --- a/FModel/ViewModels/Commands/LoadCommand.cs +++ b/FModel/ViewModels/Commands/LoadCommand.cs @@ -53,6 +53,7 @@ namespace FModel.ViewModels.Commands MainWindow.YesWeCats.LeftTabControl.SelectedIndex = 1; // folders tab await _applicationView.CUE4Parse.LoadLocalizedResources(); // load locres if not already loaded + await _applicationView.CUE4Parse.LoadVirtualPaths(); // load virtual paths if not already loaded Helper.CloseWindow("Search View"); // close search window if opened await _threadWorkerView.Begin(async cancellationToken =>