From b666e0c1f58e1dff5aea33e0e92a2abd3b94e2d5 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 18 Apr 2023 20:58:35 -0500 Subject: [PATCH] Fix common.tsx --- src/data/common.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/data/common.tsx b/src/data/common.tsx index 304208b..ab33aa6 100644 --- a/src/data/common.tsx +++ b/src/data/common.tsx @@ -5,11 +5,10 @@ import { createClickable } from "features/clickables/clickable"; import type { GenericConversion } from "features/conversion"; import type { CoercableComponent, JSXFunction, OptionsFunc, Replace } from "features/feature"; import { jsx, setDefault } from "features/feature"; -import { displayResource, Resource } from "features/resources/resource"; +import { Resource, displayResource } from "features/resources/resource"; import type { GenericTree, GenericTreeNode, TreeNode, TreeNodeOptions } from "features/trees/tree"; import { createTreeNode } from "features/trees/tree"; -import Formula from "game/formulas/formulas"; -import type { FormulaSource, GenericFormula } from "game/formulas/types"; +import type { GenericFormula } from "game/formulas/types"; import type { Modifier } from "game/modifiers"; import type { Persistent } from "game/persistence"; import { DefaultValue, persistent } from "game/persistence"; @@ -99,8 +98,8 @@ export type GenericResetButton = Replace< export function createResetButton( optionsFunc: OptionsFunc ): ResetButton { - return createClickable(() => { - const resetButton = optionsFunc(); + return createClickable(feature => { + const resetButton = optionsFunc.call(feature, feature); processComputable(resetButton as T, "showNextAt"); setDefault(resetButton, "showNextAt", true); @@ -213,8 +212,8 @@ export type GenericLayerTreeNode = Replace< export function createLayerTreeNode( optionsFunc: OptionsFunc ): LayerTreeNode { - return createTreeNode(() => { - const options = optionsFunc(); + return createTreeNode(feature => { + const options = optionsFunc.call(feature, feature); processComputable(options as T, "display"); setDefault(options, "display", options.layerID); processComputable(options as T, "append");