From 17fe735d82a6af38ed9ee7e32132ce70979a0b22 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 19 Dec 2022 07:31:28 -0600 Subject: [PATCH] Made hotkeys only appear when day is unlocked --- src/data/layers/cloth.tsx | 9 ++++++--- src/data/layers/letters.tsx | 3 ++- src/data/layers/trees.tsx | 6 ++++-- src/data/layers/workshop.tsx | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index 61a78d7..3d041bb 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -181,7 +181,8 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Breed sheep", onPress: () => { if (breeding.canClick.value) breeding.onClick(); - } + }, + enabled: main.days[day - 1].opened })); const shearSheepHK = createHotkey(() => ({ @@ -189,7 +190,8 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Shear sheep", onPress: () => { if (shearing.canClick.value) shearing.onClick(); - } + }, + enabled: main.days[day - 1].opened })); const spinWoolHK = createHotkey(() => ({ @@ -197,7 +199,8 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Spin wool", onPress: () => { if (spinning.canClick.value) spinning.onClick(); - } + }, + enabled: main.days[day - 1].opened })); const buildPens = createBuyable(() => ({ diff --git a/src/data/layers/letters.tsx b/src/data/layers/letters.tsx index 6ed2210..fb50263 100644 --- a/src/data/layers/letters.tsx +++ b/src/data/layers/letters.tsx @@ -88,7 +88,8 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Process letters", onPress: () => { if (process.canClick.value) process.onClick(); - } + }, + enabled: main.days[day - 1].opened })); const metalBuyable = createBuyable(() => ({ diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 7766d08..7a9f594 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -804,14 +804,16 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Cut trees", onPress: () => { if (cutTree.canClick.value) cutTree.onClick(); - } + }, + enabled: main.days[day - 1].opened })); const plantTreeHK = createHotkey(() => ({ key: "p", description: "Plant trees", onPress: () => { if (plantTree.canClick.value) plantTree.onClick(); - } + }, + enabled: main.days[day - 1].opened })); const { total: totalLogs, trackerDisplay } = setUpDailyProgressTracker({ diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index 7df7ef6..6b9ee63 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -136,7 +136,8 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Build foundation", onPress: () => { if (buildFoundation.canClick.value) buildFoundation.onClick(); - } + }, + enabled: main.days[day - 1].opened })); const shouldShowPopups = computed(() => !elves.milestones[6].earned.value);