Removed ApplyModlistProperties function

This commit is contained in:
Justin Swanson 2019-10-11 22:31:33 -05:00
parent 299ac6a5a9
commit 9c0ace86e2

View File

@ -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<string> Log { get; } = new ObservableCollection<string>();
public ObservableCollection<CPUStatus> Status { get; } = new ObservableCollection<CPUStatus>();
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<NexusMod>().Select(m =>
new Slide(NexusApiUtils.FixupSummary(m.ModName),m.ModID,
NexusApiUtils.FixupSummary(m.Summary), NexusApiUtils.FixupSummary(m.Author),