From b85d27bb383321897ffc5306a4cb1cb8b5d15c0d Mon Sep 17 00:00:00 2001 From: erri120 Date: Mon, 7 Oct 2019 15:36:06 +0200 Subject: [PATCH] Compiler window will change state after clicking save --- Wabbajack/ModlistPropertiesWindow.xaml.cs | 27 ++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Wabbajack/ModlistPropertiesWindow.xaml.cs b/Wabbajack/ModlistPropertiesWindow.xaml.cs index 4f754c23..c45b64da 100644 --- a/Wabbajack/ModlistPropertiesWindow.xaml.cs +++ b/Wabbajack/ModlistPropertiesWindow.xaml.cs @@ -20,11 +20,16 @@ namespace Wabbajack /// public partial class ModlistPropertiesWindow : Window { - public ModlistPropertiesWindow() + internal string newBannerFile; + internal readonly AppState state; + internal ModlistPropertiesWindow(AppState _state) { InitializeComponent(); var bannerImage = UIUtils.BitmapImageFromResource("Wabbajack.banner.png"); SplashScreenProperty.Source = bannerImage; + + newBannerFile = null; + state = _state; } private void Window_Closing(object sender, CancelEventArgs e) @@ -37,8 +42,28 @@ namespace Wabbajack var file = UIUtils.OpenFileDialog("Banner image|*.png"); if(file != null) { + newBannerFile = file; SplashScreenProperty.Source = new BitmapImage(new Uri(file)); } } + + private void SaveProperties_Click(object sender, RoutedEventArgs e) + { + BitmapImage splashScreen = null; + if (newBannerFile != null) + { + splashScreen = new BitmapImage(new Uri(newBannerFile)); + } + string modListName = ModlistNameProperty.Text; + string modListAuthor = ModlistAuthorProperty.Text; + string modListDescription = ModlistDescriptionProperty.Text; + + state.SplashScreenImage = splashScreen; + state.SplashScreenModName = modListName; + state.SplashScreenSummary = modListDescription; + state.SplashScreenAuthorName = modListAuthor; + + Hide(); + } } }