diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-09 10:58:10 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-09 10:58:10 -0400 |
commit | 719831c15a74a4987496dc77a3caa6999940bf90 (patch) | |
tree | fc6c480136ee96ee47152928edc69de74a3e9370 /src/SMAPI/Framework | |
parent | d8d8cac2d89c27c6d28be444cebaabf0e2077a53 (diff) | |
download | SMAPI-719831c15a74a4987496dc77a3caa6999940bf90.tar.gz SMAPI-719831c15a74a4987496dc77a3caa6999940bf90.tar.bz2 SMAPI-719831c15a74a4987496dc77a3caa6999940bf90.zip |
sort mod warning lists
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 13 |
1 files changed, 5 insertions, 8 deletions
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(); } |