diff --git a/AfterPatchWindow.xaml.cs b/AfterPatchWindow.xaml.cs index 2fc6429..66b71b8 100644 --- a/AfterPatchWindow.xaml.cs +++ b/AfterPatchWindow.xaml.cs @@ -41,8 +41,8 @@ private async void btn_restartEA_Click(object sender, RoutedEventArgs e) { foreach (var process in Process.GetProcessesByName("Origin")) { process.Kill(); } - Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; - await Task.Delay(8000); + Mouse.OverrideCursor = Cursors.Wait; + await Task.Delay(5000); Mouse.OverrideCursor = null; Process p = new Process(); p.StartInfo.UseShellExecute = true; @@ -61,8 +61,8 @@ private async void btn_restartOrigin_Click(object sender, RoutedEventArgs e) { foreach (var process in Process.GetProcessesByName("Origin")) { process.Kill(); } - Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; - await Task.Delay(8000); + Mouse.OverrideCursor = Cursors.Wait; + await Task.Delay(5000); Mouse.OverrideCursor = null; Process p = new Process(); p.StartInfo.UseShellExecute = false; @@ -81,7 +81,7 @@ private async void btn_restartPC_Click(object sender, RoutedEventArgs e) { switch (result) { case MessageBoxResult.Yes: await Task.Delay(2000); - System.Diagnostics.Process.Start("shutdown.exe", "-r -t 0"); + Process.Start("shutdown.exe", "-r -t 0"); break; } } diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index bb276c3..c9c2735 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -22,46 +22,38 @@ public partial class MainWindow : Window { public void checkStatus() { var isenabled = Environment.GetEnvironmentVariable("GAME_DATA_DIR", EnvironmentVariableTarget.User); - if (isenabled == "\\ModData") { - lbl_enabled.Text = "Registry Key is Currently Broken"; - lbl_enabled.Foreground = Brushes.Orange; - } - else if (isenabled != null) { - if (isenabled == bf2015 + "\\ModData") { + if (isenabled != null) { + lbl_enabled.Foreground = Brushes.LightGreen; + if (isenabled == "\\ModData") { + lbl_enabled.Text = "Registry Key is Currently Broken"; + lbl_enabled.Foreground = Brushes.Orange; + } + else if (isenabled == bf2015 + "\\ModData") { lbl_enabled.Text = "Mods are Currently Enabled for Star Wars: Battlefront (2015)"; - lbl_enabled.Foreground = Brushes.LightGreen; } else if (isenabled == bf2017 + "\\ModData") { lbl_enabled.Text = "Mods are Currently Enabled for Star Wars: Battlefront II (2017)"; - lbl_enabled.Foreground = Brushes.LightGreen; } else if (isenabled == mea + "\\ModData") { lbl_enabled.Text = "Mods are Currently Enabled for Mass Effect: Andromeda"; - lbl_enabled.Foreground = Brushes.LightGreen; } else if (isenabled == bf1 + "\\ModData") { lbl_enabled.Text = "Mods are Currently Enabled for Battlefield One"; - lbl_enabled.Foreground = Brushes.LightGreen; } else if (isenabled == nfs + "\\ModData") { lbl_enabled.Text = "Mods are Currently Enabled for Need for Speed"; - lbl_enabled.Foreground = Brushes.LightGreen; } else if (isenabled == nfspayback + "\\ModData") { lbl_enabled.Text = "Mods are Currently Enabled for Need for Speed: Payback"; - lbl_enabled.Foreground = Brushes.LightGreen; } else if (isenabled == gw2 + "\\ModData") { lbl_enabled.Text = "Mods are Currently Enabled for PvZ: Garden Warfare 2"; - lbl_enabled.Foreground = Brushes.LightGreen; } else if (isenabled == dai + "\\ModData") { lbl_enabled.Text = "Mods are Currently Enabled for Dragon Age: Inquisition"; - lbl_enabled.Foreground = Brushes.LightGreen; } else { lbl_enabled.Text = "Mods are Currently Enabled for Custom Game"; - lbl_enabled.Foreground = Brushes.LightGreen; } } else { @@ -71,7 +63,7 @@ public void checkStatus() { } private async void btn_enable_Click(object sender, RoutedEventArgs e) { - Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; + Mouse.OverrideCursor = Cursors.Wait; Environment.SetEnvironmentVariable("GAME_DATA_DIR", datadir + "\\ModData", EnvironmentVariableTarget.User); await Task.Delay(10); Mouse.OverrideCursor = null; @@ -81,7 +73,7 @@ private async void btn_enable_Click(object sender, RoutedEventArgs e) { } private async void btn_disable_Click(object sender, RoutedEventArgs e) { - Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; + Mouse.OverrideCursor = Cursors.Wait; Environment.SetEnvironmentVariable("GAME_DATA_DIR", "", EnvironmentVariableTarget.User); await Task.Delay(10); Mouse.OverrideCursor = null; @@ -105,7 +97,7 @@ public MainWindow() { rbtn_bf2015.IsEnabled = false; rbtn_bf2015.Foreground = new SolidColorBrush(Color.FromArgb(255, 140, 140, 140)); } - + using (RegistryKey bf2017key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\EA Games\STAR WARS Battlefront II")) if (bf2017key != null) { bf2017 = (string)bf2017key.GetValue("Install Dir"); @@ -125,7 +117,7 @@ public MainWindow() { rbtn_bf1.IsEnabled = false; rbtn_bf1.Foreground = new SolidColorBrush(Color.FromArgb(255, 140, 140, 140)); } - + using (RegistryKey meakey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\WOW6432Node\BioWare\Mass Effect Andromeda")) if (meakey != null) { mea = (string)meakey.GetValue("Install Dir"); @@ -135,7 +127,7 @@ public MainWindow() { rbtn_mea.IsEnabled = false; rbtn_mea.Foreground = new SolidColorBrush(Color.FromArgb(255, 140, 140, 140)); } - + using (RegistryKey nfskey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\EA Games\Need for Speed")) if (nfskey != null) { nfs = (string)nfskey.GetValue("Install Dir"); @@ -145,7 +137,7 @@ public MainWindow() { rbtn_nfs.IsEnabled = false; rbtn_nfs.Foreground = new SolidColorBrush(Color.FromArgb(255, 140, 140, 140)); } - + using (RegistryKey nfspaybackkey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\EA Games\Need for Speed Payback")) if (nfspaybackkey != null) { nfspayback = (string)nfspaybackkey.GetValue("Install Dir"); @@ -155,7 +147,7 @@ public MainWindow() { rbtn_nfspayback.IsEnabled = false; rbtn_nfspayback.Foreground = new SolidColorBrush(Color.FromArgb(255, 140, 140, 140)); } - + using (RegistryKey gw2key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\PopCap\Plants vs Zombies GW2")) if (gw2key != null) { gw2 = (string)gw2key.GetValue("Install Dir"); @@ -165,7 +157,7 @@ public MainWindow() { rbtn_gw2.IsEnabled = false; rbtn_gw2.Foreground = new SolidColorBrush(Color.FromArgb(255, 140, 140, 140)); } - + using (RegistryKey daikey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Bioware\Dragon Age Inquisition")) if (daikey != null) { dai = (string)daikey.GetValue("Install Dir"); @@ -204,7 +196,8 @@ private void rbtn_custom_Unchecked(object sender, RoutedEventArgs e) { private void btn_customchoose_Click(object sender, RoutedEventArgs e) { btn_enable.IsEnabled = true; btn_disable.IsEnabled = true; - Microsoft.Win32.OpenFileDialog openFileDlg = new Microsoft.Win32.OpenFileDialog(); { + OpenFileDialog openFileDlg = new OpenFileDialog(); + { openFileDlg.Filter = "Game executable (*.exe)|*.exe"; openFileDlg.FilterIndex = 2; openFileDlg.RestoreDirectory = true; @@ -266,4 +259,4 @@ private void rbtn_dai_Checked(object sender, RoutedEventArgs e) { btn_disable.IsEnabled = true; } } -} +} \ No newline at end of file diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index ce2d9ca..c6bed7a 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.2.0")] -[assembly: AssemblyFileVersion("2.2.0")] +[assembly: AssemblyVersion("2.2.1")] +[assembly: AssemblyFileVersion("2.2.1")]