From b93dc95c4a26f8abc38b177703529f5a2492d63a Mon Sep 17 00:00:00 2001 From: Terry Hearst Date: Fri, 6 Oct 2023 21:07:00 -0400 Subject: [PATCH] Only show diamond time if it exists --- Patches/MedalsDisplayPatches.cs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Patches/MedalsDisplayPatches.cs b/Patches/MedalsDisplayPatches.cs index 75269e7..4e6acd6 100644 --- a/Patches/MedalsDisplayPatches.cs +++ b/Patches/MedalsDisplayPatches.cs @@ -18,20 +18,23 @@ namespace DiamondTimeViewer.Patches float diamond = LevelSelect.instance.level.DiamondTime; bool showDiamondTime = false; - switch (Config.Mode) + if (diamond > 0.0f) { - case DisplayMode.Always: - showDiamondTime = true; - break; - case DisplayMode.Diamond: - showDiamondTime = LevelSelect.instance.bestScore > 0f && LevelSelect.instance.bestScore <= diamond; - break; - case DisplayMode.Gold: - showDiamondTime = LevelSelect.instance.bestScore > 0f && LevelSelect.instance.bestScore <= gold; - break; - case DisplayMode.Never: - showDiamondTime = false; - break; + switch (Config.Mode) + { + case DisplayMode.Always: + showDiamondTime = true; + break; + case DisplayMode.Diamond: + showDiamondTime = LevelSelect.instance.bestScore > 0f && LevelSelect.instance.bestScore <= diamond; + break; + case DisplayMode.Gold: + showDiamondTime = LevelSelect.instance.bestScore > 0f && LevelSelect.instance.bestScore <= gold; + break; + case DisplayMode.Never: + showDiamondTime = false; + break; + } } string spacingText = " ";