diff --git a/src/data/layers/board.tsx b/src/data/layers/board.tsx index d663598..4bfcd1f 100644 --- a/src/data/layers/board.tsx +++ b/src/data/layers/board.tsx @@ -14,7 +14,6 @@ import { setupDraggableNode, setupUniqueIds } from "game/boards/board"; -import type { BaseLayer } from "game/layers"; import { createLayer } from "game/layers"; import { persistent } from "game/persistence"; import { createCostRequirement } from "game/requirements"; @@ -22,7 +21,7 @@ import { render } from "util/vue"; import { ComponentPublicInstance, computed, ref, watch } from "vue"; import { setupSelectable } from "../common"; -const board = createLayer("board", function (this: BaseLayer) { +const board = createLayer("board", () => { type ANode = NodePosition & { id: number; links: number[]; type: "anode"; z: number }; type BNode = NodePosition & { id: number; links: number[]; type: "bnode"; z: number }; type CNode = typeof cNode & { draggable: Draggable }; diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index 3490795..9139e28 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -3,9 +3,9 @@ import Profectus from "components/Profectus.vue"; import Spacer from "components/layout/Spacer.vue"; import { createResource, trackBest, trackOOMPS, trackTotal } from "features/resources/resource"; import { branchedResetPropagation, createTree, Tree } from "features/trees/tree"; -import { globalBus } from "game/events"; -import type { BaseLayer, Layer } from "game/layers"; +import type { Layer } from "game/layers"; import { createLayer, setupLayerModal } from "game/layers"; +import { noPersist } from "game/persistence"; import player, { Player } from "game/player"; import type { DecimalSource } from "util/bignum"; import Decimal, { format, formatTime } from "util/bignum"; @@ -15,12 +15,11 @@ import a from "./layers/aca/a"; import c from "./layers/aca/c"; import f from "./layers/aca/f"; import board from "./layers/board"; -import { noPersist } from "game/persistence"; /** * @hidden */ -export const main = createLayer("main", function (this: BaseLayer) { +export const main = createLayer("main", layer => { const points = createResource(10); const best = trackBest(points); const total = trackTotal(points); @@ -32,7 +31,7 @@ export const main = createLayer("main", function (this: BaseLayer) { gain = gain.times(c.lollipopMultiplierEffect.value); return gain; }); - globalBus.on("update", diff => { + layer.on("update", diff => { points.value = Decimal.add(points.value, Decimal.times(pointGain.value, diff)); }); const oomps = trackOOMPS(points, pointGain); diff --git a/src/features/achievements/achievement.tsx b/src/features/achievements/achievement.tsx index ed97ffe..5997ff8 100644 --- a/src/features/achievements/achievement.tsx +++ b/src/features/achievements/achievement.tsx @@ -50,8 +50,7 @@ export interface AchievementOptions extends VueFeatureOptions { requirements?: Requirements; /** The display to use for this achievement. */ display?: - | Renderable - | (() => Renderable) + | MaybeGetter | { /** Description of the requirement(s) for this achievement. If unspecified then the requirements will be displayed automatically based on {@link requirements}. */ requirement?: MaybeGetter; diff --git a/src/features/challenges/challenge.tsx b/src/features/challenges/challenge.tsx index 3d18f01..213ff6d 100644 --- a/src/features/challenges/challenge.tsx +++ b/src/features/challenges/challenge.tsx @@ -39,8 +39,7 @@ export interface ChallengeOptions extends VueFeatureOptions { completionLimit?: MaybeRefOrGetter; /** The display to use for this challenge. */ display?: - | Renderable - | (() => Renderable) + | MaybeGetter | { /** A header to appear at the top of the display. */ title?: MaybeGetter; diff --git a/src/features/clickables/clickable.tsx b/src/features/clickables/clickable.tsx index 98dab9a..12e9022 100644 --- a/src/features/clickables/clickable.tsx +++ b/src/features/clickables/clickable.tsx @@ -24,8 +24,7 @@ export interface ClickableOptions extends VueFeatureOptions { canClick?: MaybeRefOrGetter; /** The display to use for this clickable. */ display?: - | Renderable - | (() => Renderable) + | MaybeGetter | { /** A header to appear at the top of the display. */ title?: MaybeGetter; @@ -67,10 +66,14 @@ export function createClickable(optionsFunc?: () => {_display.title != null ? (
- {render(_display.title, el =>

{el}

)} + {render(_display.title, el => ( +

{el}

+ ))}
) : null} - {render(_display.description, el =>
{el}
)} + {render(_display.description, el => ( +
{el}
+ ))}
); } else if (_display != null) { diff --git a/src/features/clickables/repeatable.tsx b/src/features/clickables/repeatable.tsx index c4e6c0f..4f36c5f 100644 --- a/src/features/clickables/repeatable.tsx +++ b/src/features/clickables/repeatable.tsx @@ -31,8 +31,7 @@ export interface RepeatableOptions extends ClickableOptions { initialAmount?: DecimalSource; /** The display to use for this repeatable. */ display?: - | Renderable - | (() => Renderable) + | MaybeGetter | { /** A header to appear at the top of the display. */ title?: MaybeGetter; diff --git a/src/features/clickables/upgrade.tsx b/src/features/clickables/upgrade.tsx index 4c299cd..1eed690 100644 --- a/src/features/clickables/upgrade.tsx +++ b/src/features/clickables/upgrade.tsx @@ -34,8 +34,7 @@ export const UpgradeType = Symbol("Upgrade"); export interface UpgradeOptions extends VueFeatureOptions, ClickableOptions { /** The display to use for this upgrade. */ display?: - | Renderable - | (() => Renderable) + | MaybeGetter | { /** A header to appear at the top of the display. */ title?: MaybeGetter;