This commit is contained in:
circle-gon 2022-12-09 00:24:03 +00:00
commit eaebb4048e
6 changed files with 16 additions and 13 deletions

View file

@ -485,7 +485,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
const row2upgrades = [dedicatedCutters, dedicatedPlanters, betterFertilizer, unlockKiln];
const efficientSmelther: Upgrade<EfficientSmeltherUpgOptions> = createUpgrade(() => ({
resource: coal,
resource: noPersist(coal),
cost: 1e19,
display: {
title: "Efficient Crucibles",

View file

@ -1068,6 +1068,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
minWidth: 700,
oilMilestones,
collapsedOilMilestones,
generalTabCollapsed,
display: jsx(() => (
<>

View file

@ -1,5 +1,5 @@
import BarComponent from "features/bars/Bar.vue";
import type { CoercableComponent, OptionsFunc, Replace, StyleValue } from "features/feature";
import type { CoercableComponent, GenericComponent, OptionsFunc, Replace, StyleValue } from "features/feature";
import { Component, GatherProps, getUniqueID, setDefault, Visibility } from "features/feature";
import type { DecimalSource } from "util/bignum";
import { Direction } from "util/common";
@ -34,7 +34,7 @@ export interface BarOptions {
export interface BaseBar {
id: string;
type: typeof BarType;
[Component]: typeof BarComponent;
[Component]: GenericComponent;
[GatherProps]: () => Record<string, unknown>;
}
@ -71,7 +71,7 @@ export function createBar<T extends BarOptions>(
const bar = optionsFunc();
bar.id = getUniqueID("bar-");
bar.type = BarType;
bar[Component] = BarComponent;
bar[Component] = BarComponent as GenericComponent;
processComputable(bar as T, "visibility");
setDefault(bar, "visibility", Visibility.Visible);

View file

@ -1,5 +1,5 @@
import ClickableComponent from "features/clickables/Clickable.vue";
import type { CoercableComponent, OptionsFunc, Replace, StyleValue } from "features/feature";
import type { CoercableComponent, GenericComponent, OptionsFunc, Replace, StyleValue } from "features/feature";
import { Component, GatherProps, getUniqueID, jsx, setDefault, Visibility } from "features/feature";
import type { Resource } from "features/resources/resource";
import { DefaultValue, Persistent } from "game/persistence";
@ -53,7 +53,7 @@ export interface BaseBuyable {
onClick: VoidFunction;
purchase: VoidFunction;
type: typeof BuyableType;
[Component]: typeof ClickableComponent;
[Component]: GenericComponent;
[GatherProps]: () => Record<string, unknown>;
}
@ -99,7 +99,7 @@ export function createBuyable<T extends BuyableOptions>(
buyable.id = getUniqueID("buyable-");
buyable.type = BuyableType;
buyable[Component] = ClickableComponent;
buyable[Component] = ClickableComponent as GenericComponent;
buyable.amount = amount;
buyable.amount[DefaultValue] = buyable.initialValue ?? 0;

View file

@ -1,5 +1,5 @@
import ClickableComponent from "features/clickables/Clickable.vue";
import type { CoercableComponent, OptionsFunc, Replace, StyleValue } from "features/feature";
import type { CoercableComponent, GenericComponent, OptionsFunc, Replace, StyleValue } from "features/feature";
import { Component, GatherProps, getUniqueID, setDefault, Visibility } from "features/feature";
import type { BaseLayer } from "game/layers";
import type { Unsubscribe } from "nanoevents";
@ -37,7 +37,7 @@ export interface BaseClickable {
id: string;
type: typeof ClickableType;
isHolding: Ref<boolean>;
[Component]: typeof ClickableComponent;
[Component]: GenericComponent;
[GatherProps]: () => Record<string, unknown>;
}
@ -68,7 +68,7 @@ export function createClickable<T extends ClickableOptions>(
const clickable = optionsFunc?.() ?? ({} as ReturnType<NonNullable<typeof optionsFunc>>);
clickable.id = getUniqueID("clickable-");
clickable.type = ClickableType;
clickable[Component] = ClickableComponent;
clickable[Component] = ClickableComponent as GenericComponent;
clickable.isHolding = ref(false);

View file

@ -1,4 +1,4 @@
import type { CoercableComponent, OptionsFunc, Replace, StyleValue } from "features/feature";
import type { CoercableComponent, GenericComponent, OptionsFunc, Replace, StyleValue } from "features/feature";
import {
Component,
findFeatures,
@ -54,7 +54,7 @@ export interface BaseUpgrade {
canPurchase: Ref<boolean>;
purchase: VoidFunction;
type: typeof UpgradeType;
[Component]: typeof UpgradeComponent;
[Component]: GenericComponent;
[GatherProps]: () => Record<string, unknown>;
}
@ -87,7 +87,7 @@ export function createUpgrade<T extends UpgradeOptions>(
const upgrade = optionsFunc();
upgrade.id = getUniqueID("upgrade-");
upgrade.type = UpgradeType;
upgrade[Component] = UpgradeComponent;
upgrade[Component] = UpgradeComponent as GenericComponent;
if (upgrade.canAfford == null && (upgrade.resource == null || upgrade.cost == null)) {
console.warn(