Compiler window will change state after clicking save

This commit is contained in:
erri120 2019-10-07 15:36:06 +02:00
parent b7a2279a3a
commit b85d27bb38
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -20,11 +20,16 @@ namespace Wabbajack
/// </summary>
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();
}
}
}