diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-07-02 20:51:49 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-07-02 20:51:49 -0400 |
commit | 0e6d30f65b562704675a20b1c4ce399787a68511 (patch) | |
tree | 830ccbadf0c035035bf348700c6a4d5c591167ed /src/StardewModdingAPI | |
parent | 698328c52f60e6f825086585ef79f8c6eedb944e (diff) | |
download | SMAPI-0e6d30f65b562704675a20b1c4ce399787a68511.tar.gz SMAPI-0e6d30f65b562704675a20b1c4ce399787a68511.tar.bz2 SMAPI-0e6d30f65b562704675a20b1c4ce399787a68511.zip |
further simplify console output for players
Diffstat (limited to 'src/StardewModdingAPI')
-rw-r--r-- | src/StardewModdingAPI/Program.cs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index 37b821ef..70e53f5a 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -126,7 +126,7 @@ namespace StardewModdingAPI // init logging this.Monitor.Log($"SMAPI {Constants.ApiVersion} with Stardew Valley {Constants.GetGameDisplayVersion(Constants.GameVersion)} on {this.GetFriendlyPlatformName()}", LogLevel.Info); this.Monitor.Log($"Mods go here: {Constants.ModPath}"); - this.Monitor.Log("Preparing SMAPI..."); + this.Monitor.Log("Starting SMAPI..."); // validate paths this.VerifyPath(Constants.ModPath); @@ -361,7 +361,7 @@ namespace StardewModdingAPI // load mods { - this.Monitor.Log("Loading mod metadata..."); + this.Monitor.Log("Loading mod metadata...", LogLevel.Trace); ModResolver resolver = new ModResolver(); // load manifests @@ -445,7 +445,6 @@ namespace StardewModdingAPI private void RunConsoleLoop() { // prepare console - this.Monitor.Log("Starting console..."); this.Monitor.Log("Type 'help' for help, or 'help <cmd>' for a command's usage", LogLevel.Info); this.CommandManager.Add("SMAPI", "help", "Lists command documentation.\n\nUsage: help\nLists all available commands.\n\nUsage: help <cmd>\n- cmd: The name of a command whose documentation to display.", this.HandleCommand); this.CommandManager.Add("SMAPI", "reload_i18n", "Reloads translation files for all mods.\n\nUsage: reload_i18n", this.HandleCommand); @@ -580,7 +579,7 @@ namespace StardewModdingAPI /// <param name="deprecationWarnings">A list to populate with any deprecation warnings.</param> private void LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, SContentManager contentManager, IList<Action> deprecationWarnings) { - this.Monitor.Log("Loading mods..."); + this.Monitor.Log("Loading mods...", LogLevel.Trace); // load mod assemblies IDictionary<IModMetadata, string> skippedMods = new Dictionary<IModMetadata, string>(); @@ -810,8 +809,17 @@ namespace StardewModdingAPI } else { - this.Monitor.Log("The following commands are registered: " + string.Join(", ", this.CommandManager.GetAll().Select(p => p.Name)) + ".", LogLevel.Info); - this.Monitor.Log("For more information about a command, type 'help command_name'.", LogLevel.Info); + string message = "The following commands are registered:\n"; + IGrouping<string, string>[] groups = (from command in this.CommandManager.GetAll() orderby command.ModName, command.Name group command.Name by command.ModName).ToArray(); + foreach (var group in groups) + { + string modName = group.Key; + string[] commandNames = group.ToArray(); + message += $"{modName}:\n {string.Join("\n ", commandNames)}\n\n"; + } + message += "For more information about a command, type 'help command_name'."; + + this.Monitor.Log(message, LogLevel.Info); } break; |