summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/SCore.cs
diff options
context:
space:
mode:
authorMichał Dolaś <me@shockah.pl>2022-11-09 17:25:25 +0100
committerMichał Dolaś <me@shockah.pl>2022-11-09 17:25:25 +0100
commitbb2fde18292352471501887013ca2b7f60a9dc25 (patch)
tree280d38397d32d40df9c5675a05d32106fff61681 /src/SMAPI/Framework/SCore.cs
parent9ae69245b30f5cc6b52f1159a6e151079b699a10 (diff)
downloadSMAPI-bb2fde18292352471501887013ca2b7f60a9dc25.tar.gz
SMAPI-bb2fde18292352471501887013ca2b7f60a9dc25.tar.bz2
SMAPI-bb2fde18292352471501887013ca2b7f60a9dc25.zip
Added ModsToLoadFirst/Last to SMAPI config, along with the implementation
Diffstat (limited to 'src/SMAPI/Framework/SCore.cs')
-rw-r--r--src/SMAPI/Framework/SCore.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index 40979b09..7bd60490 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -423,9 +423,17 @@ namespace StardewModdingAPI.Framework
this.Monitor.Log($" Skipped {mod.GetRelativePathWithRoot()} (folder name starts with a dot).");
mods = mods.Where(p => !p.IsIgnored).ToArray();
+ // warn about mods that should load first or last which are not found at all
+ foreach (string modId in this.Settings.ModsToLoadFirst)
+ if (!mods.Any(m => m.Manifest.UniqueID == modId))
+ this.Monitor.Log($" SMAPI configuration specifies a mod {modId} that should load first, but it could not be found.", LogLevel.Warn);
+ foreach (string modId in this.Settings.ModsToLoadLast)
+ if (!mods.Any(m => m.Manifest.UniqueID == modId))
+ this.Monitor.Log($" SMAPI configuration specifies a mod {modId} that should load last, but it could not be found.", LogLevel.Warn);
+
// load mods
resolver.ValidateManifests(mods, Constants.ApiVersion, toolkit.GetUpdateUrl, getFileLookup: this.GetFileLookup);
- mods = resolver.ProcessDependencies(mods, modDatabase).ToArray();
+ mods = resolver.ProcessDependencies(mods, this.Settings.ModsToLoadFirst, this.Settings.ModsToLoadLast, modDatabase).ToArray();
this.LoadMods(mods, this.Toolkit.JsonHelper, this.ContentCore, modDatabase);
// check for software likely to cause issues