From 719831c15a74a4987496dc77a3caa6999940bf90 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 9 May 2020 10:58:10 -0400 Subject: sort mod warning lists --- src/SMAPI/Framework/SCore.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/SMAPI/Framework') 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 match, LogLevel level, string heading, string[] blurb, Func 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(); } -- cgit