Skip to content

Commit

Permalink
Fix libraries detection (#344)
Browse files Browse the repository at this point in the history
* Fix libraries detection

* Rename 'ManifestsToMatch' to 'LibsToMatch'
  • Loading branch information
Meivyn authored May 15, 2021
1 parent 03ee59d commit 50c7b7a
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions ModAssistant/Pages/Mods.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public sealed partial class Mods : Page
public Mod[] ModsList;
public Mod[] AllModsList;
public static List<Mod> InstalledMods = new List<Mod>();
public static List<Mod> LibsToMatch = new List<Mod>();
public List<string> CategoryNames = new List<string>();
public CollectionView view;
public bool PendingChanges;
Expand Down Expand Up @@ -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")
{
LibsToMatch.Add(mod);
}
else
{
if (directory.Contains("Libs"))
{
if (!LibsToMatch.Contains(mod)) continue;

LibsToMatch.Remove(mod);
}

AddDetectedMod(mod);
}
}
}
}
Expand Down

0 comments on commit 50c7b7a

Please sign in to comment.