summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-08-19 21:22:48 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-08-19 21:22:48 -0400
commitca8699c68f238f3092966a550643859bce357a86 (patch)
tree77bf2f5782c7f60a12b31019095f2776e0fef3dc /src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs
parent307bf6ce55e8880f0e0382cb678d7fcc6c74c11e (diff)
downloadSMAPI-ca8699c68f238f3092966a550643859bce357a86.tar.gz
SMAPI-ca8699c68f238f3092966a550643859bce357a86.tar.bz2
SMAPI-ca8699c68f238f3092966a550643859bce357a86.zip
add display name field to ModFolder (#583)
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs')
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs
index 063ec2f4..71dc0cb3 100644
--- a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs
+++ b/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs
@@ -44,8 +44,9 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning
}
/// <summary>Extract information from a mod folder.</summary>
+ /// <param name="root">The root folder containing mods.</param>
/// <param name="searchFolder">The folder to search for a mod.</param>
- public ModFolder ReadFolder(DirectoryInfo searchFolder)
+ public ModFolder ReadFolder(DirectoryInfo root, DirectoryInfo searchFolder)
{
// find manifest.json
FileInfo manifestFile = this.FindManifest(searchFolder);
@@ -53,8 +54,8 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning
{
bool isEmpty = !searchFolder.GetFileSystemInfos().Where(this.IsRelevant).Any();
if (isEmpty)
- return new ModFolder(searchFolder, null, "it's an empty folder.");
- return new ModFolder(searchFolder, null, "it contains files, but none of them are manifest.json.");
+ return new ModFolder(root, searchFolder, null, "it's an empty folder.");
+ return new ModFolder(root, searchFolder, null, "it contains files, but none of them are manifest.json.");
}
// read mod info
@@ -76,7 +77,7 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning
}
}
- return new ModFolder(manifestFile.Directory, manifest, manifestError);
+ return new ModFolder(root, manifestFile.Directory, manifest, manifestError);
}
@@ -100,7 +101,7 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning
// treat as mod folder
else
- yield return this.ReadFolder(folder);
+ yield return this.ReadFolder(root, folder);
}
/// <summary>Find the manifest for a mod folder.</summary>