import{_ as e,c as t,o,N as a}from"./chunks/framework.0799945b.js";const p=JSON.parse('{"title":"Module: data/common","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/data/common.md","lastUpdated":null}'),r={name:"api/modules/data/common.md"},d=a('
• LayerTreeNodeOptions: Object
An object that configures a LayerTreeNode
Name | Type | Description |
---|---|---|
append? | Computable <boolean > | Whether or not to append the layer to the tabs list. If set to false, then the tree node will instead always remove all tabs to its right and then add the layer tab. Defaults to true. |
canClick? | Computable <boolean > | Whether or not this tree node can be clicked. |
classes? | Computable <Record <string , boolean >> | Dictionary of CSS classes to apply to this feature. |
color | Computable <string > | The color to display this tree node as |
display? | Computable <CoercableComponent > | The content to display in the tree node. Defaults to the layer's ID |
glowColor? | Computable <string > | The color of the glow effect shown to notify the user there's something to do with this node. |
layerID | string | The ID of the layer this tree node is associated with |
mark? | Computable <string | boolean > | Shows a marker on the corner of the feature. |
onClick? | (e? : MouseEvent | TouchEvent ) => void | A function that is called when the tree node is clicked. |
onHold? | VoidFunction | A function that is called when the tree node is held down. |
reset? | GenericReset | A reset object attached to this node, used for propagating resets through the tree. |
style? | Computable <StyleValue > | CSS to apply to this feature. |
visibility? | Computable <boolean | Visibility > | Whether this tree node should be visible. |
profectus/src/data/common.tsx:176
• ResetButtonOptions: Object
An object that configures a ResetButton
Name | Type | Description |
---|---|---|
canClick? | Computable <boolean > | Whether or not this button can currently be clicked. Defaults to checking the current gain amount is greater than minimumGain |
classes? | Computable <Record <string , boolean >> | Dictionary of CSS classes to apply to this feature. |
conversion | GenericConversion | The conversion the button uses to calculate how much resources will be gained on click |
display? | Computable <CoercableComponent > | The content to display on the button. By default, this includes the reset description, and amount of currency to be gained. |
mark? | Computable <string | boolean > | Shows a marker on the corner of the feature. |
minimumGain? | Computable <DecimalSource > | When canClick is left to its default, minimumGain is used to only enable the reset button when a sufficient amount of currency to gain is available. |
onClick? | (e? : MouseEvent | TouchEvent ) => void | A function that is called when the clickable is clicked. |
onHold? | VoidFunction | A function that is called when the clickable is held down. |
resetDescription? | Computable <string > | Text to display on low conversion amounts, describing what "resetting" is in this context. Defaults to "Reset for ". |
resetTime? | Persistent <DecimalSource > | A persistent ref to track how much time has passed since the last time this tree node was reset. |
showNextAt? | Computable <boolean > | Whether or not to show how much currency would be required to make the gain amount increase. |
small? | boolean | Toggles a smaller design for the feature. |
style? | Computable <StyleValue > | CSS to apply to this feature. |
tree | GenericTree | The tree this reset button is apart of |
treeNode | GenericTreeNode | The specific tree node associated with this reset button |
visibility? | Computable <boolean | Visibility > | Whether this clickable should be visible. |
profectus/src/data/common.tsx:34
• Section: Object
An option object for a modifier display as a single section. *
Name | Type | Description |
---|---|---|
base? | Computable <DecimalSource > | The base value being modified. * |
baseText? | Computable <CoercableComponent > | The label to call the base amount. Defaults to "Base". * |
modifier | WithRequired <Modifier , "description" > | The modifier to be displaying in this section. * |
subtitle? | Computable <string > | A subtitle for this modifier, e.g. to explain the context for the modifier. * |
title | Computable <string > | The header for this modifier. * |
unit? | string | The unit of measurement for the base. * |
visible? | Computable <boolean > | Whether or not this section should be currently visible to the player. * |
profectus/src/data/common.tsx:241
Ƭ GenericLayerTreeNode: Replace
<LayerTreeNode
<LayerTreeNodeOptions
>, { append?
: ProcessedComputable
<boolean
> ; display
: ProcessedComputable
<CoercableComponent
> }>
A type that matches any valid LayerTreeNode object.
profectus/src/data/common.tsx:201
Ƭ GenericResetButton: Replace
<GenericClickable
& ResetButton
<ResetButtonOptions
>, { canClick
: ProcessedComputable
<boolean
> ; display
: ProcessedComputable
<CoercableComponent
> ; minimumGain
: ProcessedComputable
<DecimalSource
> ; resetDescription
: ProcessedComputable
<string
> ; showNextAt
: ProcessedComputable
<boolean
> }>
A type that matches any valid ResetButton object.
profectus/src/data/common.tsx:84
Ƭ LayerTreeNode<T
>: Replace
<TreeNode
<T
>, { append
: GetComputableType
<T
["append"
]> ; display
: GetComputableTypeWithDefault
<T
["display"
], T
["layerID"
]> }>
A tree node that is associated with a given layer, and which opens the layer when clicked.
Name | Type |
---|---|
T | extends LayerTreeNodeOptions |
profectus/src/data/common.tsx:193
Ƭ ResetButton<T
>: Replace
<Clickable
<T
>, { canClick
: GetComputableTypeWithDefault
<T
["canClick"
], Ref
<boolean
>> ; display
: GetComputableTypeWithDefault
<T
["display"
], Ref
<JSX.Element
>> ; minimumGain
: GetComputableTypeWithDefault
<T
["minimumGain"
], 1
> ; onClick
: (event?
: MouseEvent
| TouchEvent
) => void
; resetDescription
: GetComputableTypeWithDefault
<T
["resetDescription"
], Ref
<string
>> ; showNextAt
: GetComputableTypeWithDefault
<T
["showNextAt"
], true
> }>
A button that is used to control a conversion. It will show how much can be converted currently, and can show when that amount will go up, as well as handle only being clickable when a sufficient amount of currency can be gained. Assumes this button is associated with a specific node on a tree, and triggers that tree's reset propagation.
Name | Type |
---|---|
T | extends ResetButtonOptions |
profectus/src/data/common.tsx:71
▸ colorText(textToColor
, color?
): JSX.Element
Creates an HTML string for a span that writes some given text in a given color.
Name | Type | Default value | Description |
---|---|---|---|
textToColor | string | undefined | The content to change the color of |
color | string | "var(--accent2)" | The color to change the content to look like. Defaults to the current theme's accent 2 variable. |
JSX.Element
profectus/src/data/common.tsx:382
• colorText: (textToColor
: string
, color
: string
) => JSX.Element
profectus/src/data/common.tsx:382
▸ createCollapsibleAchievements(achievements
): Object
Creates a collapsible display of a list of achievements
Name | Type | Description |
---|---|---|
achievements | Record <string , GenericAchievement > | A dictionary of the achievements to display, inserted in the order from easiest to hardest |
Object
Name | Type |
---|---|
collapseAchievements | Persistent <boolean > |
display | JSXFunction |
profectus/src/data/common.tsx:390
• createCollapsibleAchievements: (achievements
: Record
<string
, GenericAchievement
>) => { collapseAchievements
: Persistent
<boolean
> = collapseAchievements; display
: JSXFunction
}
profectus/src/data/common.tsx:390
▸ createCollapsibleModifierSections(sectionsFunc
, smallerIsBetter?
): [JSXFunction
, Persistent
<Record
<number
, boolean
>>]
Takes an array of modifier "sections", and creates a JSXFunction that can render all those sections, and allow each section to be collapsed. Also returns a list of persistent refs that are used to control which sections are currently collapsed.
Name | Type | Default value | Description |
---|---|---|---|
sectionsFunc | () => Section [] | undefined | A function that returns the sections to display. |
smallerIsBetter | boolean | false | Determines whether numbers larger or smaller than the base should be displayed as red. |
[JSXFunction
, Persistent
<Record
<number
, boolean
>>]
profectus/src/data/common.tsx:264
• createCollapsibleModifierSections: (sectionsFunc
: () => Section
[], smallerIsBetter
: boolean
) => [JSXFunction
, Persistent
<Record
<number
, boolean
>>]
profectus/src/data/common.tsx:264
▸ createFormulaPreview(formula
, showPreview
, previewAmount?
): ComputedRef
<CoercableComponent
>
Utility function for displaying the result of a formula such that it will, when told to, preview how the formula's result will change. Requires a formula with a single variable inside.
Name | Type | Default value | Description |
---|---|---|---|
formula | GenericFormula | undefined | The formula to display the result of. |
showPreview | Computable <boolean > | undefined | Whether or not to preview how the formula's result will change. |
previewAmount | Computable <DecimalSource > | 1 | The amount to add to the current formula's variable amount to preview the change in result. |
ComputedRef
<CoercableComponent
>
profectus/src/data/common.tsx:460
• createFormulaPreview: (formula
: GenericFormula
, showPreview
: Computable
<boolean
>, previewAmount
: Computable
<DecimalSource
>) => ComputedRef
<CoercableComponent
>
profectus/src/data/common.tsx:460
▸ createLayerTreeNode<T
>(optionsFunc
): LayerTreeNode
<T
>
Lazily creates a tree node that's associated with a specific layer, with the given options.
Name | Type |
---|---|
T | extends LayerTreeNodeOptions |
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , Record <string , unknown >, Record <string , unknown >> | A function that returns the options object for this tree node. |
profectus/src/data/common.tsx:213
• createLayerTreeNode: <T>(optionsFunc
: OptionsFunc
<T
, Record
<string
, unknown
>, Record
<string
, unknown
>>) => LayerTreeNode
<T
>
profectus/src/data/common.tsx:213
▸ createResetButton<T
>(optionsFunc
): ResetButton
<T
>
Lazily creates a reset button with the given options.
Name | Type |
---|---|
T | extends ClickableOptions & ResetButtonOptions |
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , Record <string , unknown >, Record <string , unknown >> | A function that returns the options object for this reset button. |
ResetButton
<T
>
profectus/src/data/common.tsx:99
• createResetButton: <T>(optionsFunc
: OptionsFunc
<T
, Record
<string
, unknown
>, Record
<string
, unknown
>>) => ResetButton
<T
>
profectus/src/data/common.tsx:99
▸ estimateTime(resource
, rate
, target
): ComputedRef
<string
>
Utility function for getting an ETA for when a target will be reached by a resource with a known (and assumed consistent) gain.
Name | Type | Description |
---|---|---|
resource | Resource <DecimalSource > | The resource that will be increasing over time. |
rate | Computable <DecimalSource > | The rate at which the resource is increasing. |
target | Computable <DecimalSource > | The target amount of the resource to estimate the duration until. |
ComputedRef
<string
>
profectus/src/data/common.tsx:434
• estimateTime: (resource
: Resource
<DecimalSource
>, rate
: Computable
<DecimalSource
>, target
: Computable
<DecimalSource
>) => ComputedRef
<string
>
profectus/src/data/common.tsx:434
▸ modifierToFormula<T
>(modifier
, base
): T
Utility for converting a modifier into a formula. Takes the input for this formula as the base parameter.
Name | Type |
---|---|
T | extends default <any , T > |
Name | Type | Description |
---|---|---|
modifier | WithRequired <Modifier , "revert" > | The modifier to convert to the formula |
base | T | An existing formula or processed DecimalSource that will be the input to the formula |
T
profectus/src/data/common.tsx:500
▸ modifierToFormula(modifier
, base
): GenericFormula
Name | Type |
---|---|
modifier | Modifier |
base | FormulaSource |
profectus/src/data/common.tsx:504
• modifierToFormula: <T>(modifier
: WithRequired
<Modifier
, "revert"
>, base
: T
) => T
(modifier
: Modifier
, base
: FormulaSource
) => GenericFormula
profectus/src/data/common.tsx:500
',170),c=[d];function l(n,i,s,h,f,u){return o(),t("div",null,c)}const g=e(r,[["render",l]]);export{p as __pageData,g as default};