diff --git a/Config.cs b/Config.cs index 7dbf33b..fcbf48a 100644 --- a/Config.cs +++ b/Config.cs @@ -20,6 +20,7 @@ namespace DiamondTimeViewer public static bool Enabled = true; public static DisplayMode Mode = DisplayMode.Diamond; + public static bool HideSilver = false; public static void Init() { @@ -68,6 +69,9 @@ namespace DiamondTimeViewer break; } } + + if (data["hideSilver"] != null) + HideSilver = data["hideSilver"].AsBool; } public static void SaveConfig() @@ -89,6 +93,7 @@ namespace DiamondTimeViewer node.Add("mode", "always"); break; } + node.Add("hideSilver", HideSilver ? "true" : "false"); File.WriteAllText(GetConfigPath(), node.ToString()); } diff --git a/ConsoleCommands.cs b/ConsoleCommands.cs index 8a25ffd..9196961 100644 --- a/ConsoleCommands.cs +++ b/ConsoleCommands.cs @@ -8,16 +8,19 @@ namespace DiamondTimeViewer { 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(" 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(" enable Enable the mod"); - MIU.Console.Instance.Write(" disable Disable the mod entirely"); + MIU.Console.Instance.Write(" hideSilver Hide silver when showing diamond"); + MIU.Console.Instance.Write(" showSilver Show silver always"); MIU.Console.Instance.Write(""); - MIU.Console.Instance.Write(" save Saves the current config"); - MIU.Console.Instance.Write(" load Loads the config file"); + MIU.Console.Instance.Write(" enable Enable the mod"); + MIU.Console.Instance.Write(" disable Disable the mod (should be the same as \"never\" unless I messed up)"); + MIU.Console.Instance.Write(""); + MIU.Console.Instance.Write(" save Saves the current config"); + MIU.Console.Instance.Write(" load Loads the config file"); } [ConsoleCommand(description = "Configures the Diamond Time Viewer", paramsDescription = "[value]")] @@ -45,6 +48,12 @@ namespace DiamondTimeViewer case "always": Config.Mode = DisplayMode.Always; return "mode set to: always"; + case "hideSilver": + Config.HideSilver = true; + return "Hiding silver time"; + case "showSilver": + Config.HideSilver = false; + return "Showing silver time"; case "enable": Config.Enabled = true; return "Mod enabled"; diff --git a/Patches/MedalsDisplayPatches.cs b/Patches/MedalsDisplayPatches.cs index ecf1a00..67efe16 100644 --- a/Patches/MedalsDisplayPatches.cs +++ b/Patches/MedalsDisplayPatches.cs @@ -35,14 +35,22 @@ namespace DiamondTimeViewer.Patches } } + string silverText = " " + SegmentedTime.SPTimeText(silver); + string spacingText = " "; string diamondText = ""; if (showDiamondTime) { - spacingText = " "; + if (Config.HideSilver) + silverText = ""; + else + spacingText = " "; diamondText = spacingText + " " + SegmentedTime.SPTimeText(diamond, true); } + if (silverText != "") + silverText += spacingText; + bool hasEgg = eggUnlock != null && eggUnlock.Count > 0; bool gotEgg = hasEgg && UnlockManager.Get().IsUnlocked(eggUnlock[0]) && !CosmeticValues.WasPurchased(eggUnlock[0]); @@ -52,9 +60,7 @@ namespace DiamondTimeViewer.Patches __instance.MedalTimes.text = string.Concat(new string[] { - " ", - SegmentedTime.SPTimeText(silver), - spacingText, + silverText, " ", SegmentedTime.SPTimeText(gold), diamondText,