mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-21 16:13:57 +00:00
Begone side effects
This commit is contained in:
parent
87fa404662
commit
2a2790e13e
1 changed files with 6 additions and 3 deletions
|
@ -123,9 +123,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
)),
|
||||
visibility: () => showIf(Decimal.lt(foundationProgress.value, computedMaxFoundation.value)),
|
||||
canClick: () => {
|
||||
if (Decimal.gt(computedMaxFoundation.value, foundationProgress.value)){
|
||||
foundationProgress.value = Decimal.min(0, computedMaxFoundation.value)
|
||||
}
|
||||
if (Decimal.lt(trees.logs.value, foundationConversion.nextAt.value)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -146,6 +143,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
style: "width: 600px; min-height: unset"
|
||||
}));
|
||||
|
||||
watchEffect(() => {
|
||||
if (Decimal.lt(computedMaxFoundation.value, foundationProgress.value)) {
|
||||
foundationProgress.value = Decimal.min(0, computedMaxFoundation.value);
|
||||
}
|
||||
});
|
||||
|
||||
const buildFoundationHK = createHotkey(() => ({
|
||||
key: "w",
|
||||
description: "Build foundation",
|
||||
|
|
Loading…
Reference in a new issue