Fix more duplicates

This commit is contained in:
ducdat0507 2022-12-22 19:10:02 +07:00
parent 44dba76068
commit d58a48f39d

View file

@ -7,7 +7,7 @@ import Spacer from "components/layout/Spacer.vue";
import { jsx } from "features/feature"; import { jsx } from "features/feature";
import { globalBus } from "game/events"; import { globalBus } from "game/events";
import { createLayer } from "game/layers"; 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 Decimal, { format, formatWhole } from "util/bignum";
import { Direction } from "util/common"; import { Direction } from "util/common";
import { computed, ComputedRef, reactive, ref, watchEffect } from "vue"; import { computed, ComputedRef, reactive, ref, watchEffect } from "vue";
@ -350,18 +350,6 @@ const factory = createLayer(id, () => {
return acc; return acc;
}, {} as Record<FactoryCompNames, GenericHotkey>); }, {} as Record<FactoryCompNames, GenericHotkey>);
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<FactoryCompNames, GenericHotkey>);
type FactoryCompNames = type FactoryCompNames =
| "cursor" | "cursor"
| "delete" | "delete"
@ -401,7 +389,6 @@ const factory = createLayer(id, () => {
interface FactoryComponentDeclaration { interface FactoryComponentDeclaration {
tick: number; tick: number;
key: string; key: string;
key: string;
imageSrc: string; imageSrc: string;
name: string; name: string;
type: "command" | "conveyor" | "processor"; type: "command" | "conveyor" | "processor";
@ -1241,6 +1228,7 @@ const factory = createLayer(id, () => {
tabs, tabs,
generalTabCollapsed, generalTabCollapsed,
modifiersModal, modifiersModal,
hotkeys,
display: jsx(() => <>{render(tabs)}</>) display: jsx(() => <>{render(tabs)}</>)
}; };
}); });