diff --git a/src/components/features/Challenge.vue b/src/components/features/Challenge.vue index ef57ed0..38473d3 100644 --- a/src/components/features/Challenge.vue +++ b/src/components/features/Challenge.vue @@ -9,11 +9,15 @@ resetNotify: challenge.active, notify: challenge.active && challenge.canComplete, done: challenge.completed, + canStart: challenge.canStart, maxed: challenge.maxed }" >
- @@ -101,12 +105,11 @@ export default defineComponent({ min-height: 50px; width: 120px; border-radius: var(--border-radius); - cursor: pointer; box-shadow: none !important; background: transparent; } -.challenge.maxed button { - cursor: unset; +.challenge.canStart button { + cursor: pointer; } diff --git a/src/game/layers.ts b/src/game/layers.ts index e941fcb..6afb405 100644 --- a/src/game/layers.ts +++ b/src/game/layers.ts @@ -268,7 +268,9 @@ export function addLayer(layer: RawLayer, player?: Partial): void { setDefault(layer.challenges.data[id], "onComplete", undefined, false); setDefault(layer.challenges.data[id], "onEnter", undefined, false); setDefault(layer.challenges.data[id], "onExit", undefined, false); - setDefault(layer.challenges.data[id], "canStart", true); + setDefault(layer.challenges.data[id], "canStart", function() { + return Decimal.lt(this.completions, this.completionLimit); + }); setDefault(layer.challenges.data[id], "completionLimit", new Decimal(1)); setDefault(layer.challenges.data[id], "mark", function() { return Decimal.gt(this.completionLimit, 1) && this.maxed;