summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Program.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-01-19 11:43:32 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-01-19 11:43:32 -0500
commit5ccd5b5df7d7fcbbf176bf2d99a274ee39681ea9 (patch)
treedfc980cf1c87551c273bb65c82da99af6f91e0d6 /src/StardewModdingAPI/Program.cs
parent1cf8a628dc730e656a344facb731b5bafa36d046 (diff)
downloadSMAPI-5ccd5b5df7d7fcbbf176bf2d99a274ee39681ea9.tar.gz
SMAPI-5ccd5b5df7d7fcbbf176bf2d99a274ee39681ea9.tar.bz2
SMAPI-5ccd5b5df7d7fcbbf176bf2d99a274ee39681ea9.zip
log deprecation warnings after list of loaded mods (#220)
Diffstat (limited to 'src/StardewModdingAPI/Program.cs')
-rw-r--r--src/StardewModdingAPI/Program.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs
index bf0805be..ec3ccce7 100644
--- a/src/StardewModdingAPI/Program.cs
+++ b/src/StardewModdingAPI/Program.cs
@@ -337,6 +337,7 @@ namespace StardewModdingAPI
}
// load mod assemblies
+ List<Action> deprecationWarnings = new List<Action>(); // queue up deprecation warnings to show after mod list
foreach (string directory in Directory.GetDirectories(Program.ModPath))
{
string directoryName = new DirectoryInfo(directory).Name;
@@ -391,7 +392,7 @@ namespace StardewModdingAPI
// log deprecated fields
if (manifest.UsedAuthourField)
- Program.DeprecationManager.Warn(manifest.Name, $"{nameof(Manifest)}.{nameof(Manifest.Authour)}", "1.0", DeprecationLevel.Notice);
+ deprecationWarnings.Add(() => Program.DeprecationManager.Warn(manifest.Name, $"{nameof(Manifest)}.{nameof(Manifest.Authour)}", "1.0", DeprecationLevel.Notice));
}
catch (Exception ex)
{
@@ -439,7 +440,7 @@ namespace StardewModdingAPI
// create per-save directory
if (manifest.PerSaveConfigs)
{
- Program.DeprecationManager.Warn(manifest.Name, $"{nameof(Manifest)}.{nameof(Manifest.PerSaveConfigs)}", "1.0", DeprecationLevel.Info);
+ deprecationWarnings.Add(() => Program.DeprecationManager.Warn(manifest.Name, $"{nameof(Manifest)}.{nameof(Manifest.PerSaveConfigs)}", "1.0", DeprecationLevel.Info));
try
{
string psDir = Path.Combine(directory, "psconfigs");
@@ -541,6 +542,11 @@ namespace StardewModdingAPI
}
}
+ // log deprecation warnings
+ foreach (Action warning in deprecationWarnings)
+ warning();
+ deprecationWarnings = null;
+
// initialise mods
foreach (Mod mod in Program.ModRegistry.GetMods())
{