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; float diamond = LevelSelect.instance.level.DiamondTime;
bool showDiamondTime = false; bool showDiamondTime = false;
switch (Config.Mode) if (diamond > 0.0f)
{ {
case DisplayMode.Always: switch (Config.Mode)
showDiamondTime = true; {
break; case DisplayMode.Always:
case DisplayMode.Diamond: showDiamondTime = true;
showDiamondTime = LevelSelect.instance.bestScore > 0f && LevelSelect.instance.bestScore <= diamond; break;
break; case DisplayMode.Diamond:
case DisplayMode.Gold: showDiamondTime = LevelSelect.instance.bestScore > 0f && LevelSelect.instance.bestScore <= diamond;
showDiamondTime = LevelSelect.instance.bestScore > 0f && LevelSelect.instance.bestScore <= gold; break;
break; case DisplayMode.Gold:
case DisplayMode.Never: showDiamondTime = LevelSelect.instance.bestScore > 0f && LevelSelect.instance.bestScore <= gold;
showDiamondTime = false; break;
break; case DisplayMode.Never:
showDiamondTime = false;
break;
}
} }
string spacingText = "<space=0.5em> "; string spacingText = "<space=0.5em> ";