Fix hotkeys breaking shit

This commit is contained in:
thepaperpilot 2022-12-21 22:53:16 -06:00
parent 10482aaf90
commit 8772617fa4
6 changed files with 11 additions and 11 deletions

View file

@ -213,7 +213,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
onPress: () => { onPress: () => {
if (breeding.canClick.value) breeding.onClick(); if (breeding.canClick.value) breeding.onClick();
}, },
enabled: main.days[day - 1].opened enabled: noPersist(main.days[day - 1].opened)
})); }));
const shearSheepHK = createHotkey(() => ({ const shearSheepHK = createHotkey(() => ({
@ -222,7 +222,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
onPress: () => { onPress: () => {
if (shearing.canClick.value) shearing.onClick(); if (shearing.canClick.value) shearing.onClick();
}, },
enabled: main.days[day - 1].opened enabled: noPersist(main.days[day - 1].opened)
})); }));
const spinWoolHK = createHotkey(() => ({ const spinWoolHK = createHotkey(() => ({
@ -231,7 +231,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
onPress: () => { onPress: () => {
if (spinning.canClick.value) spinning.onClick(); if (spinning.canClick.value) spinning.onClick();
}, },
enabled: main.days[day - 1].opened enabled: noPersist(main.days[day - 1].opened)
})); }));
const buildPens = createBuyable(() => ({ const buildPens = createBuyable(() => ({

View file

@ -20,7 +20,7 @@ import {
createSequentialModifier, createSequentialModifier,
Modifier Modifier
} from "game/modifiers"; } from "game/modifiers";
import { persistent } from "game/persistence"; import { noPersist, persistent } from "game/persistence";
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
import { WithRequired } from "util/common"; import { WithRequired } from "util/common";
import { Computable, convertComputable } from "util/computed"; import { Computable, convertComputable } from "util/computed";
@ -371,7 +371,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
onPress: () => { onPress: () => {
if (unref(buyable.canClick)) buyable.onClick(); if (unref(buyable.canClick)) buyable.onClick();
}, },
enabled: main.days[day - 1].opened enabled: noPersist(main.days[day - 1].opened)
})); }));
const visibility = convertComputable(options.visibility ?? Visibility.Visible); const visibility = convertComputable(options.visibility ?? Visibility.Visible);

View file

@ -15,7 +15,7 @@ import { createMilestone } from "features/milestones/milestone";
import { createResource } from "features/resources/resource"; import { createResource } from "features/resources/resource";
import { BaseLayer, createLayer } from "game/layers"; import { BaseLayer, createLayer } from "game/layers";
import { createMultiplicativeModifier, createSequentialModifier } from "game/modifiers"; import { createMultiplicativeModifier, createSequentialModifier } from "game/modifiers";
import { persistent } from "game/persistence"; import { noPersist, persistent } from "game/persistence";
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
import { Direction } from "util/common"; import { Direction } from "util/common";
import { render, renderRow } from "util/vue"; import { render, renderRow } from "util/vue";
@ -93,7 +93,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
onPress: () => { onPress: () => {
if (process.canClick.value) process.onClick(); if (process.canClick.value) process.onClick();
}, },
enabled: main.days[day - 1].opened enabled: noPersist(main.days[day - 1].opened)
})); }));
const metalBuyable = createBuyable(() => ({ const metalBuyable = createBuyable(() => ({

View file

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

View file

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

View file

@ -60,7 +60,7 @@ export interface Day extends VueFeature {
story: string; story: string;
completedStory: string; completedStory: string;
masteredStory: string; masteredStory: string;
opened: Ref<boolean>; opened: Persistent<boolean>;
recentlyUpdated: Ref<boolean>; // Has the tab recieved an update since the player last opened it? recentlyUpdated: Ref<boolean>; // Has the tab recieved an update since the player last opened it?
shouldNotify: ProcessedComputable<boolean>; shouldNotify: ProcessedComputable<boolean>;
} }