summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release-notes.md1
-rw-r--r--src/StardewModdingAPI/Program.cs10
2 files changed, 9 insertions, 2 deletions
diff --git a/release-notes.md b/release-notes.md
index 74cd8c9d..635abccb 100644
--- a/release-notes.md
+++ b/release-notes.md
@@ -9,6 +9,7 @@ For players:
For mod developers:
* Added a mod registry which provides metadata about loaded mods (see `helper.ModRegistry`).
* `Mod.Entry()` is now only called once all mods have loaded.
+* Deprecation warnings are now logged after the list of loaded mods.
* Fixed `SaveEvents.BeforeSave` and `SaveEvents.AfterSave` not triggering on days when the player shipped something.
* Fixed `PlayerEvents.LoadedGame` and `SaveEvents.AfterLoad` being fired before the world finishes initialising.
* Fixed some `LocationEvents`, `PlayerEvents`, and `TimeEvents` being fired during game startup.
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())
{