2019-10-07 12:02:31 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2019-10-07 12:13:53 +00:00
|
|
|
|
using System.ComponentModel;
|
2019-10-07 12:02:31 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
|
|
|
|
|
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-07 12:40:19 +00:00
|
|
|
|
var bannerImage = UIUtils.BitmapImageFromResource("Wabbajack.banner.png");
|
|
|
|
|
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");
|
|
|
|
|
if(file != null)
|
|
|
|
|
{
|
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
|
|
|
|
BitmapImage splashScreen = null;
|
|
|
|
|
if (newBannerFile != null)
|
|
|
|
|
{
|
|
|
|
|
splashScreen = new BitmapImage(new Uri(newBannerFile));
|
|
|
|
|
}
|
|
|
|
|
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 14:57:13 +00:00
|
|
|
|
state.newImagePath = newBannerFile;
|
2019-10-07 13:48:40 +00:00
|
|
|
|
state.SplashScreenImage = splashScreen;
|
|
|
|
|
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-07 12:02:31 +00:00
|
|
|
|
}
|
|
|
|
|
}
|