From 1fd1d32f434889d7e062d9eb8fcd38e4a81d0c17 Mon Sep 17 00:00:00 2001 From: Chunkybanana <62921243+chunkybanana@users.noreply.github.com> Date: Sun, 4 Dec 2022 02:30:32 +0000 Subject: [PATCH] hopefully made the hotkey work --- src/data/layers/workshop.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index 0d309d9..ea1131b 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -10,6 +10,7 @@ import { createIndependentConversion, createPolynomialScaling } from "features/c import { jsx, showIf } from "features/feature"; import { createMilestone } from "features/milestones/milestone"; import { createResource, displayResource } from "features/resources/resource"; +import { createHotkey } from "features/hotkey"; import { BaseLayer, createLayer } from "game/layers"; import player from "game/player"; import Decimal, { DecimalSource, formatWhole } from "util/bignum"; @@ -69,6 +70,14 @@ const layer = createLayer(id, function (this: BaseLayer) { style: "width: 600px; min-height: unset" })); + const buildFoundationHK = createHotkey(() => ({ + key: "w", + description: 'Build part of the foundation.', + onPress: () => { + if (buildFoundation.canClick.value) buildFoundation.onClick(); + } + })); + const logGainMilestone1 = createMilestone(() => ({ display: { requirement: "1% Foundation Completed", @@ -169,6 +178,7 @@ const layer = createLayer(id, function (this: BaseLayer) { foundationConversion, milestones, minWidth: 700, + buildFoundationHK, display: jsx(() => ( <>