Skip to content

Commit

Permalink
QModManager now explicitly excludes hidden folders from mod loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
toebeann committed Jul 21, 2020
1 parent 0c9508a commit c456371
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions QModManager/Patching/QModFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

internal class QModFactory : IQModFactory
{
Expand Down Expand Up @@ -41,7 +42,7 @@ public List<QMod> BuildModLoadingList(string qmodsDirectory)

internal void LoadModsFromDirectories(string[] subDirectories, SortedCollection<string, QMod> modSorter, List<QMod> earlyErrors)
{
foreach (string subDir in subDirectories)
foreach (string subDir in subDirectories.Where(subDir => (new DirectoryInfo(subDir).Attributes & FileAttributes.Hidden) != FileAttributes.Hidden)) // exclude hidden directories
{
string[] dllFiles = Directory.GetFiles(subDir, "*.dll", SearchOption.TopDirectoryOnly);

Expand All @@ -61,7 +62,7 @@ internal void LoadModsFromDirectories(string[] subDirectories, SortedCollection<

QMod mod = CreateFromJsonManifestFile(subDir);

if(mod == null)
if (mod == null)
{
Logger.Error($"Unable to set up mod in folder \"{folderName}\"");
earlyErrors.Add(new QModPlaceholder(folderName, ModStatus.MissingCoreInfo));
Expand Down

0 comments on commit c456371

Please sign in to comment.