Made hotkeys only appear when day is unlocked

This commit is contained in:
thepaperpilot 2022-12-19 07:31:28 -06:00
parent ba34b7b581
commit 17fe735d82
4 changed files with 14 additions and 7 deletions

View file

@ -181,7 +181,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: "Breed sheep", description: "Breed sheep",
onPress: () => { onPress: () => {
if (breeding.canClick.value) breeding.onClick(); if (breeding.canClick.value) breeding.onClick();
} },
enabled: main.days[day - 1].opened
})); }));
const shearSheepHK = createHotkey(() => ({ const shearSheepHK = createHotkey(() => ({
@ -189,7 +190,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: "Shear sheep", description: "Shear sheep",
onPress: () => { onPress: () => {
if (shearing.canClick.value) shearing.onClick(); if (shearing.canClick.value) shearing.onClick();
} },
enabled: main.days[day - 1].opened
})); }));
const spinWoolHK = createHotkey(() => ({ const spinWoolHK = createHotkey(() => ({
@ -197,7 +199,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: "Spin wool", description: "Spin wool",
onPress: () => { onPress: () => {
if (spinning.canClick.value) spinning.onClick(); if (spinning.canClick.value) spinning.onClick();
} },
enabled: main.days[day - 1].opened
})); }));
const buildPens = createBuyable(() => ({ const buildPens = createBuyable(() => ({

View file

@ -88,7 +88,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: "Process letters", description: "Process letters",
onPress: () => { onPress: () => {
if (process.canClick.value) process.onClick(); if (process.canClick.value) process.onClick();
} },
enabled: main.days[day - 1].opened
})); }));
const metalBuyable = createBuyable(() => ({ const metalBuyable = createBuyable(() => ({

View file

@ -804,14 +804,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: "Cut trees", description: "Cut trees",
onPress: () => { onPress: () => {
if (cutTree.canClick.value) cutTree.onClick(); if (cutTree.canClick.value) cutTree.onClick();
} },
enabled: main.days[day - 1].opened
})); }));
const plantTreeHK = createHotkey(() => ({ const plantTreeHK = createHotkey(() => ({
key: "p", key: "p",
description: "Plant trees", description: "Plant trees",
onPress: () => { onPress: () => {
if (plantTree.canClick.value) plantTree.onClick(); if (plantTree.canClick.value) plantTree.onClick();
} },
enabled: main.days[day - 1].opened
})); }));
const { total: totalLogs, trackerDisplay } = setUpDailyProgressTracker({ const { total: totalLogs, trackerDisplay } = setUpDailyProgressTracker({

View file

@ -136,7 +136,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: "Build foundation", description: "Build foundation",
onPress: () => { onPress: () => {
if (buildFoundation.canClick.value) buildFoundation.onClick(); if (buildFoundation.canClick.value) buildFoundation.onClick();
} },
enabled: main.days[day - 1].opened
})); }));
const shouldShowPopups = computed(() => !elves.milestones[6].earned.value); const shouldShowPopups = computed(() => !elves.milestones[6].earned.value);