diff --git a/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 b/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 index ccc15684..d2509170 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 b5966416..eae2cb7b 100644 --- a/VTOL_2.0.0/MainWindow.xaml.cs +++ b/VTOL_2.0.0/MainWindow.xaml.cs @@ -38,7 +38,6 @@ public partial class MainWindow : Window bool Profile_card = false; public User_Settings User_Settings_Vars = new User_Settings(); public string AppDataFolder = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); - public string DocumentsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); public TlsPaperTrailLogger logger2 = new TlsPaperTrailLogger("logs5.papertrailapp.com", 38137); @@ -63,27 +62,32 @@ public MainWindow() InitializeComponent(); //System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR"); + //System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");Do - if (Directory.Exists(DocumentsFolder) && Directory.Exists(AppDataFolder)) - { - if (!Directory.Exists(AppDataFolder + @"\VTOL_DATA\Settings")) + if (!File.Exists(AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json")) + { string DocumentsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + if (Directory.Exists(DocumentsFolder) && Directory.Exists(AppDataFolder)) { - TryCreateDirectory(AppDataFolder + @"\VTOL_DATA\Settings"); + if (!Directory.Exists(AppDataFolder + @"\VTOL_DATA\Settings")) - } + { + TryCreateDirectory(AppDataFolder + @"\VTOL_DATA\Settings"); - if (File.Exists(DocumentsFolder + @"\VTOL_DATA\Settings\User_Settings.Json") && !File.Exists(AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json")) - { - TryCopyFile(DocumentsFolder + @"\VTOL_DATA\Settings\User_Settings.Json", AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json"); + } - if (File.Exists(AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json")) + if (File.Exists(DocumentsFolder + @"\VTOL_DATA\Settings\User_Settings.Json") && !File.Exists(AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json")) { - TryDeleteDirectory(DocumentsFolder + @"\VTOL_DATA\",true); + TryCopyFile(DocumentsFolder + @"\VTOL_DATA\Settings\User_Settings.Json", AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json"); + + if (File.Exists(AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json")) + { + TryDeleteDirectory(DocumentsFolder + @"\VTOL_DATA\", true); + } } } - } + } if (Directory.Exists(AppDataFolder)) { @@ -683,7 +687,7 @@ private void Northstar_Dialog_IsVisibleChanged(object sender, DependencyProperty { From = Northstar_Dialog.Opacity, To = 1, - Duration = new Duration(TimeSpan.FromSeconds(0.8)), + Duration = new Duration(TimeSpan.FromSeconds(0.2)), AutoReverse = false }; Northstar_Dialog.BeginAnimation(OpacityProperty, da); @@ -698,7 +702,7 @@ private void Northstar_Dialog_IsVisibleChanged(object sender, DependencyProperty { From = Northstar_Dialog.Opacity, To = 0, - Duration = new Duration(TimeSpan.FromSeconds(0.8)), + Duration = new Duration(TimeSpan.FromSeconds(0.2)), AutoReverse = false }; Northstar_Dialog.BeginAnimation(OpacityProperty, da); diff --git a/VTOL_2.0.0/Pages/Page_Home.xaml.cs b/VTOL_2.0.0/Pages/Page_Home.xaml.cs index d155849d..12f249f2 100644 --- a/VTOL_2.0.0/Pages/Page_Home.xaml.cs +++ b/VTOL_2.0.0/Pages/Page_Home.xaml.cs @@ -343,7 +343,7 @@ public Page_Home() DispatcherTimer Log_Changes_Timer = new DispatcherTimer(); DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(2); - Log_Changes_Timer.Interval = TimeSpan.FromSeconds(60); + Log_Changes_Timer.Interval = TimeSpan.FromSeconds(10); timer.Tick += timer_Tick; Log_Changes_Timer.Tick += Log_Changes_Timer_Tick; timer.Start(); @@ -883,7 +883,6 @@ void INIT() MasterServer_URL = User_Settings_Vars.MasterServerUrl; Current_Install_Folder = User_Settings_Vars.NorthstarInstallLocation; - Console.WriteLine(Current_Install_Folder); if (IsValidPath(Current_Install_Folder)) { @@ -902,7 +901,7 @@ void INIT() { string FINAL = ""; Current_Install_Folder = InstalledApplications.GetApplictionInstallPath("Titanfall2"); - if (IsValidPath(Current_Install_Folder)) + if (Directory.Exists(Current_Install_Folder)) { FINAL = Current_Install_Folder; if (!Current_Install_Folder.EndsWith(@"\")) @@ -935,12 +934,13 @@ void INIT() } else { + Console.WriteLine("Null_Settings"); string FINAL = ""; Current_Install_Folder = InstalledApplications.GetApplictionInstallPath("Titanfall2"); + if (IsValidPath(Current_Install_Folder)) { - FINAL = Current_Install_Folder; if (!Current_Install_Folder.EndsWith(@"\")) { string fix = Current_Install_Folder + @"\"; @@ -957,16 +957,56 @@ void INIT() } else { + string Current_Install_Folder_x = Auto_Find_And_verify(InstalledApplications.GetApplictionInstallPath("Steam")).Replace(@"\\", @"\").Replace("/", @"\"); + - SnackBar.Appearance = ControlAppearance.Danger; - SnackBar.Title = "WARNING!"; - SnackBar.Message = VTOL.Resources.Languages.Language.Page_Home_INIT_InvalidInstallPathPleaseManuallyLocateTheCorrectFolder; - SnackBar.Show(); + Current_Install_Folder = Auto_Find_And_verify().Replace(@"\\", @"\").Replace("/", @"\"); - throw new Exception("Could Not Install Ns after all of it :("); + if (IsValidPath(Current_Install_Folder)) + { + if (!Current_Install_Folder.EndsWith(@"\")) + { + string fix = Current_Install_Folder + @"\"; + User_Settings_Vars.NorthstarInstallLocation = fix; + Current_Install_Folder = fix.Replace(@"\\", @"\").Replace("/", @"\"); + string User_Settings_Json_Strings = Newtonsoft.Json.JsonConvert.SerializeObject(User_Settings_Vars); + using (var StreamWriter = new StreamWriter(AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json", false)) + { + StreamWriter.WriteLine(User_Settings_Json_Strings); + StreamWriter.Close(); + } + } - return; + } + else if(IsValidPath(Current_Install_Folder_x)) + { + if (!Current_Install_Folder.EndsWith(@"\")) + { + string fix = Current_Install_Folder + @"\"; + User_Settings_Vars.NorthstarInstallLocation = fix; + Current_Install_Folder = fix.Replace(@"\\", @"\").Replace("/", @"\"); + string User_Settings_Json_Strings = Newtonsoft.Json.JsonConvert.SerializeObject(User_Settings_Vars); + using (var StreamWriter = new StreamWriter(AppDataFolder + @"\VTOL_DATA\Settings\User_Settings.Json", false)) + { + StreamWriter.WriteLine(User_Settings_Json_Strings); + StreamWriter.Close(); + } + } + } + else + { + + + SnackBar.Appearance = ControlAppearance.Danger; + SnackBar.Title = "WARNING!"; + SnackBar.Message = VTOL.Resources.Languages.Language.Page_Home_INIT_InvalidInstallPathPleaseManuallyLocateTheCorrectFolder; + SnackBar.Show(); + + throw new Exception("Could Not Install Ns after all of it :("); + + return; + } } @@ -1423,10 +1463,9 @@ private static string GetShortcutTarget(string file) return ""; } } - private string Auto_Find_And_verify() + private string Auto_Find_And_verify(string path = @"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Steam") { - string path = @"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Steam"; if (!Directory.Exists(path) || !File.Exists(Path.Combine(path, "Steam.lnk"))) { @@ -1440,9 +1479,7 @@ private string Auto_Find_And_verify() } catch { - Main.logger2.Open(); - Main.logger2.Log("A User with the install - " + Current_Install_Folder + " failed an auto install and verify."); - Main.logger2.Close(); + } //Titanfall2_Directory_TextBox.Background = Brushes.Red; @@ -1497,8 +1534,7 @@ private string Auto_Find_And_verify() } - if (Directory.Exists(@"C:\Program Files (x86)\Origin Games\Titanfall2") && File.Exists(@"C:\Program Files (x86)\Origin Games\Titanfall2\Titanfall2.exe")) - return @"C:\Program Files (x86)\Origin Games\Titanfall2"; + //Titanfall2_Directory_TextBox.Background = Brushes.Red; //Install_NS_EXE_Textbox.Background = Brushes.Red; //Send_Fatal_Notif(GetTextResource("NOTIF_FATAL_GAME_INSTALL_NOT_FOUND")); diff --git a/VTOL_2.0.0/Pages/Page_Mods.xaml.cs b/VTOL_2.0.0/Pages/Page_Mods.xaml.cs index b7376bca..62b0da1f 100644 --- a/VTOL_2.0.0/Pages/Page_Mods.xaml.cs +++ b/VTOL_2.0.0/Pages/Page_Mods.xaml.cs @@ -338,7 +338,7 @@ async void Call_Mods_From_Folder() } int Flag_mod = 0; string ToolTip_Dynamic = VTOL.Resources.Languages.Language.Page_Mods_Call_Mods_From_Folder_ThereIsAnIssueDetectedWithYourMod; - if (!File.Exists(dirInfo.FullName + @"\Locked_Folder" + @"\mod.json") ) + if (!File.Exists(dirInfo.FullName + @"\Locked_Folder" + @"\mod.json") && !Directory.Exists(dirInfo.FullName + @"\" + "Multipack")) { ToolTip_Dynamic = VTOL.Resources.Languages.Language.Page_Mods_Call_Mods_From_Folder_PleaseOpenYourFolderAt + dirInfo.Parent + VTOL.Resources.Languages.Language.Page_Mods_Call_Mods_From_Folder_AndManuallyRepairTheMod + dirInfo.Name; Flag_mod = 100; @@ -350,7 +350,7 @@ async void Call_Mods_From_Folder() int Flag_mod = 0; string ToolTip_Dynamic = VTOL.Resources.Languages.Language.Page_Mods_Call_Mods_From_Folder_ThereIsAnIssueDetectedWithYourMod; - if (!File.Exists(dirInfo.FullName + @"\mod.json")) + if (!File.Exists(dirInfo.FullName + @"\mod.json") && !Directory.Exists(dirInfo.FullName + @"\" + "Multipack")) { ToolTip_Dynamic = VTOL.Resources.Languages.Language.Page_Mods_Call_Mods_From_Folder_PleaseOpenYourFolderAt + dirInfo.Parent + VTOL.Resources.Languages.Language.Page_Mods_Call_Mods_From_Folder_AndManuallyRepairTheMod + dirInfo.Name; diff --git a/VTOL_2.0.0/Pages/Page_Thunderstore.xaml b/VTOL_2.0.0/Pages/Page_Thunderstore.xaml index ced91b7f..a411b23f 100644 --- a/VTOL_2.0.0/Pages/Page_Thunderstore.xaml +++ b/VTOL_2.0.0/Pages/Page_Thunderstore.xaml @@ -10,7 +10,7 @@ xmlns:cntrls="clr-namespace:VTOL" d:DesignHeight="670" d:DesignWidth="1148" - Title="Page_Thunderstore" UseLayoutRounding="True"> + Title="Page_Thunderstore" UseLayoutRounding="True" Loaded="Page_Loaded_1"> @@ -129,7 +129,7 @@ - +