VRCMelonAssistant/ModAssistant/Pages/Intro.xaml.cs

58 lines
1.8 KiB
C#
Raw Normal View History

2020-02-26 22:27:39 +13:00
using System;
2019-04-22 18:41:43 +12:00
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
namespace ModAssistant.Pages
{
/// <summary>
/// Interaction logic for Intro.xaml
/// </summary>
public partial class Intro : Page
{
public static Intro Instance = new Intro();
public Intro()
{
InitializeComponent();
}
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
private void Disagree_Click(object sender, RoutedEventArgs e)
{
2019-05-05 12:50:59 +12:00
MainWindow.Instance.ModsButton.IsEnabled = false;
Properties.Settings.Default.Agreed = false;
Properties.Settings.Default.Save();
2020-02-02 19:27:37 +13:00
MessageBox.Show((string)FindResource("Intro:ClosingApp"));
2019-04-22 18:41:43 +12:00
System.Windows.Application.Current.Shutdown();
}
private void Agree_Click(object sender, RoutedEventArgs e)
{
2020-02-02 21:42:15 +13:00
if (string.IsNullOrEmpty(MainWindow.GameVersion))
2019-05-19 03:32:14 +12:00
{
2020-02-02 19:27:37 +13:00
string line1 = (string)FindResource("Intro:VersionDownloadFailed");
string line2 = (string)FindResource("Intro:ModsTabDisabled");
MessageBox.Show($"{line1}.\n{line2}");
2019-05-19 03:32:14 +12:00
}
else
{
MainWindow.Instance.ModsButton.IsEnabled = true;
2020-02-02 19:27:37 +13:00
string text = (string)FindResource("Intro:ModsTabEnabled");
Utils.SendNotify(text);
MainWindow.Instance.MainText = text;
2019-05-19 03:32:14 +12:00
}
2019-04-22 18:41:43 +12:00
Properties.Settings.Default.Agreed = true;
Properties.Settings.Default.Save();
}
}
}