mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-22 00:21:34 +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)),
|
visibility: () => showIf(Decimal.lt(foundationProgress.value, computedMaxFoundation.value)),
|
||||||
canClick: () => {
|
canClick: () => {
|
||||||
if (Decimal.gt(computedMaxFoundation.value, foundationProgress.value)){
|
|
||||||
foundationProgress.value = Decimal.min(0, computedMaxFoundation.value)
|
|
||||||
}
|
|
||||||
if (Decimal.lt(trees.logs.value, foundationConversion.nextAt.value)) {
|
if (Decimal.lt(trees.logs.value, foundationConversion.nextAt.value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -146,6 +143,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
style: "width: 600px; min-height: unset"
|
style: "width: 600px; min-height: unset"
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
watchEffect(() => {
|
||||||
|
if (Decimal.lt(computedMaxFoundation.value, foundationProgress.value)) {
|
||||||
|
foundationProgress.value = Decimal.min(0, computedMaxFoundation.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const buildFoundationHK = createHotkey(() => ({
|
const buildFoundationHK = createHotkey(() => ({
|
||||||
key: "w",
|
key: "w",
|
||||||
description: "Build foundation",
|
description: "Build foundation",
|
||||||
|
|
Loading…
Reference in a new issue