public override async void Execute(LoadingModesViewModel contextViewModel, object parameter) { if (_applicationView.CUE4Parse.GameDirectory.HasNoFile) { return; } if (_applicationView.CUE4Parse.Game == FGame.FortniteGame && _applicationView.CUE4Parse.Provider.MappingsContainer == null) { FLogger.AppendError(); FLogger.AppendText("Mappings could not get pulled, extracting assets might not work properly. If so, press F12 or please restart.", Constants.WHITE, true); } #if DEBUG var loadingTime = Stopwatch.StartNew(); #endif _applicationView.CUE4Parse.AssetsFolder.Folders.Clear(); _applicationView.CUE4Parse.SearchVm.SearchResults.Clear(); MainWindow.YesWeCats.LeftTabControl.SelectedIndex = 1; // folders tab await _applicationView.CUE4Parse.LoadLocalizedResources(); // load locres if not already loaded Helper.CloseWindow <AdonisWindow>("Search View"); // close search window if opened await _threadWorkerView.Begin(async cancellationToken => { // filter what to show switch (UserSettings.Default.LoadingMode) { case ELoadingMode.Single: case ELoadingMode.Multiple: { var l = (IList)parameter; if (l.Count < 1) { return; } var directoryFilesToShow = l.Cast <FileItem>(); FilterDirectoryFilesToDisplay(cancellationToken, directoryFilesToShow); break; } case ELoadingMode.All: { FilterDirectoryFilesToDisplay(cancellationToken, null); break; } case ELoadingMode.AllButNew: case ELoadingMode.AllButModified: { await FilterNewOrModifiedFilesToDisplay(cancellationToken).ConfigureAwait(false); break; } default: throw new ArgumentOutOfRangeException(); } _discordHandler.UpdatePresence(_applicationView.CUE4Parse); }); #if DEBUG loadingTime.Stop(); FLogger.AppendDebug(); FLogger.AppendText($"{_applicationView.CUE4Parse.SearchVm.SearchResults.Count} packages and a lot of localized resources loaded in {loadingTime.Elapsed.TotalSeconds.ToString("F3", CultureInfo.InvariantCulture)} seconds", Constants.WHITE, true); #endif }