From 19709ed8d9df087c402765fc15955812c93af820 Mon Sep 17 00:00:00 2001 From: Meivyn Date: Fri, 14 May 2021 11:27:09 -0400 Subject: [PATCH 1/2] Fix libraries detection --- ModAssistant/Pages/Mods.xaml.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/ModAssistant/Pages/Mods.xaml.cs b/ModAssistant/Pages/Mods.xaml.cs index 827dc3c3..96354a82 100644 --- a/ModAssistant/Pages/Mods.xaml.cs +++ b/ModAssistant/Pages/Mods.xaml.cs @@ -28,6 +28,7 @@ public sealed partial class Mods : Page public Mod[] ModsList; public Mod[] AllModsList; public static List InstalledMods = new List(); + public static List ManifestsToMatch = new List(); public List CategoryNames = new List(); public CollectionView view; public bool PendingChanges; @@ -175,12 +176,28 @@ private void CheckInstallDir(string directory) foreach (string file in Directory.GetFileSystemEntries(Path.Combine(App.BeatSaberInstallDirectory, directory))) { - if (File.Exists(file) && Path.GetExtension(file) == ".dll" || Path.GetExtension(file) == ".manifest") + string fileExtension = Path.GetExtension(file); + + if (File.Exists(file) && (fileExtension == ".dll" || fileExtension == ".manifest")) { Mod mod = GetModFromHash(Utils.CalculateMD5(file)); if (mod != null) { - AddDetectedMod(mod); + if (fileExtension == ".manifest") + { + ManifestsToMatch.Add(mod); + } + else + { + if (directory.Contains("Libs")) + { + if (!ManifestsToMatch.Contains(mod)) continue; + + ManifestsToMatch.Remove(mod); + } + + AddDetectedMod(mod); + } } } } From b3804468503e8dc68bcb92536d2b43ba9b571048 Mon Sep 17 00:00:00 2001 From: Meivyn Date: Fri, 14 May 2021 12:15:29 -0400 Subject: [PATCH 2/2] Rename 'ManifestsToMatch' to 'LibsToMatch' --- ModAssistant/Pages/Mods.xaml.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ModAssistant/Pages/Mods.xaml.cs b/ModAssistant/Pages/Mods.xaml.cs index 96354a82..f45230ec 100644 --- a/ModAssistant/Pages/Mods.xaml.cs +++ b/ModAssistant/Pages/Mods.xaml.cs @@ -28,7 +28,7 @@ public sealed partial class Mods : Page public Mod[] ModsList; public Mod[] AllModsList; public static List InstalledMods = new List(); - public static List ManifestsToMatch = new List(); + public static List LibsToMatch = new List(); public List CategoryNames = new List(); public CollectionView view; public bool PendingChanges; @@ -185,15 +185,15 @@ private void CheckInstallDir(string directory) { if (fileExtension == ".manifest") { - ManifestsToMatch.Add(mod); + LibsToMatch.Add(mod); } else { if (directory.Contains("Libs")) { - if (!ManifestsToMatch.Contains(mod)) continue; + if (!LibsToMatch.Contains(mod)) continue; - ManifestsToMatch.Remove(mod); + LibsToMatch.Remove(mod); } AddDetectedMod(mod);