wabbajack/Wabbajack/UI/ModeSelectionWindow.xaml.cs

76 lines
2.5 KiB
C#
Raw Normal View History

2019-10-07 17:33:34 +00:00
using System.ComponentModel;
2019-09-27 11:51:37 +00:00
using System.Diagnostics;
2019-10-07 17:33:34 +00:00
using System.Windows;
2019-09-27 04:07:54 +00:00
using System.Windows.Input;
using Wabbajack.Common;
2019-09-27 04:07:54 +00:00
using static Wabbajack.MainWindow;
namespace Wabbajack
{
/// <summary>
/// Interaction logic for ModeSelectionWindow.xaml
/// </summary>
public partial class ModeSelectionWindow : Window
{
public ModeSelectionWindow()
{
InitializeComponent();
var bannerImage = UIUtils.BitmapImageFromResource("Wabbajack.UI.banner_small.png");
2019-09-27 11:51:37 +00:00
Banner.Source = bannerImage;
var patreonIcon = UIUtils.BitmapImageFromResource("Wabbajack.UI.Icons.patreon_light.png");
2019-09-27 11:51:37 +00:00
Patreon.Source = patreonIcon;
var githubIcon = UIUtils.BitmapImageFromResource("Wabbajack.UI.Icons.github_light.png");
2019-09-27 11:51:37 +00:00
GitHub.Source = githubIcon;
var discordIcon = UIUtils.BitmapImageFromResource("Wabbajack.UI.Icons.discord.png");
2019-09-27 11:51:37 +00:00
Discord.Source = discordIcon;
2019-09-27 04:07:54 +00:00
}
private void CreateModlist_Click(object sender, RoutedEventArgs e)
{
var file = UIUtils.OpenFileDialog("MO2 Modlist(modlist.txt)|modlist.txt");
if (file != null)
{
ShutdownOnClose = false;
new MainWindow(RunMode.Compile, file).Show();
Close();
}
}
private void InstallModlist_Click(object sender, RoutedEventArgs e)
{
var file = UIUtils.OpenFileDialog($"Wabbajack Modlist (*{Consts.ModlistExtension})|*{Consts.ModlistExtension}");
2019-09-27 04:07:54 +00:00
if (file != null)
{
ShutdownOnClose = false;
new MainWindow(RunMode.Install, file).Show();
Close();
}
}
public void Close_Window(object sender, CancelEventArgs e)
{
if (ShutdownOnClose)
Application.Current.Shutdown();
}
public bool ShutdownOnClose { get; set; } = true;
2019-09-27 11:51:37 +00:00
private void GitHub_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
2019-10-01 03:04:21 +00:00
Process.Start("https://github.com/wabbajack-tools/wabbajack");
2019-09-27 11:51:37 +00:00
}
private void Patreon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Process.Start("https://www.patreon.com/user?u=11907933");
}
private void Discord_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Process.Start("https://discord.gg/zgbrkmA");
}
2019-09-27 04:07:54 +00:00
}
}