From 488f9d8ba249466916f9023396dcf5a21dd6fb49 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 6 Mar 2023 11:39:20 -0500 Subject: [PATCH] = _ = --- .../.vs/VTOL/DesignTimeBuild/.dtbcache.v2 | Bin 463504 -> 463504 bytes VTOL_2.0.0/MainWindow.xaml.cs | 16 +++- VTOL_2.0.0/Pages/Page_Home.xaml.cs | 73 +++--------------- VTOL_2.0.0/Pages/Page_Profiles.xaml | 2 +- VTOL_2.0.0/Pages/Page_Profiles.xaml.cs | 58 +++++++------- VTOL_2.0.0/Pages/Page_Tools.xaml | 2 +- VTOL_2.0.0/Pages/Page_Tools.xaml.cs | 64 +++++++++------ VTOL_2.0.0/VTOL.csproj | 16 +--- [Titanfall2_Downloadable_Tools]/LEGION+.zip | Bin 2406078 -> 1322467 bytes 9 files changed, 104 insertions(+), 127 deletions(-) diff --git a/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 b/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 index 5ac815671d40bbb4cde038d46c5e8f477c5bd401..7bf34cfe56495969eb31df153dec04f216375ebd 100644 GIT binary patch delta 98 zcmWN^yAgmO3;@vc-&;EbBq2)Y2F?Hn*~21rSi%w9Pw!sy+OxIab(Tz+<#4-CfwBko tAXuY7aCijV6Nvay3uB?bl%hDU#1(;^Fy5xtsr71u+Nd_E&95!p`T@B(9jyQW delta 98 zcmWN~%5e<#7urWwG 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 @@ -