Made level up notif say how many levels

This commit is contained in:
thepaperpilot 2023-05-12 08:30:44 -05:00
parent 852d138e0e
commit f5c1969e3a

View file

@ -157,8 +157,9 @@ export const main = createLayer("main", function (this: BaseLayer) {
watch(
() => resourceLevels.value[resource],
(level, prevLevel) => {
const diff = Decimal.sub(level, prevLevel);
if (
Decimal.gt(level, prevLevel) &&
Decimal.gt(diff, 0) &&
settings.active === player.id &&
Decimal.lte(level, 100)
) {
@ -172,6 +173,9 @@ export const main = createLayer("main", function (this: BaseLayer) {
)}`}
!
</h3>
{Decimal.gt(diff, 1) ? (
<div>Gained {formatWhole(diff)} levels</div>
) : null}
</div>
);
}