From 2f5b789d11bc52099fc54085906dce1070a3e0a2 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Sun, 13 Oct 2019 17:08:50 -0500 Subject: [PATCH] Removed "SplashScreen" naming prefix --- Wabbajack/AppState.cs | 9 ++-- Wabbajack/UI/ModlistPropertiesWindow.xaml.cs | 8 ++-- Wabbajack/UI/SlideShow.cs | 50 ++++++++++---------- Wabbajack/UI/SlideshowView.xaml | 14 +++--- 4 files changed, 38 insertions(+), 43 deletions(-) diff --git a/Wabbajack/AppState.cs b/Wabbajack/AppState.cs index 96e1b679..13eb063c 100644 --- a/Wabbajack/AppState.cs +++ b/Wabbajack/AppState.cs @@ -237,9 +237,6 @@ namespace Wabbajack } } - private bool _splashShowNSFW = false; - public bool SplashShowNSFW { get => _splashShowNSFW; set => this.RaiseAndSetIfChanged(ref _splashShowNSFW, value); } - public string Error => "Error"; public string this[string columnName] => Validate(columnName); @@ -367,9 +364,9 @@ namespace Wabbajack var compiler = new Compiler(_mo2Folder) { MO2Profile = ModListName, - ModListName = ChangedProperties ? this.Slideshow.SplashScreenModName : null, - ModListAuthor = ChangedProperties ? this.Slideshow.SplashScreenAuthorName : null, - ModListDescription = ChangedProperties ? this.Slideshow.SplashScreenSummary : null, + ModListName = ChangedProperties ? this.Slideshow.ModName : null, + ModListAuthor = ChangedProperties ? this.Slideshow.AuthorName : null, + ModListDescription = ChangedProperties ? this.Slideshow.Summary : null, ModListImage = ChangedProperties ? newImagePath : null, ModListWebsite = ChangedProperties ? _nexusSiteURL : null, ModListReadme = ChangedProperties ? readmePath : null diff --git a/Wabbajack/UI/ModlistPropertiesWindow.xaml.cs b/Wabbajack/UI/ModlistPropertiesWindow.xaml.cs index 2663f405..bf827fef 100644 --- a/Wabbajack/UI/ModlistPropertiesWindow.xaml.cs +++ b/Wabbajack/UI/ModlistPropertiesWindow.xaml.cs @@ -45,12 +45,12 @@ namespace Wabbajack { BitmapImage splashScreen = new BitmapImage(new Uri(newBannerFile)); state.newImagePath = newBannerFile; - state.Slideshow.SplashScreenImage = splashScreen; + state.Slideshow.Image = splashScreen; } - state.Slideshow.SplashScreenModName = ModlistNameProperty.Text; - state.Slideshow.SplashScreenSummary = ModlistDescriptionProperty.Text; - state.Slideshow.SplashScreenAuthorName = ModlistAuthorProperty.Text; + state.Slideshow.ModName = ModlistNameProperty.Text; + state.Slideshow.Summary = ModlistDescriptionProperty.Text; + state.Slideshow.AuthorName = ModlistAuthorProperty.Text; state._nexusSiteURL = ModlistWebsiteProperty.Text; state.readmePath = ModlistReadmeProperty.Text; diff --git a/Wabbajack/UI/SlideShow.cs b/Wabbajack/UI/SlideShow.cs index e901893d..3d67ba47 100644 --- a/Wabbajack/UI/SlideShow.cs +++ b/Wabbajack/UI/SlideShow.cs @@ -63,20 +63,20 @@ namespace Wabbajack private bool _GCAfterUpdating = true; public bool GCAfterUpdating { get => _GCAfterUpdating; set => this.RaiseAndSetIfChanged(ref _GCAfterUpdating, value); } - private bool _EnableSlideShow = true; - public bool EnableSlideShow { get => _EnableSlideShow; set => this.RaiseAndSetIfChanged(ref _EnableSlideShow, value); } + private bool _Enable = true; + public bool Enable { get => _Enable; set => this.RaiseAndSetIfChanged(ref _Enable, value); } - private BitmapImage _SplashScreenImage; - public BitmapImage SplashScreenImage { get => _SplashScreenImage; set => this.RaiseAndSetIfChanged(ref _SplashScreenImage, value); } + private BitmapImage _Image; + public BitmapImage Image { get => _Image; set => this.RaiseAndSetIfChanged(ref _Image, value); } - private string _SplashScreenModName = "Wabbajack"; - public string SplashScreenModName { get => _SplashScreenModName; set => this.RaiseAndSetIfChanged(ref _SplashScreenModName, value); } + private string _ModName = "Wabbajack"; + public string ModName { get => _ModName; set => this.RaiseAndSetIfChanged(ref _ModName, value); } - private string _SplashScreenAuthorName = "Halgari & the Wabbajack Team"; - public string SplashScreenAuthorName { get => _SplashScreenAuthorName; set => this.RaiseAndSetIfChanged(ref _SplashScreenAuthorName, value); } + private string _AuthorName = "Halgari & the Wabbajack Team"; + public string AuthorName { get => _AuthorName; set => this.RaiseAndSetIfChanged(ref _AuthorName, value); } - private string _SplashScreenSummary; - public string SplashScreenSummary { get => _SplashScreenSummary; set => this.RaiseAndSetIfChanged(ref _SplashScreenSummary, value); } + private string _Summary; + public string Summary { get => _Summary; set => this.RaiseAndSetIfChanged(ref _Summary, value); } public IReactiveCommand SlideShowNextItemCommand { get; } = ReactiveCommand.Create(() => { }); @@ -93,23 +93,23 @@ namespace Wabbajack .NotNull() .Subscribe(modList => { - this.SplashScreenModName = modList.Name; - this.SplashScreenAuthorName = modList.Author; - this.SplashScreenSummary = modList.Description; + this.ModName = modList.Name; + this.AuthorName = modList.Author; + this.Summary = modList.Description; }) .DisposeWith(this.CompositeDisposable); // Update splashscreen when modlist changes Observable.CombineLatest( - this.WhenAny(x => x.AppState.ModList), - this.WhenAny(x => x.AppState.ModListPath), - this.WhenAny(x => x.EnableSlideShow), - (modList, modListPath, enableSlideShow) => (modList, modListPath, enableSlideShow)) + (this).WhenAny(x => x.AppState.ModList), + (this).WhenAny(x => x.AppState.ModListPath), + (this).WhenAny(x => x.Enable), + (modList, modListPath, enabled) => (modList, modListPath, enabled)) // Do any potential unzipping on a background thread .ObserveOn(RxApp.TaskpoolScheduler) .Select(u => { - if (u.enableSlideShow + if (u.enabled && u.modList != null && u.modListPath != null && File.Exists(u.modListPath) @@ -144,7 +144,7 @@ namespace Wabbajack }) .ObserveOn(RxApp.MainThreadScheduler) .StartWith(this.WabbajackLogo) - .Subscribe(bitmap => this.SplashScreenImage = bitmap) + .Subscribe(bitmap => this.Image = bitmap) .DisposeWith(this.CompositeDisposable); /// Wire slideshow updates @@ -159,7 +159,7 @@ namespace Wabbajack // Only subscribe to slideshow triggers if enabled and installing .FilterSwitch( Observable.CombineLatest( - this.WhenAny(x => x.EnableSlideShow), + this.WhenAny(x => x.Enable), this.WhenAny(x => x.AppState.Installing), resultSelector: (enabled, installing) => enabled && installing)) // Don't ever update more than once every half second. ToDo: Update to debounce @@ -205,16 +205,16 @@ namespace Wabbajack if (!slide.IsNSFW || (slide.IsNSFW && ShowNSFW)) { - this.SplashScreenImage = AppState._noneImage; + this.Image = AppState._noneImage; if (slide.ImageURL != null && slide.Image != null) { if (!CachedSlides.ContainsKey(slide.ModID)) return; - this.SplashScreenImage = slide.Image; + this.Image = slide.Image; } - this.SplashScreenModName = slide.ModName; - this.SplashScreenAuthorName = slide.ModAuthor; - this.SplashScreenSummary = slide.ModDescription; + this.ModName = slide.ModName; + this.AuthorName = slide.ModAuthor; + this.Summary = slide.ModDescription; AppState._nexusSiteURL = slide.ModURL; } diff --git a/Wabbajack/UI/SlideshowView.xaml b/Wabbajack/UI/SlideshowView.xaml index 984690f6..63e10376 100644 --- a/Wabbajack/UI/SlideshowView.xaml +++ b/Wabbajack/UI/SlideshowView.xaml @@ -24,7 +24,7 @@