diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a4d677c..eee53bfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ### Changelog +#### Version - 3.0.0.6 - +* Upgrade several dependency libraries +* Provide a better error message when someone attempts to compile before logging into the Nexus (or installing a list) +* Add `Ignore` as another compiler option +* Add button to re-infer compiler settings +* Show `Selected MO2 Profile` in the compiler settings + + #### Version - 3.0.0.5 - 8/22/2022 * No longer rehashes files on every compile (faster Add Roots step during compilation) * Editing paths in the install/compile settings won't crash the app diff --git a/Wabbajack.App.Blazor/Wabbajack.App.Blazor.csproj b/Wabbajack.App.Blazor/Wabbajack.App.Blazor.csproj index 76e1bd7f..c2d73a9d 100644 --- a/Wabbajack.App.Blazor/Wabbajack.App.Blazor.csproj +++ b/Wabbajack.App.Blazor/Wabbajack.App.Blazor.csproj @@ -16,7 +16,7 @@ - + diff --git a/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs b/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs index b0dc1bad..cc4cbed5 100644 --- a/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Compilers/CompilerVM.cs @@ -87,6 +87,7 @@ namespace Wabbajack [Reactive] public RelativePath[] AlwaysEnabled { get; set; } = Array.Empty(); [Reactive] public RelativePath[] NoMatchInclude { get; set; } = Array.Empty(); [Reactive] public RelativePath[] Include { get; set; } = Array.Empty(); + [Reactive] public RelativePath[] Ignore { get; set; } = Array.Empty(); [Reactive] public string[] OtherProfiles { get; set; } = Array.Empty(); @@ -96,6 +97,7 @@ namespace Wabbajack public ReactiveCommand ExecuteCommand { get; } + public ReactiveCommand ReInferSettingsCommand { get; set; } public LogStream LoggerProvider { get; } public ReadOnlyObservableCollection StatusList => _resourceMonitor.Tasks; @@ -129,6 +131,14 @@ namespace Wabbajack SubCompilerVM = new MO2CompilerVM(this); ExecuteCommand = ReactiveCommand.CreateFromTask(async () => await StartCompilation()); + ReInferSettingsCommand = ReactiveCommand.CreateFromTask(async () => await ReInferSettings(), + this.WhenAnyValue(vm => vm.Source) + .ObserveOnGuiThread() + .Select(v => v != default) + .CombineLatest(this.WhenAnyValue(vm => vm.ModListName) + .ObserveOnGuiThread() + .Select(p => !string.IsNullOrWhiteSpace(p))) + .Select(v => v.First && v.Second)); ModlistLocation = new FilePickerVM { @@ -184,6 +194,26 @@ namespace Wabbajack }); } + + + private async Task ReInferSettings() + { + var newSettings = await _inferencer.InferModListFromLocation( + Source.Combine("profiles", SelectedProfile, "modlist.txt")); + + if (newSettings == null) + { + _logger.LogError("Cannot infer settings"); + return; + } + + Include = newSettings.Include; + Ignore = newSettings.Ignore; + AlwaysEnabled = newSettings.AlwaysEnabled; + NoMatchInclude = newSettings.NoMatchInclude; + OtherProfiles = newSettings.AdditionalProfiles; + } + private ErrorResponse Validate() { var errors = new List(); @@ -236,6 +266,7 @@ namespace Wabbajack AlwaysEnabled = settings.AlwaysEnabled; NoMatchInclude = settings.NoMatchInclude; Include = settings.Include; + Ignore = settings.Ignore; } @@ -385,7 +416,8 @@ namespace Wabbajack AlwaysEnabled = AlwaysEnabled, AdditionalProfiles = OtherProfiles, NoMatchInclude = NoMatchInclude, - Include = Include + Include = Include, + Ignore = Ignore }; } @@ -431,6 +463,17 @@ namespace Wabbajack Include = Include.Where(p => p != path).ToArray(); } + + public void AddIgnore(RelativePath path) + { + Ignore = (Ignore ?? Array.Empty()).Append(path).Distinct().ToArray(); + } + + public void RemoveIgnore(RelativePath path) + { + Ignore = Ignore.Where(p => p != path).ToArray(); + } + #endregion } } diff --git a/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml b/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml index 54f675ec..c1fb0b94 100644 --- a/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml +++ b/Wabbajack.App.Wpf/Views/Compilers/CompilerView.xaml @@ -101,6 +101,9 @@ + + + + + + + + + + + + + + +