Only show diamond time if it exists

This commit is contained in:
Terry Hearst 2023-10-06 21:07:00 -04:00
parent 692e423223
commit b93dc95c4a

View file

@ -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 = "<space=0.5em> ";