Cleanup
This commit is contained in:
parent
3a69603031
commit
5718abc013
7 changed files with 10 additions and 15 deletions
|
@ -9,14 +9,14 @@ import { createReset } from "features/reset";
|
||||||
import MainDisplay from "features/resources/MainDisplay.vue";
|
import MainDisplay from "features/resources/MainDisplay.vue";
|
||||||
import { createResource } from "features/resources/resource";
|
import { createResource } from "features/resources/resource";
|
||||||
import { createResourceTooltip } from "features/trees/tree";
|
import { createResourceTooltip } from "features/trees/tree";
|
||||||
import { BaseLayer, createLayer } from "game/layers";
|
import { createLayer } from "game/layers";
|
||||||
import type { DecimalSource } from "util/bignum";
|
import type { DecimalSource } from "util/bignum";
|
||||||
import { render } from "util/vue";
|
import { render } from "util/vue";
|
||||||
import { addTooltip } from "wrappers/tooltips/tooltip";
|
import { addTooltip } from "wrappers/tooltips/tooltip";
|
||||||
import { createLayerTreeNode, createResetButton } from "../common";
|
import { createLayerTreeNode, createResetButton } from "../common";
|
||||||
|
|
||||||
const id = "p";
|
const id = "p";
|
||||||
const layer = createLayer(id, function (this: BaseLayer) {
|
const layer = createLayer(id, () => {
|
||||||
const name = "Prestige";
|
const name = "Prestige";
|
||||||
const color = "#4BDC13";
|
const color = "#4BDC13";
|
||||||
const points = createResource<DecimalSource>(0, "prestige points");
|
const points = createResource<DecimalSource>(0, "prestige points");
|
||||||
|
|
|
@ -3,7 +3,7 @@ import Spacer from "components/layout/Spacer.vue";
|
||||||
import { createResource, trackBest, trackOOMPS, trackTotal } from "features/resources/resource";
|
import { createResource, trackBest, trackOOMPS, trackTotal } from "features/resources/resource";
|
||||||
import { branchedResetPropagation, createTree, Tree } from "features/trees/tree";
|
import { branchedResetPropagation, createTree, Tree } from "features/trees/tree";
|
||||||
import { globalBus } from "game/events";
|
import { globalBus } from "game/events";
|
||||||
import type { BaseLayer, Layer } from "game/layers";
|
import type { Layer } from "game/layers";
|
||||||
import { createLayer } from "game/layers";
|
import { createLayer } from "game/layers";
|
||||||
import player, { Player } from "game/player";
|
import player, { Player } from "game/player";
|
||||||
import type { DecimalSource } from "util/bignum";
|
import type { DecimalSource } from "util/bignum";
|
||||||
|
@ -15,7 +15,7 @@ import prestige from "./layers/prestige";
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
export const main = createLayer("main", function (this: BaseLayer) {
|
export const main = createLayer("main", layer => {
|
||||||
const points = createResource<DecimalSource>(10);
|
const points = createResource<DecimalSource>(10);
|
||||||
const best = trackBest(points);
|
const best = trackBest(points);
|
||||||
const total = trackTotal(points);
|
const total = trackTotal(points);
|
||||||
|
@ -25,7 +25,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
||||||
let gain = new Decimal(1);
|
let gain = new Decimal(1);
|
||||||
return gain;
|
return gain;
|
||||||
});
|
});
|
||||||
globalBus.on("update", diff => {
|
layer.on("update", diff => {
|
||||||
points.value = Decimal.add(points.value, Decimal.times(pointGain.value, diff));
|
points.value = Decimal.add(points.value, Decimal.times(pointGain.value, diff));
|
||||||
});
|
});
|
||||||
const oomps = trackOOMPS(points, pointGain);
|
const oomps = trackOOMPS(points, pointGain);
|
||||||
|
|
|
@ -50,8 +50,7 @@ export interface AchievementOptions extends VueFeatureOptions {
|
||||||
requirements?: Requirements;
|
requirements?: Requirements;
|
||||||
/** The display to use for this achievement. */
|
/** The display to use for this achievement. */
|
||||||
display?:
|
display?:
|
||||||
| Renderable
|
| MaybeGetter<Renderable>
|
||||||
| (() => Renderable)
|
|
||||||
| {
|
| {
|
||||||
/** Description of the requirement(s) for this achievement. If unspecified then the requirements will be displayed automatically based on {@link requirements}. */
|
/** Description of the requirement(s) for this achievement. If unspecified then the requirements will be displayed automatically based on {@link requirements}. */
|
||||||
requirement?: MaybeGetter<Renderable>;
|
requirement?: MaybeGetter<Renderable>;
|
||||||
|
|
|
@ -39,8 +39,7 @@ export interface ChallengeOptions extends VueFeatureOptions {
|
||||||
completionLimit?: MaybeRefOrGetter<DecimalSource>;
|
completionLimit?: MaybeRefOrGetter<DecimalSource>;
|
||||||
/** The display to use for this challenge. */
|
/** The display to use for this challenge. */
|
||||||
display?:
|
display?:
|
||||||
| Renderable
|
| MaybeGetter<Renderable>
|
||||||
| (() => Renderable)
|
|
||||||
| {
|
| {
|
||||||
/** A header to appear at the top of the display. */
|
/** A header to appear at the top of the display. */
|
||||||
title?: MaybeGetter<Renderable>;
|
title?: MaybeGetter<Renderable>;
|
||||||
|
|
|
@ -24,8 +24,7 @@ export interface ClickableOptions extends VueFeatureOptions {
|
||||||
canClick?: MaybeRefOrGetter<boolean>;
|
canClick?: MaybeRefOrGetter<boolean>;
|
||||||
/** The display to use for this clickable. */
|
/** The display to use for this clickable. */
|
||||||
display?:
|
display?:
|
||||||
| Renderable
|
| MaybeGetter<Renderable>
|
||||||
| (() => Renderable)
|
|
||||||
| {
|
| {
|
||||||
/** A header to appear at the top of the display. */
|
/** A header to appear at the top of the display. */
|
||||||
title?: MaybeGetter<Renderable>;
|
title?: MaybeGetter<Renderable>;
|
||||||
|
|
|
@ -31,8 +31,7 @@ export interface RepeatableOptions extends ClickableOptions {
|
||||||
initialAmount?: DecimalSource;
|
initialAmount?: DecimalSource;
|
||||||
/** The display to use for this repeatable. */
|
/** The display to use for this repeatable. */
|
||||||
display?:
|
display?:
|
||||||
| Renderable
|
| MaybeGetter<Renderable>
|
||||||
| (() => Renderable)
|
|
||||||
| {
|
| {
|
||||||
/** A header to appear at the top of the display. */
|
/** A header to appear at the top of the display. */
|
||||||
title?: MaybeGetter<Renderable>;
|
title?: MaybeGetter<Renderable>;
|
||||||
|
|
|
@ -34,8 +34,7 @@ export const UpgradeType = Symbol("Upgrade");
|
||||||
export interface UpgradeOptions extends VueFeatureOptions, ClickableOptions {
|
export interface UpgradeOptions extends VueFeatureOptions, ClickableOptions {
|
||||||
/** The display to use for this upgrade. */
|
/** The display to use for this upgrade. */
|
||||||
display?:
|
display?:
|
||||||
| Renderable
|
| MaybeGetter<Renderable>
|
||||||
| (() => Renderable)
|
|
||||||
| {
|
| {
|
||||||
/** A header to appear at the top of the display. */
|
/** A header to appear at the top of the display. */
|
||||||
title?: MaybeGetter<Renderable>;
|
title?: MaybeGetter<Renderable>;
|
||||||
|
|
Loading…
Reference in a new issue