2023-09-11 01:01:45 -04:00
|
|
|
|
using MIU;
|
|
|
|
|
|
|
|
|
|
namespace DiamondTimeViewer
|
|
|
|
|
{
|
|
|
|
|
internal class ConsoleCommands
|
|
|
|
|
{
|
|
|
|
|
private static void printUsage()
|
|
|
|
|
{
|
|
|
|
|
MIU.Console.Instance.Write("Usage: dtv [value]");
|
|
|
|
|
MIU.Console.Instance.Write("Possible values:");
|
2023-10-06 22:38:09 -04:00
|
|
|
|
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");
|
2023-09-11 01:01:45 -04:00
|
|
|
|
MIU.Console.Instance.Write("");
|
2023-10-06 22:38:09 -04:00
|
|
|
|
MIU.Console.Instance.Write(" hideSilver Hide silver when showing diamond");
|
|
|
|
|
MIU.Console.Instance.Write(" showSilver Show silver always");
|
2023-09-11 01:01:45 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[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];
|
|
|
|
|
|
2024-01-01 16:13:02 -05:00
|
|
|
|
string message;
|
|
|
|
|
|
2023-09-11 01:01:45 -04:00
|
|
|
|
switch (value)
|
|
|
|
|
{
|
|
|
|
|
case "never":
|
|
|
|
|
Config.Mode = DisplayMode.Never;
|
2024-01-01 16:13:02 -05:00
|
|
|
|
message = "mode set to: never";
|
|
|
|
|
break;
|
2023-09-11 01:01:45 -04:00
|
|
|
|
case "diamond":
|
|
|
|
|
Config.Mode = DisplayMode.Diamond;
|
2024-01-01 16:13:02 -05:00
|
|
|
|
message = "mode set to: diamond";
|
|
|
|
|
break;
|
2023-09-11 01:01:45 -04:00
|
|
|
|
case "gold":
|
|
|
|
|
Config.Mode = DisplayMode.Gold;
|
2024-01-01 16:13:02 -05:00
|
|
|
|
message = "mode set to: gold";
|
|
|
|
|
break;
|
2023-09-11 01:01:45 -04:00
|
|
|
|
case "always":
|
|
|
|
|
Config.Mode = DisplayMode.Always;
|
2024-01-01 16:13:02 -05:00
|
|
|
|
message = "mode set to: always";
|
|
|
|
|
break;
|
2023-10-06 22:38:09 -04:00
|
|
|
|
case "hideSilver":
|
|
|
|
|
Config.HideSilver = true;
|
2024-01-01 16:13:02 -05:00
|
|
|
|
message = "Hiding silver time";
|
|
|
|
|
break;
|
2023-10-06 22:38:09 -04:00
|
|
|
|
case "showSilver":
|
|
|
|
|
Config.HideSilver = false;
|
2024-01-01 16:13:02 -05:00
|
|
|
|
message = "Showing silver time";
|
|
|
|
|
break;
|
2023-09-11 01:01:45 -04:00
|
|
|
|
default:
|
|
|
|
|
printUsage();
|
2024-01-01 16:13:02 -05:00
|
|
|
|
// Return early (no auto save)
|
2023-09-11 01:01:45 -04:00
|
|
|
|
return "";
|
|
|
|
|
}
|
2024-01-01 16:13:02 -05:00
|
|
|
|
|
|
|
|
|
Config.SaveConfig();
|
|
|
|
|
return message;
|
2023-09-11 01:01:45 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|