From d58a48f39dd79454be93f87f9fbc98b35f00a0f7 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Thu, 22 Dec 2022 19:10:02 +0700 Subject: [PATCH] Fix more duplicates --- src/data/layers/factory.tsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index d547004..de90859 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -7,7 +7,7 @@ import Spacer from "components/layout/Spacer.vue"; import { jsx } from "features/feature"; import { globalBus } from "game/events"; import { createLayer } from "game/layers"; -import { noPersist, noPersist, Persistent, persistent, State } from "game/persistence"; +import { noPersist, Persistent, persistent, State } from "game/persistence"; import Decimal, { format, formatWhole } from "util/bignum"; import { Direction } from "util/common"; import { computed, ComputedRef, reactive, ref, watchEffect } from "vue"; @@ -350,18 +350,6 @@ const factory = createLayer(id, () => { return acc; }, {} as Record); - const hotkeys = (Object.keys(FACTORY_COMPONENTS) as FactoryCompNames[]).reduce((acc, comp) => { - acc[comp] = createHotkey(() => ({ - key: FACTORY_COMPONENTS[comp].key, - description: "Select " + FACTORY_COMPONENTS[comp].name, - onPress() { - compSelected.value = comp; - }, - enabled: noPersist(main.days[day - 1].opened) - })); - return acc; - }, {} as Record); - type FactoryCompNames = | "cursor" | "delete" @@ -401,7 +389,6 @@ const factory = createLayer(id, () => { interface FactoryComponentDeclaration { tick: number; key: string; - key: string; imageSrc: string; name: string; type: "command" | "conveyor" | "processor"; @@ -1241,6 +1228,7 @@ const factory = createLayer(id, () => { tabs, generalTabCollapsed, modifiersModal, + hotkeys, display: jsx(() => <>{render(tabs)}) }; });