Virtual path stuff

This commit is contained in:
GMatrixGames 2021-08-15 17:42:48 -04:00
parent 80c9a27e10
commit 3947a4a5d8
No known key found for this signature in database
GPG Key ID: 2621164AAF16CEDF
3 changed files with 24 additions and 1 deletions

@ -1 +1 @@
Subproject commit 8e6e2ce8e73b191d3ec4778998368c1ab46ea6cd
Subproject commit ed78044b52621127b353871464af889258de3ef9

View File

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

View File

@ -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<AdonisWindow>("Search View"); // close search window if opened
await _threadWorkerView.Begin(async cancellationToken =>