diff --git a/VTOL_2.0.0/.vs/ProjectEvaluation/vtol.metadata.v7.bin b/VTOL_2.0.0/.vs/ProjectEvaluation/vtol.metadata.v7.bin index 8e7ee76..980f9dd 100644 Binary files a/VTOL_2.0.0/.vs/ProjectEvaluation/vtol.metadata.v7.bin and b/VTOL_2.0.0/.vs/ProjectEvaluation/vtol.metadata.v7.bin differ diff --git a/VTOL_2.0.0/.vs/ProjectEvaluation/vtol.projects.v7.bin b/VTOL_2.0.0/.vs/ProjectEvaluation/vtol.projects.v7.bin index 0553562..5400a20 100644 Binary files a/VTOL_2.0.0/.vs/ProjectEvaluation/vtol.projects.v7.bin and b/VTOL_2.0.0/.vs/ProjectEvaluation/vtol.projects.v7.bin differ diff --git a/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 b/VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2 index 2c3c985..0a7f91a 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/.vs/VTOL/FileContentIndex/085fc3a4-e6cf-451e-a93c-6423bf6fbd34.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/085fc3a4-e6cf-451e-a93c-6423bf6fbd34.vsidx deleted file mode 100644 index 0f62436..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/085fc3a4-e6cf-451e-a93c-6423bf6fbd34.vsidx and /dev/null 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 deleted file mode 100644 index 9322a8b..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/1195ef4b-29ac-4792-a127-102596146dee.vsidx and /dev/null differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/3b9dbfb6-e591-48c7-be70-0d11ed0f48fa.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/3b9dbfb6-e591-48c7-be70-0d11ed0f48fa.vsidx new file mode 100644 index 0000000..a571af3 Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/3b9dbfb6-e591-48c7-be70-0d11ed0f48fa.vsidx 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 deleted file mode 100644 index b418b38..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/557aed7d-e980-4371-b68d-85bb19a5149a.vsidx and /dev/null differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/7ef0d304-8e52-4b49-8264-b13f4f600bf9.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/7ef0d304-8e52-4b49-8264-b13f4f600bf9.vsidx new file mode 100644 index 0000000..db97459 Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/7ef0d304-8e52-4b49-8264-b13f4f600bf9.vsidx differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/ba713770-7db1-4a95-b54a-00a97a44515f.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/ba713770-7db1-4a95-b54a-00a97a44515f.vsidx new file mode 100644 index 0000000..c1ace6b Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/ba713770-7db1-4a95-b54a-00a97a44515f.vsidx differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/c0c50a58-627b-46a2-88ce-08db042a3c3c.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/c0c50a58-627b-46a2-88ce-08db042a3c3c.vsidx new file mode 100644 index 0000000..0e85fa8 Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/c0c50a58-627b-46a2-88ce-08db042a3c3c.vsidx 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 deleted file mode 100644 index fc1c6dc..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/c3e9b025-77a9-4e85-a64d-61eb122ec266.vsidx and /dev/null 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 deleted file mode 100644 index fef1f59..0000000 Binary files a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/ce3f03de-7924-47db-9c42-f7eac4f91e11.vsidx and /dev/null differ diff --git a/VTOL_2.0.0/.vs/VTOL/FileContentIndex/eec75b25-6c1c-4015-a5fe-573c386171e3.vsidx b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/eec75b25-6c1c-4015-a5fe-573c386171e3.vsidx new file mode 100644 index 0000000..643791f Binary files /dev/null and b/VTOL_2.0.0/.vs/VTOL/FileContentIndex/eec75b25-6c1c-4015-a5fe-573c386171e3.vsidx differ diff --git a/VTOL_2.0.0/.vs/VTOL/v17/.futdcache.v2 b/VTOL_2.0.0/.vs/VTOL/v17/.futdcache.v2 index c848d4f..c3f8c28 100644 Binary files a/VTOL_2.0.0/.vs/VTOL/v17/.futdcache.v2 and b/VTOL_2.0.0/.vs/VTOL/v17/.futdcache.v2 differ diff --git a/VTOL_2.0.0/.vs/VTOL/v17/fileList.bin b/VTOL_2.0.0/.vs/VTOL/v17/fileList.bin index c426d4e..6c76231 100644 Binary files a/VTOL_2.0.0/.vs/VTOL/v17/fileList.bin and b/VTOL_2.0.0/.vs/VTOL/v17/fileList.bin differ diff --git a/VTOL_2.0.0/Pages/Page_Mods.xaml.cs b/VTOL_2.0.0/Pages/Page_Mods.xaml.cs index 80e20f7..2b7eb13 100644 --- a/VTOL_2.0.0/Pages/Page_Mods.xaml.cs +++ b/VTOL_2.0.0/Pages/Page_Mods.xaml.cs @@ -13,6 +13,7 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Net.Http.Json; using System.Text.Json; using System.Text.RegularExpressions; using System.Threading; @@ -302,7 +303,7 @@ public List READ_UPDATE_MOD_LIST(DirectoryInfo[] modsTo // Read the JSON file string jsonContent = File.ReadAllText(Json_Path); - if (jsonContent.IsNullOrEmpty() == true && jsonContent.Length < 5) + if (jsonContent.IsNullOrEmpty() == true || jsonContent.Length < 5 || jsonContent == "Null") { File.WriteAllText(Json_Path, "{\t\t\n\n}"); @@ -546,11 +547,12 @@ public async Task Call_Mods_From_Folder() 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(); + Snackbar.Show(); }); } - + + List DIRECTORY_MODS = READ_UPDATE_MOD_LIST(subDirs); CLEANED_FORMAT_MODS = DIRECTORY_MODS; @@ -1110,11 +1112,15 @@ public void Move_Mods(string val, bool Enable_Disable) }); } - - // Read the JSON file - string jsonContent = File.ReadAllText(Json_Path); - // Parse the JSON content - JObject jsonObject = JObject.Parse(jsonContent); + + // Read the JSON file + string jsonContent = File.ReadAllText(Json_Path); + if (jsonContent.IsNullOrEmpty() == true || jsonContent.Length < 5 || jsonContent == "Null") + { + File.WriteAllText(Json_Path, "{\t\t\n\n}"); + } + // Parse the JSON content + JObject jsonObject = JObject.Parse(jsonContent); string Name = val; if (jsonObject.TryGetValue(Name, out _)) { @@ -2362,7 +2368,7 @@ protected virtual void Delete_Action(object sender, RoutedEventArgs e) string jsonContent = File.ReadAllText(Json_Path); - if (jsonContent.IsNullOrEmpty() == true || jsonContent.Length > 2 || jsonContent == "null") + if (jsonContent.IsNullOrEmpty() == true || jsonContent.Length > 2 || jsonContent == "Null") {// Parse the JSON content