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",
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(() => ({

View file

@ -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(() => ({

View file

@ -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({

View file

@ -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);