Properly handle spacing

This commit is contained in:
Terry Hearst 2023-10-05 00:33:04 -04:00
parent c94edcb777
commit 582a5fabac

View file

@ -17,13 +17,6 @@ namespace DiamondTimeViewer.Patches
// Get diamond time (since it is not passed in as a parameter) // Get diamond time (since it is not passed in as a parameter)
float diamond = LevelSelect.instance.level.DiamondTime; float diamond = LevelSelect.instance.level.DiamondTime;
bool hasEgg = eggUnlock != null && eggUnlock.Count > 0;
bool gotEgg = hasEgg && UnlockManager.Get().IsUnlocked(eggUnlock[0]) && !CosmeticValues.WasPurchased(eggUnlock[0]);
string eggText = "";
if (hasEgg)
eggText = (gotEgg ? "<space=0.5em> <sprite=9>" : "<space=0.5em> <sprite=8>");
bool showDiamondTime = false; bool showDiamondTime = false;
switch (Config.Mode) switch (Config.Mode)
{ {
@ -41,14 +34,26 @@ namespace DiamondTimeViewer.Patches
break; break;
} }
string spacingText = "<space=0.5em> ";
string diamondText = ""; string diamondText = "";
if (showDiamondTime) if (showDiamondTime)
diamondText = "<sprite=3> " + SegmentedTime.SPTimeText(diamond); {
spacingText = "<space=0.25em> ";
diamondText = spacingText + "<sprite=3> " + SegmentedTime.SPTimeText(diamond);
}
bool hasEgg = eggUnlock != null && eggUnlock.Count > 0;
bool gotEgg = hasEgg && UnlockManager.Get().IsUnlocked(eggUnlock[0]) && !CosmeticValues.WasPurchased(eggUnlock[0]);
string eggText = "";
if (hasEgg)
eggText = spacingText + (gotEgg ? "<sprite=9>" : "<sprite=8>");
__instance.MedalTimes.text = string.Concat(new string[] __instance.MedalTimes.text = string.Concat(new string[]
{ {
"<sprite=1> ", "<sprite=1> ",
SegmentedTime.SPTimeText(silver), SegmentedTime.SPTimeText(silver),
spacingText,
"<sprite=2> ", "<sprite=2> ",
SegmentedTime.SPTimeText(gold), SegmentedTime.SPTimeText(gold),
diamondText, diamondText,