From 5718abc01345412a23059a911b4a0a6f9e3af76e Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Thu, 12 Dec 2024 07:39:10 -0600 Subject: [PATCH] Cleanup --- src/data/layers/prestige.tsx | 4 ++-- src/data/projEntry.tsx | 6 +++--- src/features/achievements/achievement.tsx | 3 +-- src/features/challenges/challenge.tsx | 3 +-- src/features/clickables/clickable.tsx | 3 +-- src/features/clickables/repeatable.tsx | 3 +-- src/features/clickables/upgrade.tsx | 3 +-- 7 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/data/layers/prestige.tsx b/src/data/layers/prestige.tsx index f136c19..a065db1 100644 --- a/src/data/layers/prestige.tsx +++ b/src/data/layers/prestige.tsx @@ -9,14 +9,14 @@ import { createReset } from "features/reset"; import MainDisplay from "features/resources/MainDisplay.vue"; import { createResource } from "features/resources/resource"; import { createResourceTooltip } from "features/trees/tree"; -import { BaseLayer, createLayer } from "game/layers"; +import { createLayer } from "game/layers"; import type { DecimalSource } from "util/bignum"; import { render } from "util/vue"; import { addTooltip } from "wrappers/tooltips/tooltip"; import { createLayerTreeNode, createResetButton } from "../common"; const id = "p"; -const layer = createLayer(id, function (this: BaseLayer) { +const layer = createLayer(id, () => { const name = "Prestige"; const color = "#4BDC13"; const points = createResource(0, "prestige points"); diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index b129c2f..e1a5d9d 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -3,7 +3,7 @@ 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 } from "game/layers"; import player, { Player } from "game/player"; import type { DecimalSource } from "util/bignum"; @@ -15,7 +15,7 @@ import prestige from "./layers/prestige"; /** * @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); @@ -25,7 +25,7 @@ export const main = createLayer("main", function (this: BaseLayer) { let gain = new Decimal(1); 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 309a3b4..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; 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;