diff --git a/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 b/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 index 5ac81567..7bf34cfe 100644 Binary files a/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 and b/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 differ diff --git a/VTOL_2.0.0/MainWindow.xaml.cs b/VTOL_2.0.0/MainWindow.xaml.cs index 5382e50f..06ccd0ce 100644 --- a/VTOL_2.0.0/MainWindow.xaml.cs +++ b/VTOL_2.0.0/MainWindow.xaml.cs @@ -107,7 +107,8 @@ public MainWindow() NotificationManager = new NotificationManager(); minimize_to_tray = Properties.Settings.Default.Minimize_to_Tray; Profile_TAG.Content = Properties.Settings.Default.Profile_Name; - + Properties.Settings.Default.Profile_Name = ""; + Properties.Settings.Default.Save(); if (!File.Exists(AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json")) { string DocumentsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); @@ -718,9 +719,22 @@ private void NORTHSTAR_BUTTON_Click(object sender, RoutedEventArgs e) private void Changelog_Click(object sender, RoutedEventArgs e) { + try { string url = @"https://github.com/R2Northstar/Northstar/releases/tag/v" + NORTHSTAR_BUTTON.Content.ToString().Replace("Northstar Version", "").Replace("-", "").Trim().Replace(" ", ""); OPEN_WEBPAGE(url); + + } + + + catch (Exception ex) + { + MessageBox.Show("Exception Encountered! - " + ex.Message); + Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}"); + logger2.Open(); + logger2.Log($"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source + Environment.NewLine + ex.InnerException + Environment.NewLine + ex.TargetSite + Environment.NewLine + "From VERSION - " + Assembly.GetExecutingAssembly().GetName().Version.ToString() + Environment.NewLine); + logger2.Close(); + } } private void Troubleshoot_Click(object sender, RoutedEventArgs e) diff --git a/VTOL_2.0.0/Pages/Page_Home.xaml.cs b/VTOL_2.0.0/Pages/Page_Home.xaml.cs index 00d88450..88699095 100644 --- a/VTOL_2.0.0/Pages/Page_Home.xaml.cs +++ b/VTOL_2.0.0/Pages/Page_Home.xaml.cs @@ -45,10 +45,7 @@ using System.Globalization; using Ionic.Zip; using VTOL.Scripts; -using GameFinder.StoreHandlers.Steam; using System.Runtime.InteropServices; -using GameFinder.RegistryUtils; -using GameFinder.StoreHandlers.Origin; using VTOL.Properties; using Pixelmaniac.Notifications; using System.Xml; @@ -836,62 +833,7 @@ async void Auto_Install_(bool resart_ = false) } - public string Search_Using_Game_Lib() - { - try - { - //////SteamFirst/// - // use the Windows registry on Windows - // Linux doesn't have a registry - var handler = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) - ? new SteamHandler(new WindowsRegistry()) - : new SteamHandler(null); - - // method 1: iterate over the game-error result - SteamGame? steamgame = handler.FindOneGameById(432912, out string[] errors); - - if (steamgame != null && steamgame.Name.Count() > 2) - { - return steamgame.Path; - } - else - { - /////Failed///// - return null; - - } - - - - ///////Origin//// - var Origin_handler = new OriginHandler(); - - // method 1: iterate over the game-error result - foreach (var (game, error) in Origin_handler.FindAllGames()) - { - if (game.InstallPath.Contains("Titanfall2") || game.InstallPath.Contains("TitanFall2")) - { - return game.InstallPath; - } - else - { - /////Failed///// - return null; - } - } - } - - catch (Exception ex) - { - Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}"); - Main.logger2.Open(); - Main.logger2.Log($"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source + Environment.NewLine + ex.InnerException + Environment.NewLine + ex.TargetSite + Environment.NewLine + "From VERSION - " + Assembly.GetExecutingAssembly().GetName().Version.ToString() + Environment.NewLine + System.Reflection.MethodBase.GetCurrentMethod().Name); - Main.logger2.Close(); - - } - return null; - - } + void Restart() { var currentExecutablePath = Process.GetCurrentProcess().MainModule.FileName; @@ -4221,8 +4163,9 @@ private void Button_MouseLeave_1(object sender, MouseEventArgs e) void ShowBanner() { - - WARNING_BANNER.Visibility = Visibility.Visible; + + + WARNING_BANNER.Visibility = Visibility.Visible; } @@ -4230,6 +4173,14 @@ void ShowWelcome() { DispatchIfNecessary(() => { + DispatchIfNecessary(async () => + { + Main.Profile_TAG.Content = ""; + Properties.Settings.Default.Profile_Name = ""; + Properties.Settings.Default.Save(); + Main.Profile_TAG.Content = Properties.Settings.Default.Profile_Name; + Main.Profile_TAG.Refresh(); + }); WELCOME_BANNER.Visibility = Visibility.Visible; Main.RootNavigation.IsEnabled = false; diff --git a/VTOL_2.0.0/Pages/Page_Profiles.xaml b/VTOL_2.0.0/Pages/Page_Profiles.xaml index c3d2e1a8..9469dd68 100644 --- a/VTOL_2.0.0/Pages/Page_Profiles.xaml +++ b/VTOL_2.0.0/Pages/Page_Profiles.xaml @@ -123,7 +123,7 @@ - + diff --git a/VTOL_2.0.0/Pages/Page_Profiles.xaml.cs b/VTOL_2.0.0/Pages/Page_Profiles.xaml.cs index e8738728..dd918a1e 100644 --- a/VTOL_2.0.0/Pages/Page_Profiles.xaml.cs +++ b/VTOL_2.0.0/Pages/Page_Profiles.xaml.cs @@ -16,7 +16,6 @@ using System.Runtime.Serialization.Formatters.Binary; using System.IO.Compression; using System.Threading; -using NLog.Targets; using System.Text.RegularExpressions; using HandyControl.Tools; using System.Windows.Media.Animation; @@ -2000,6 +1999,21 @@ private void Page_Loaded(object sender, RoutedEventArgs e) try { DispatchIfNecessary(async () => { + if (Main.Profile_TAG.Content == null || Main.Profile_TAG.Content == "" || Main.Profile_TAG.Content.ToString().Length < 1) + { + Clear_Profile.IsEnabled = false; + + }else if (Properties.Settings.Default.Profile_Name == "" || Properties.Settings.Default.Profile_Name == null || Properties.Settings.Default.Profile_Name.Length < 1) + { + Clear_Profile.IsEnabled = false; + + } + else + { + Clear_Profile.IsEnabled = true; + + + } LoadProfiles(); //PopulateListBoxWithRandomPaths(); }); @@ -2232,11 +2246,15 @@ private void I_Backup_Mods_Checked(object sender, RoutedEventArgs e) private void Clear_Profile_Click(object sender, RoutedEventArgs e) { - try { - - Properties.Settings.Default.Profile_Name = ""; - Properties.Settings.Default.Save(); - Main.Profile_TAG.Content = Properties.Settings.Default.Profile_Name; + try { + DispatchIfNecessary(async () => + { + Main.Profile_TAG.Content = ""; + Properties.Settings.Default.Profile_Name = ""; + Properties.Settings.Default.Save(); + Main.Profile_TAG.Content = Properties.Settings.Default.Profile_Name; + Main.Profile_TAG.Refresh(); + }); } catch (Exception ex) @@ -2251,30 +2269,12 @@ private void Clear_Profile_Click(object sender, RoutedEventArgs e) private void Clear_Profile_Initialized(object sender, EventArgs e) { - try - { - - - if(Main.Profile_TAG.Content != null || Main.Profile_TAG.Content != ""){ - Clear_Profile.IsEnabled = false; - - } - else - { - Clear_Profile.IsEnabled = true; - - - } - } - - catch (Exception ex) - { - Main.logger2.Open(); - Main.logger2.Log($"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source + Environment.NewLine + ex.InnerException + Environment.NewLine + ex.TargetSite + Environment.NewLine + "From VERSION - " + Assembly.GetExecutingAssembly().GetName().Version.ToString() + Environment.NewLine + System.Reflection.MethodBase.GetCurrentMethod().Name); - Main.logger2.Close(); - + + } - } + private void Clear_Profile_Loaded(object sender, RoutedEventArgs e) + { + } } } diff --git a/VTOL_2.0.0/Pages/Page_Tools.xaml b/VTOL_2.0.0/Pages/Page_Tools.xaml index bf30df59..30da36a2 100644 --- a/VTOL_2.0.0/Pages/Page_Tools.xaml +++ b/VTOL_2.0.0/Pages/Page_Tools.xaml @@ -436,7 +436,7 @@ -