summaryrefslogtreecommitdiff
path: root/src/SMAPI/Program.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-06-30 21:00:45 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-06-30 21:00:45 -0400
commitc12777ad53583997dd9e1ee074e8376da827fc84 (patch)
tree78f2a4d2d02e37539a3ec1f5d74b551c65411c27 /src/SMAPI/Program.cs
parent34b0fd2870f0057b146dbac812cb7d673f2b11a4 (diff)
downloadSMAPI-c12777ad53583997dd9e1ee074e8376da827fc84.tar.gz
SMAPI-c12777ad53583997dd9e1ee074e8376da827fc84.tar.bz2
SMAPI-c12777ad53583997dd9e1ee074e8376da827fc84.zip
move basic mod scanning into the toolkit (#532)
Diffstat (limited to 'src/SMAPI/Program.cs')
-rw-r--r--src/SMAPI/Program.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs
index a88db105..c9266c69 100644
--- a/src/SMAPI/Program.cs
+++ b/src/SMAPI/Program.cs
@@ -104,8 +104,8 @@ namespace StardewModdingAPI
new Regex(@"^DebugOutput: (?:added CLOUD|dismount tile|Ping|playerPos)", RegexOptions.Compiled | RegexOptions.CultureInvariant)
};
- /// <summary>Encapsulates SMAPI's JSON file parsing.</summary>
- private readonly JsonHelper JsonHelper = new JsonHelper();
+ /// <summary>The mod toolkit used for generic mod interactions.</summary>
+ private readonly ModToolkit Toolkit = new ModToolkit();
/*********
@@ -205,7 +205,7 @@ namespace StardewModdingAPI
new RectangleConverter()
};
foreach (JsonConverter converter in converters)
- this.JsonHelper.JsonSettings.Converters.Add(converter);
+ this.Toolkit.JsonHelper.JsonSettings.Converters.Add(converter);
// add error handlers
#if SMAPI_FOR_WINDOWS
@@ -423,14 +423,14 @@ namespace StardewModdingAPI
ModResolver resolver = new ModResolver();
// load manifests
- IModMetadata[] mods = resolver.ReadManifests(Constants.ModPath, this.JsonHelper, modDatabase).ToArray();
+ IModMetadata[] mods = resolver.ReadManifests(toolkit, Constants.ModPath, modDatabase).ToArray();
resolver.ValidateManifests(mods, Constants.ApiVersion, toolkit.GetUpdateUrl);
// process dependencies
mods = resolver.ProcessDependencies(mods, modDatabase).ToArray();
// load mods
- this.LoadMods(mods, this.JsonHelper, this.ContentCore, modDatabase);
+ this.LoadMods(mods, this.Toolkit.JsonHelper, this.ContentCore, modDatabase);
// write metadata file
if (this.Settings.DumpMetadata)
@@ -443,7 +443,7 @@ namespace StardewModdingAPI
ModFolderPath = Constants.ModPath,
Mods = mods
};
- this.JsonHelper.WriteJsonFile(Path.Combine(Constants.LogDir, $"{Constants.LogNamePrefix}.metadata-dump.json"), export);
+ this.Toolkit.JsonHelper.WriteJsonFile(Path.Combine(Constants.LogDir, $"{Constants.LogNamePrefix}.metadata-dump.json"), export);
}
// check for updates
@@ -875,7 +875,7 @@ namespace StardewModdingAPI
{
IMonitor packMonitor = this.GetSecondaryMonitor(packManifest.Name);
IContentHelper packContentHelper = new ContentHelper(contentCore, packDirPath, packManifest.UniqueID, packManifest.Name, packMonitor);
- return new ContentPack(packDirPath, packManifest, packContentHelper, this.JsonHelper);
+ return new ContentPack(packDirPath, packManifest, packContentHelper, this.Toolkit.JsonHelper);
}
modHelper = new ModHelper(manifest.UniqueID, metadata.DirectoryPath, jsonHelper, this.GameInstance.Input, events, contentHelper, commandHelper, modRegistryHelper, reflectionHelper, multiplayerHelper, translationHelper, contentPacks, CreateTransitionalContentPack, this.DeprecationManager);
@@ -1117,7 +1117,7 @@ namespace StardewModdingAPI
/// <param name="mods">The mods for which to reload translations.</param>
private void ReloadTranslations(IEnumerable<IModMetadata> mods)
{
- JsonHelper jsonHelper = this.JsonHelper;
+ JsonHelper jsonHelper = this.Toolkit.JsonHelper;
foreach (IModMetadata metadata in mods)
{
if (metadata.IsContentPack)