2019-10-07 12:02:31 +00:00
|
|
|
|
using System;
|
2019-10-07 12:13:53 +00:00
|
|
|
|
using System.ComponentModel;
|
2019-10-07 12:02:31 +00:00
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for ModlistPropertiesWindow.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class ModlistPropertiesWindow : Window
|
|
|
|
|
{
|
2019-10-07 13:36:06 +00:00
|
|
|
|
internal string newBannerFile;
|
|
|
|
|
internal readonly AppState state;
|
|
|
|
|
internal ModlistPropertiesWindow(AppState _state)
|
2019-10-07 12:02:31 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2019-10-09 09:33:23 +00:00
|
|
|
|
var bannerImage = UIUtils.BitmapImageFromResource("Wabbajack.UI.banner.png");
|
2019-10-07 12:40:19 +00:00
|
|
|
|
SplashScreenProperty.Source = bannerImage;
|
2019-10-07 13:36:06 +00:00
|
|
|
|
|
|
|
|
|
newBannerFile = null;
|
|
|
|
|
state = _state;
|
2019-10-07 12:02:31 +00:00
|
|
|
|
}
|
2019-10-07 12:13:53 +00:00
|
|
|
|
|
|
|
|
|
private void Window_Closing(object sender, CancelEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//Hide();
|
|
|
|
|
}
|
2019-10-07 12:40:19 +00:00
|
|
|
|
|
|
|
|
|
private void SetSplashScreen_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var file = UIUtils.OpenFileDialog("Banner image|*.png");
|
2019-10-07 17:33:34 +00:00
|
|
|
|
if (file != null)
|
2019-10-07 12:40:19 +00:00
|
|
|
|
{
|
2019-10-07 13:36:06 +00:00
|
|
|
|
newBannerFile = file;
|
2019-10-07 12:40:19 +00:00
|
|
|
|
SplashScreenProperty.Source = new BitmapImage(new Uri(file));
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-10-07 13:36:06 +00:00
|
|
|
|
|
|
|
|
|
private void SaveProperties_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2019-10-07 13:48:40 +00:00
|
|
|
|
if (state.UIReady)
|
2019-10-07 13:36:06 +00:00
|
|
|
|
{
|
2019-10-07 13:48:40 +00:00
|
|
|
|
if (newBannerFile != null)
|
|
|
|
|
{
|
2019-10-07 17:16:27 +00:00
|
|
|
|
BitmapImage splashScreen = new BitmapImage(new Uri(newBannerFile));
|
2019-10-07 16:01:24 +00:00
|
|
|
|
state.newImagePath = newBannerFile;
|
|
|
|
|
state.SplashScreenImage = splashScreen;
|
2019-10-07 13:48:40 +00:00
|
|
|
|
}
|
|
|
|
|
string modListName = ModlistNameProperty.Text;
|
|
|
|
|
string modListAuthor = ModlistAuthorProperty.Text;
|
|
|
|
|
string modListDescription = ModlistDescriptionProperty.Text;
|
2019-10-07 14:44:28 +00:00
|
|
|
|
string modListWebsite = ModlistWebsiteProperty.Text;
|
2019-10-07 13:36:06 +00:00
|
|
|
|
|
2019-10-07 13:48:40 +00:00
|
|
|
|
state.SplashScreenModName = modListName;
|
|
|
|
|
state.SplashScreenSummary = modListDescription;
|
|
|
|
|
state.SplashScreenAuthorName = modListAuthor;
|
2019-10-07 14:44:28 +00:00
|
|
|
|
state._nexusSiteURL = modListWebsite;
|
|
|
|
|
|
|
|
|
|
state.ChangedProperties = true;
|
2019-10-07 13:36:06 +00:00
|
|
|
|
|
2019-10-07 13:48:40 +00:00
|
|
|
|
Hide();
|
|
|
|
|
}
|
2019-10-07 13:36:06 +00:00
|
|
|
|
}
|
2019-10-09 09:45:23 +00:00
|
|
|
|
|
|
|
|
|
public bool IsClosed { get; private set; }
|
|
|
|
|
protected override void OnClosed(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnClosed(e);
|
|
|
|
|
IsClosed = true;
|
|
|
|
|
}
|
2019-10-07 12:02:31 +00:00
|
|
|
|
}
|
|
|
|
|
}
|