From 9c0ace86e227634083df51401d7f1d44b7161d60 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Fri, 11 Oct 2019 22:31:33 -0500 Subject: [PATCH] Removed ApplyModlistProperties function --- Wabbajack/AppState.cs | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Wabbajack/AppState.cs b/Wabbajack/AppState.cs index 04244b51..3c86268f 100644 --- a/Wabbajack/AppState.cs +++ b/Wabbajack/AppState.cs @@ -44,6 +44,12 @@ namespace Wabbajack private string _ModListPath; public string ModListPath { get => _ModListPath; private set => this.RaiseAndSetIfChanged(ref _ModListPath, value); } + private TaskMode _Mode; + public TaskMode Mode { get => _Mode; private set => this.RaiseAndSetIfChanged(ref _Mode, value); } + + private string _ModListName; + public string ModListName { get => _ModListName; set => this.RaiseAndSetIfChanged(ref _ModListName, value); } + private bool _EnableSlideShow = true; public bool EnableSlideShow { get => _EnableSlideShow; set => this.RaiseAndSetIfChanged(ref _EnableSlideShow, value); } @@ -84,6 +90,18 @@ namespace Wabbajack canExecute: this.WhenAny(x => x.ModList) .Select(modList => !string.IsNullOrEmpty(modList?.Readme))); + // Apply modlist properties when it changes + this.WhenAny(x => x.ModList) + .NotNull() + .Subscribe(modList => + { + this.SplashScreenModName = modList.Name; + this.SplashScreenAuthorName = modList.Author; + this._nexusSiteURL = modList.Website; + this.SplashScreenSummary = modList.Description; + }) + .DisposeWith(this.CompositeDisposable); + _slideShow = new SlideShow(this, true); this.SlideShowNextItemCommand = ReactiveCommand.Create(_slideShow.UpdateSlideShowItem); @@ -154,12 +172,6 @@ namespace Wabbajack public ObservableCollection Log { get; } = new ObservableCollection(); public ObservableCollection Status { get; } = new ObservableCollection(); - private TaskMode _Mode; - public TaskMode Mode { get => _Mode; set => this.RaiseAndSetIfChanged(ref _Mode, value); } - - private string _ModListName; - public string ModListName { get => _ModListName; set => this.RaiseAndSetIfChanged(ref _ModListName, value); } - private string _Location; public string Location { get => _Location; set => this.RaiseAndSetIfChanged(ref _Location, value); } @@ -363,13 +375,6 @@ namespace Wabbajack } public bool Running { get; set; } = true; - private void ApplyModlistProperties() - { - SplashScreenModName = this.ModList.Name; - SplashScreenAuthorName = this.ModList.Author; - _nexusSiteURL = this.ModList.Website; - SplashScreenSummary = this.ModList.Description; - } public void LogMsg(string msg) { @@ -421,8 +426,6 @@ namespace Wabbajack HTMLReport = this.ModList.ReportHTML; Location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - ApplyModlistProperties(); - _slideShow.SlideShowElements = modlist.Archives.OfType().Select(m => new Slide(NexusApiUtils.FixupSummary(m.ModName),m.ModID, NexusApiUtils.FixupSummary(m.Summary), NexusApiUtils.FixupSummary(m.Author),