Change <0% GC/reindeer chance formatting to show <1% instead.

This commit is contained in:
Kevin Radloff
2025-02-25 17:40:00 -05:00
committed by Daniël van Noord
parent 13dd628623
commit 270190feae
5 changed files with 22 additions and 10 deletions

View File

@@ -133,9 +133,15 @@ export function UpdateTimerBar() {
updateChanceTotal(chanceToSpawn);
l('CMTimerBarGCTime').textContent = `${Math.ceil(
(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps,
)} ${getChanceFinal() < 0.01 ? '<' : ''}${getChanceFinal().toLocaleString('en', {
style: 'percent',
})}`;
)} `;
if (getChanceFinal() < 0.01) {
l('CMTimerBarGCTime').textContent +=
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
} else {
l('CMTimerBarGCTime').textContent += getChanceFinal().toLocaleString('en', {
style: 'percent',
});
}
numberOfTimers += 1;
} else l('CMTimerBarGC').style.display = 'none';
@@ -177,9 +183,15 @@ export function UpdateTimerBar() {
updateChanceTotalDeer(chanceToSpawn);
l('CMTimerBarRenTime').textContent = `${Math.ceil(
(Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps,
)} ${getChanceFinalDeer() < 0.01 ? '<' : ''}${getChanceFinalDeer().toLocaleString('en', {
style: 'percent',
})}`;
)} `;
if (getChanceFinalDeer() < 0.01) {
l('CMTimerBarRenTime').textContent +=
`<${(0.01).toLocaleString('en', { style: 'percent' })}`;
} else {
l('CMTimerBarRenTime').textContent += getChanceFinalDeer().toLocaleString('en', {
style: 'percent',
});
}
numberOfTimers += 1;
} else {
l('CMTimerBarRen').style.display = 'none';