This commit is contained in:
thepaperpilot 2024-12-12 07:39:10 -06:00
parent ff14443102
commit 7f2fa9cc27
7 changed files with 16 additions and 19 deletions

View file

@ -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<number | "cNode"> };

View file

@ -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<DecimalSource>(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);

View file

@ -50,8 +50,7 @@ export interface AchievementOptions extends VueFeatureOptions {
requirements?: Requirements;
/** The display to use for this achievement. */
display?:
| Renderable
| (() => Renderable)
| MaybeGetter<Renderable>
| {
/** Description of the requirement(s) for this achievement. If unspecified then the requirements will be displayed automatically based on {@link requirements}. */
requirement?: MaybeGetter<Renderable>;

View file

@ -39,8 +39,7 @@ export interface ChallengeOptions extends VueFeatureOptions {
completionLimit?: MaybeRefOrGetter<DecimalSource>;
/** The display to use for this challenge. */
display?:
| Renderable
| (() => Renderable)
| MaybeGetter<Renderable>
| {
/** A header to appear at the top of the display. */
title?: MaybeGetter<Renderable>;

View file

@ -24,8 +24,7 @@ export interface ClickableOptions extends VueFeatureOptions {
canClick?: MaybeRefOrGetter<boolean>;
/** The display to use for this clickable. */
display?:
| Renderable
| (() => Renderable)
| MaybeGetter<Renderable>
| {
/** A header to appear at the top of the display. */
title?: MaybeGetter<Renderable>;
@ -67,10 +66,14 @@ export function createClickable<T extends ClickableOptions>(optionsFunc?: () =>
<span>
{_display.title != null ? (
<div>
{render(_display.title, el => <h3>{el}</h3>)}
{render(_display.title, el => (
<h3>{el}</h3>
))}
</div>
) : null}
{render(_display.description, el => <div>{el}</div>)}
{render(_display.description, el => (
<div>{el}</div>
))}
</span>
);
} else if (_display != null) {

View file

@ -31,8 +31,7 @@ export interface RepeatableOptions extends ClickableOptions {
initialAmount?: DecimalSource;
/** The display to use for this repeatable. */
display?:
| Renderable
| (() => Renderable)
| MaybeGetter<Renderable>
| {
/** A header to appear at the top of the display. */
title?: MaybeGetter<Renderable>;

View file

@ -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<Renderable>
| {
/** A header to appear at the top of the display. */
title?: MaybeGetter<Renderable>;