diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/085fc3a4-e6cf-451e-a93c-6423bf6fbd34.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/085fc3a4-e6cf-451e-a93c-6423bf6fbd34.vsidx new file mode 100644 index 0000000..0f62436 Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/085fc3a4-e6cf-451e-a93c-6423bf6fbd34.vsidx differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/1195ef4b-29ac-4792-a127-102596146dee.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/1195ef4b-29ac-4792-a127-102596146dee.vsidx new file mode 100644 index 0000000..9322a8b Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/1195ef4b-29ac-4792-a127-102596146dee.vsidx differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/216e694a-f2d5-41c2-a0ad-3713fdc5b565.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/216e694a-f2d5-41c2-a0ad-3713fdc5b565.vsidx deleted file mode 100644 index f7b3a17..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/216e694a-f2d5-41c2-a0ad-3713fdc5b565.vsidx and /dev/null differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/557aed7d-e980-4371-b68d-85bb19a5149a.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/557aed7d-e980-4371-b68d-85bb19a5149a.vsidx new file mode 100644 index 0000000..b418b38 Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/557aed7d-e980-4371-b68d-85bb19a5149a.vsidx differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/7636cfd3-8e9f-4f0c-a2d4-c9d5c0908502.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/7636cfd3-8e9f-4f0c-a2d4-c9d5c0908502.vsidx deleted file mode 100644 index 3865b1e..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/7636cfd3-8e9f-4f0c-a2d4-c9d5c0908502.vsidx and /dev/null differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/c3e9b025-77a9-4e85-a64d-61eb122ec266.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/c3e9b025-77a9-4e85-a64d-61eb122ec266.vsidx new file mode 100644 index 0000000..fc1c6dc Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/c3e9b025-77a9-4e85-a64d-61eb122ec266.vsidx differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/ce3f03de-7924-47db-9c42-f7eac4f91e11.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/ce3f03de-7924-47db-9c42-f7eac4f91e11.vsidx new file mode 100644 index 0000000..fef1f59 Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/ce3f03de-7924-47db-9c42-f7eac4f91e11.vsidx differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/d584e337-271c-4f0b-86b3-50ad0ec53c9d.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/d584e337-271c-4f0b-86b3-50ad0ec53c9d.vsidx deleted file mode 100644 index 1a96eba..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/d584e337-271c-4f0b-86b3-50ad0ec53c9d.vsidx and /dev/null differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/dc5e13bb-7a95-4bd1-b35f-d744f01af283.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/dc5e13bb-7a95-4bd1-b35f-d744f01af283.vsidx deleted file mode 100644 index b77dca8..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/dc5e13bb-7a95-4bd1-b35f-d744f01af283.vsidx and /dev/null differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/df859033-3ffa-444d-9c08-de2d27c12ad2.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/df859033-3ffa-444d-9c08-de2d27c12ad2.vsidx deleted file mode 100644 index 86fb060..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/df859033-3ffa-444d-9c08-de2d27c12ad2.vsidx and /dev/null differ diff --git a/VTOL_2.0.0/Pages/Page_Home.xaml.cs b/VTOL_2.0.0/Pages/Page_Home.xaml.cs index 13b5898..89ac572 100644 --- a/VTOL_2.0.0/Pages/Page_Home.xaml.cs +++ b/VTOL_2.0.0/Pages/Page_Home.xaml.cs @@ -3368,7 +3368,6 @@ private void Parse_Release(string json_name = "temp.json") StreamWriter.WriteLine(User_Settings_Json_Strings); StreamWriter.Close(); } - //Send_Info_Notif(GetTextResource("NOTIF_INFO_RELEASE_PARSED") + current_Northstar_version_Url); } else @@ -3376,7 +3375,6 @@ private void Parse_Release(string json_name = "temp.json") DispatchIfNecessary(async () => { - //Send_Error_Notif(GetTextResource("NOTIF_ERROR_RELEASE_NOT_FOUND")); SnackBar.Appearance = ControlAppearance.Danger; SnackBar.Title = "ERROR!"; SnackBar.Message = VTOL.Resources.Languages.Language.Parse_Release_ReleaseNotFound; diff --git a/VTOL_2.0.0/Pages/Page_Mods.xaml.cs b/VTOL_2.0.0/Pages/Page_Mods.xaml.cs index 03862a4..80e20f7 100644 --- a/VTOL_2.0.0/Pages/Page_Mods.xaml.cs +++ b/VTOL_2.0.0/Pages/Page_Mods.xaml.cs @@ -285,11 +285,22 @@ public List READ_UPDATE_MOD_LIST(DirectoryInfo[] modsTo } string Json_Path = FindFirstFile(User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\", "enabledmods.json"); - - if (File.Exists(Json_Path) == true) + if (!File.Exists(Json_Path)) { - // Read the JSON file - string jsonContent = File.ReadAllText(Json_Path); + File.WriteAllText(Json_Path, "{\t\t\n\n}"); + DispatchIfNecessary(async () => + { + + + Snackbar.Title = VTOL.Resources.Languages.Language.ERROR; + Snackbar.Appearance = Wpf.Ui.Common.ControlAppearance.Caution; + Snackbar.Message = VTOL.Resources.Languages.Language.File + Json_Path + VTOL.Resources.Languages.Language.CouldNotBeFoundOrHadAnErrorAndWasEdited; + Snackbar.ShowAsync(); + }); + } + + // Read the JSON file + string jsonContent = File.ReadAllText(Json_Path); if (jsonContent.IsNullOrEmpty() == true && jsonContent.Length < 5) { @@ -472,7 +483,7 @@ public List READ_UPDATE_MOD_LIST(DirectoryInfo[] modsTo } - } + } catch (Exception ex) { @@ -525,15 +536,26 @@ public async Task Call_Mods_From_Folder() { string Json_Path = FindFirstFile(User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\", "enabledmods.json"); - - if (File.Exists(Json_Path)) + if (!File.Exists(Json_Path)) { + File.WriteAllText(Json_Path, "{\t\t\n\n}"); + DispatchIfNecessary(async () => + { + + + Snackbar.Title = VTOL.Resources.Languages.Language.ERROR; + Snackbar.Appearance = Wpf.Ui.Common.ControlAppearance.Caution; + Snackbar.Message = VTOL.Resources.Languages.Language.File + Json_Path + VTOL.Resources.Languages.Language.CouldNotBeFoundOrHadAnErrorAndWasEdited; + Snackbar.ShowAsync(); + }); + } + List DIRECTORY_MODS = READ_UPDATE_MOD_LIST(subDirs); CLEANED_FORMAT_MODS = DIRECTORY_MODS; - } + DispatchIfNecessary(async () => { @@ -1074,10 +1096,21 @@ public void Move_Mods(string val, bool Enable_Disable) string Json_Path = FindFirstFile(User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\", "enabledmods.json"); - - - if (File.Exists(Json_Path)) + if (!File.Exists(Json_Path)) { + File.WriteAllText(Json_Path, "{\t\t\n\n}"); + DispatchIfNecessary(async () => + { + + + Snackbar.Title = VTOL.Resources.Languages.Language.ERROR; + Snackbar.Appearance = Wpf.Ui.Common.ControlAppearance.Caution; + Snackbar.Message = VTOL.Resources.Languages.Language.File + Json_Path +VTOL.Resources.Languages.Language.CouldNotBeFoundOrHadAnErrorAndWasEdited; + Snackbar.ShowAsync(); + }); + } + + // Read the JSON file string jsonContent = File.ReadAllText(Json_Path); // Parse the JSON content @@ -1099,16 +1132,11 @@ public void Move_Mods(string val, bool Enable_Disable) // Write back to the file File.WriteAllText(Json_Path, updatedJson); - } - else - { + - Snackbar.Title = VTOL.Resources.Languages.Language.ERROR; - Snackbar.Appearance = Wpf.Ui.Common.ControlAppearance.Caution; - Snackbar.Message = "File" + Json_Path + " Could not be Edited."; - Snackbar.Show(); + - } + } else { @@ -2315,10 +2343,21 @@ protected virtual void Delete_Action(object sender, RoutedEventArgs e) var btn = sender as Wpf.Ui.Controls.Dialog; string Json_Path = FindFirstFile(User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\", "enabledmods.json"); + if (!File.Exists(Json_Path)) + { + File.WriteAllText(Json_Path, "{\t\t\n\n}"); + DispatchIfNecessary(async () => + { + + + Snackbar.Title = VTOL.Resources.Languages.Language.ERROR; + Snackbar.Appearance = Wpf.Ui.Common.ControlAppearance.Caution; + Snackbar.Message = VTOL.Resources.Languages.Language.File + Json_Path + VTOL.Resources.Languages.Language.CouldNotBeFoundOrHadAnErrorAndWasEdited; + Snackbar.ShowAsync(); + }); + } - if (File.Exists(Json_Path)) - { // Read the JSON file string jsonContent = File.ReadAllText(Json_Path); @@ -2332,7 +2371,7 @@ protected virtual void Delete_Action(object sender, RoutedEventArgs e) } - JObject jsonObject = JObject.Parse(jsonContent); + JObject jsonObject = JObject.Parse(jsonContent); string Name = workingmod; if (jsonObject.TryGetValue(Name, out _)) { @@ -2349,7 +2388,7 @@ protected virtual void Delete_Action(object sender, RoutedEventArgs e) - } + diff --git a/VTOL_2.0.0/Pages/Page_Thunderstore.xaml.cs b/VTOL_2.0.0/Pages/Page_Thunderstore.xaml.cs index 620eaa0..4f5a89b 100644 --- a/VTOL_2.0.0/Pages/Page_Thunderstore.xaml.cs +++ b/VTOL_2.0.0/Pages/Page_Thunderstore.xaml.cs @@ -3551,7 +3551,7 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio - Console.WriteLine("Plugin Detected ------\n\n\n\n\n"); + // Console.WriteLine("Plugin Detected ------\n\n\n\n\n"); bool consent_TM = false; @@ -3707,7 +3707,7 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio } else if (mod_json == true && NS_CANDIDATE_INSTALL == false) { - Console.WriteLine("Mod Detected ------\n\n\n\n\n"); + // Console.WriteLine("Mod Detected ------\n\n\n\n\n"); if (File.Exists(manifest_json) == true) { @@ -3717,14 +3717,14 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio if (manidata.SelectToken("namespace") == null) { // Create a new JObject for the namespace - Console.WriteLine("Namespace not found - Inserting : " + namespace_.ToString()); + Log.Information("Namespace not found - Inserting : " + namespace_.ToString()); // namespaceObject[namespace__] = namespace_; manidata["namespace"] = namespace_; File.WriteAllText(manifest_json, manidata.ToString()); - Console.WriteLine("File updated and saved."); + Log.Information("File updated and saved."); } @@ -3741,12 +3741,24 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio string Json_Path = FindFirstFile(User_Settings_Vars.NorthstarInstallLocation + @"R2Northstar\", "enabledmods.json"); + if (!File.Exists(Json_Path)) + { + File.WriteAllText(Json_Path, "{\t\t\n\n}"); + DispatchIfNecessary(async () => + { - if (File.Exists(Json_Path)) - { - // Read the JSON file - string jsonContent = File.ReadAllText(Json_Path); + SnackBar.Title = VTOL.Resources.Languages.Language.ERROR; + SnackBar.Appearance = Wpf.Ui.Common.ControlAppearance.Caution; + SnackBar.Message = VTOL.Resources.Languages.Language.File + Json_Path + VTOL.Resources.Languages.Language.CouldNotBeFoundOrHadAnErrorAndWasEdited; + SnackBar.ShowAsync(); + }); + } + + + + // Read the JSON file + string jsonContent = File.ReadAllText(Json_Path); if (jsonContent.IsNullOrEmpty() == true || jsonContent.Length > 2 || jsonContent == "null") {// Parse the JSON content @@ -3768,7 +3780,7 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio // Write back to the fileorder File.WriteAllText(Json_Path, updatedJson); - } + Update_ActionCard_Progress(Action_Card_, 30, true); @@ -3797,8 +3809,7 @@ public async Task Unpack_To_Location_Custom(string Target_Zip, string Destinatio } else { - - + DispatchIfNecessary(async () => { Update_ActionCard_Progress(Action_Card_, 5); diff --git a/VTOL_2.0.0/Resources/Languages/Language.Designer.cs b/VTOL_2.0.0/Resources/Languages/Language.Designer.cs index 9081bf0..cf5ac20 100644 --- a/VTOL_2.0.0/Resources/Languages/Language.Designer.cs +++ b/VTOL_2.0.0/Resources/Languages/Language.Designer.cs @@ -141,6 +141,15 @@ public static string CouldNotBeDeleted { } } + /// + /// Looks up a localized string similar to " - Could not be Found or had an error and was Edited.. + /// + public static string CouldNotBeFoundOrHadAnErrorAndWasEdited { + get { + return ResourceManager.GetString("CouldNotBeFoundOrHadAnErrorAndWasEdited", resourceCulture); + } + } + /// /// Looks up a localized string similar to Could Not Read User Settings, Please Run as Admin or Repair/Clean your Installation. /// @@ -231,6 +240,15 @@ public static string FATALERROR { } } + /// + /// Looks up a localized string similar to File - . + /// + public static string File { + get { + return ResourceManager.GetString("File", resourceCulture); + } + } + /// /// Looks up a localized string similar to has been Deleted. /// diff --git a/VTOL_2.0.0/Resources/Languages/Language.resx b/VTOL_2.0.0/Resources/Languages/Language.resx index 3bbe6db..393e712 100644 --- a/VTOL_2.0.0/Resources/Languages/Language.resx +++ b/VTOL_2.0.0/Resources/Languages/Language.resx @@ -831,4 +831,10 @@ FATAL - ERROR + + " - Could not be Found or had an error and was Edited. + + + File - + \ No newline at end of file