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(); + } } }