Пример #1
0
        public async Task FindMissingAssets(CancellationToken token)
        {
            IsWorking = true;

            var missingAssets = await Task.Run(async() =>
            {
                var finder = new Finder(SelectedDataPath);

                await finder.BuildBSACacheAsync();
                await finder.BuildLooseFileCacheAsync();

                SelectedPlugins.Do(s =>
                {
                    finder.FindMissingAssets(s);
                });

                return(finder.MissingAssets);
            }, token);

            missingAssets.Sort((first, second) => (int)first.Record.FormKey.ID - (int)second.Record.FormKey.ID);
            MissingAssets = missingAssets;

            IsWorking = false;

            /*missingAssets.Do(a =>
             * {
             *  Utils.Log($"{a.Record.FormKey} is missing {a.Files.Aggregate((x,y) => $"{x},{y}")}");
             * });*/
        }
Пример #2
0
        public async void TestFinder()
        {
            var dataFolder = "N:\\SteamLibrary\\steamapps\\common\\Skyrim Special Edition\\Data";

            var finder = new Finder(dataFolder);

            await finder.BuildBSACacheAsync();

            await finder.BuildLooseFileCacheAsync();

            finder.FindMissingAssets("N:\\SteamLibrary\\steamapps\\common\\Skyrim Special Edition\\Data\\Judgment Wenches.esp");
        }
Пример #3
0
        public async Task FindMissingAssets(CancellationToken token)
        {
            IsWorking = true;
            try
            {
                var missingAssets = await Task.Run(async() =>
                {
                    using var finder = new Finder(SelectedDataPath);

                    await finder.BuildBSACacheAsync();
                    await finder.BuildLooseFileCacheAsync();

                    if (UseLoadOrder)
                    {
                        finder.FindMissingAssets(UseLoadOrder);
                    }
                    else
                    {
                        SelectedPlugins.Do(s => { finder.FindMissingAssets(s); });
                    }

                    return(finder.MissingAssets);
                }, token);

                if (!UseLoadOrder)
                {
                    missingAssets.Sort((first, second) =>
                                       new Finder.FormKeyComparer().Compare(first.Record.FormKey, second.Record.FormKey));
                }
                MissingAssets = missingAssets;
            }
            catch (Exception e)
            {
                Utils.Log($"Exception: {e}");
            }
            finally
            {
                IsWorking = false;
            }
        }