using MIU; namespace DiamondTimeViewer { internal class ConsoleCommands { private static void printUsage() { MIU.Console.Instance.Write("Usage: dtv [value]"); MIU.Console.Instance.Write("Possible values:"); MIU.Console.Instance.Write(" never Never show diamond times"); MIU.Console.Instance.Write(" diamond Show once you've achieved diamond time"); MIU.Console.Instance.Write(" gold Show once you've achieved gold time"); MIU.Console.Instance.Write(" always Always show diamond time"); MIU.Console.Instance.Write(""); MIU.Console.Instance.Write(" hideSilver Hide silver when showing diamond"); MIU.Console.Instance.Write(" showSilver Show silver always"); } [ConsoleCommand(description = "Configures the Diamond Time Viewer", paramsDescription = "[value]")] public static string dtv(params string[] args) { if (args.Length != 1) { printUsage(); return ""; } string value = args[0]; string message; switch (value) { case "never": Config.Mode = DisplayMode.Never; message = "mode set to: never"; break; case "diamond": Config.Mode = DisplayMode.Diamond; message = "mode set to: diamond"; break; case "gold": Config.Mode = DisplayMode.Gold; message = "mode set to: gold"; break; case "always": Config.Mode = DisplayMode.Always; message = "mode set to: always"; break; case "hideSilver": Config.HideSilver = true; message = "Hiding silver time"; break; case "showSilver": Config.HideSilver = false; message = "Showing silver time"; break; default: printUsage(); // Return early (no auto save) return ""; } Config.SaveConfig(); return message; } } }