diff options
-rw-r--r-- | docs/release-notes.md | 3 | ||||
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 13 |
2 files changed, 8 insertions, 8 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index ee8bd468..f12455bd 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -2,6 +2,9 @@ # Release notes ## Upcoming released +* For players: + * Mod warnings are now listed alphabetically. + * For modders: * Added `Multiplayer.PeerConnected` event. * Simplified paranoid warnings in the log and reduced their log level. diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 8c9424c1..cd292bfc 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -1205,10 +1205,12 @@ namespace StardewModdingAPI.Framework private void LogModWarningGroup(IModMetadata[] mods, Func<IModMetadata, bool> match, LogLevel level, string heading, string[] blurb, Func<IModMetadata, string> modLabel = null) { // get matching mods - IModMetadata[] matches = mods + string[] modLabels = mods .Where(match) + .Select(mod => modLabel?.Invoke(mod) ?? mod.DisplayName) + .OrderBy(p => p) .ToArray(); - if (!matches.Any()) + if (!modLabels.Any()) return; // log header/blurb @@ -1219,13 +1221,8 @@ namespace StardewModdingAPI.Framework this.Monitor.Newline(); // log mod list - foreach (IModMetadata modMatch in matches) - { - string label = modLabel != null - ? modLabel(modMatch) - : modMatch.DisplayName; + foreach (string label in modLabels) this.Monitor.Log($" - {label}", level); - } this.Monitor.Newline(); } |