import{_ as e,c as t,o,N as a}from"./chunks/framework.0799945b.js";const b=JSON.parse('{"title":"Module: features/action","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/action.md","lastUpdated":null}'),c={name:"api/modules/features/action.md"},d=a('
• ActionOptions: Object
An object that configures an Action.
Name | Type | Description |
---|---|---|
autoStart? | Computable <boolean > | Whether or not the action should perform automatically when the cooldown is finished. |
barOptions? | Partial <BarOptions > | A pass-through to the Bar used to display the cooldown progress for the action. |
canClick? | Computable <boolean > | Whether or not the clickable may be clicked. |
classes? | Computable <Record <string , boolean >> | Dictionary of CSS classes to apply to this feature. |
display? | Computable <CoercableComponent | { description : CoercableComponent ; title? : CoercableComponent }> | The display to use for this clickable. |
duration | Computable <DecimalSource > | The cooldown during which the action cannot be performed again, in seconds. |
mark? | Computable <string | boolean > | Shows a marker on the corner of the feature. |
onClick | (amount : DecimalSource ) => void | A function that is called when the action is clicked. |
small? | boolean | Toggles a smaller design for the feature. |
style? | Computable <StyleValue > | CSS to apply to this feature. |
visibility? | Computable <boolean | Visibility > | Whether this clickable should be visible. |
profectus/src/features/action.tsx:42
• BaseAction: Object
The properties that are added onto a processed ActionOptions to create an Action.
Name | Type | Description |
---|---|---|
[Component] | GenericComponent | The Vue component used to render this feature. |
[GatherProps] | () => Record <string , unknown > | A function to gather the props the vue component requires for this feature. |
id | string | An auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates. |
isHolding | Ref <boolean > | Whether or not the player is holding down the action. Actions will be considered clicked as soon as the cooldown completes when being held down. |
progress | Ref <DecimalSource > | The current amount of progress through the cooldown. |
progressBar | GenericBar | The bar used to display the current cooldown progress. |
type | typeof ActionType | A symbol that helps identify features of the same type. |
update | (diff : number ) => void | Update the cooldown the specified number of seconds |
profectus/src/features/action.tsx:56
Ƭ Action<T
>: Replace
<T
& BaseAction
, { autoStart
: GetComputableTypeWithDefault
<T
["autoStart"
], false
> ; canClick
: GetComputableTypeWithDefault
<T
["canClick"
], true
> ; classes
: GetComputableType
<T
["classes"
]> ; display
: JSXFunction
; duration
: GetComputableType
<T
["duration"
]> ; mark
: GetComputableType
<T
["mark"
]> ; onClick
: VoidFunction
; style
: GetComputableType
<T
["style"
]> ; visibility
: GetComputableTypeWithDefault
<T
["visibility"
], Visible
> }>
An object that represents a feature that can be clicked upon, and then has a cooldown before it can be clicked again.
Name | Type |
---|---|
T | extends ActionOptions |
profectus/src/features/action.tsx:76
Ƭ GenericAction: Replace
<Action
<ActionOptions
>, { autoStart
: ProcessedComputable
<boolean
> ; canClick
: ProcessedComputable
<boolean
> ; visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid Action object.
profectus/src/features/action.tsx:92
• Const
ActionType: typeof ActionType
A symbol used to identify Action features.
profectus/src/features/action.tsx:37
▸ createAction<T
>(optionsFunc?
, ...decorators
): Action
<T
>
Lazily creates an action with the given options.
Name | Type |
---|---|
T | extends ActionOptions <T > |
Name | Type | Description |
---|---|---|
optionsFunc? | OptionsFunc <T , BaseAction , GenericAction > | Action options. |
...decorators | GenericDecorator [] | - |
Action
<T
>