import{_ as e,c as t,o as a,N as o}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: features/achievements/achievement","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/achievement.md","lastUpdated":null}'),d={name:"api/modules/features/achievement.md"},c=o('
• AchievementDisplay: Object
Modes for only displaying some achievements.
Name | Type |
---|---|
All | "all" |
Configurable | "configurable" |
Incomplete | "incomplete" |
None | "none" |
profectus/src/features/achievements/achievement.tsx:51
• AchievementOptions: Object
An object that configures an Achievement.
Name | Type | Description |
---|---|---|
classes? | Computable <Record <string , boolean >> | Dictionary of CSS classes to apply to this feature. |
display? | Computable <CoercableComponent | { effectDisplay? : CoercableComponent ; optionsDisplay? : CoercableComponent ; requirement? : CoercableComponent }> | The display to use for this achievement. |
image? | Computable <string > | An image to display as the background for this achievement. |
mark? | Computable <string | boolean > | Shows a marker on the corner of the feature. |
onComplete? | VoidFunction | A function that is called when the achievement is completed. |
requirements? | Requirements | The requirement(s) to earn this achievement. Can be left null if using complete. |
showPopups? | Computable <boolean > | Whether or not to display a notification popup when this achievement is earned. |
small? | Computable <boolean > | Toggles a smaller design for the feature. |
style? | Computable <StyleValue > | CSS to apply to this feature. |
visibility? | Computable <boolean | Visibility > | Whether this achievement should be visible. |
profectus/src/features/achievements/achievement.tsx:62
• BaseAchievement: Object
The properties that are added onto a processed AchievementOptions to create an Achievement.
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. |
complete | VoidFunction | A function to complete this achievement. |
earned | Persistent <boolean > | Whether or not this achievement has been earned. |
id | string | An auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates. |
type | typeof AchievementType | A symbol that helps identify features of the same type. |
profectus/src/features/achievements/achievement.tsx:98
Ƭ Achievement<T
>: Replace
<T
& BaseAchievement
, { classes
: GetComputableType
<T
["classes"
]> ; display
: GetComputableType
<T
["display"
]> ; image
: GetComputableType
<T
["image"
]> ; mark
: GetComputableType
<T
["mark"
]> ; showPopups
: GetComputableTypeWithDefault
<T
["showPopups"
], true
> ; style
: GetComputableType
<T
["style"
]> ; visibility
: GetComputableTypeWithDefault
<T
["visibility"
], Visible
> }>
An object that represents a feature with requirements that is passively earned upon meeting certain requirements.
Name | Type |
---|---|
T | extends AchievementOptions |
profectus/src/features/achievements/achievement.tsx:114
Ƭ GenericAchievement: Replace
<Achievement
<AchievementOptions
>, { showPopups
: ProcessedComputable
<boolean
> ; visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid Achievement object.
profectus/src/features/achievements/achievement.tsx:128
• Const
AchievementType: typeof AchievementType
A symbol used to identify Achievement features.
profectus/src/features/achievements/achievement.tsx:48
▸ createAchievement<T
>(optionsFunc?
, ...decorators
): Achievement
<T
>
Lazily creates an achievement with the given options.
Name | Type |
---|---|
T | extends AchievementOptions |
Name | Type | Description |
---|---|---|
optionsFunc? | OptionsFunc <T , BaseAchievement , GenericAchievement > | Achievement options. |
...decorators | GenericDecorator [] | - |
Achievement
<T
>
profectus/src/features/achievements/achievement.tsx:140
Name | Type |
---|---|
visibility * | processedPropType<Visibility | boolean>(Number, Boolean) |
display | processedPropType<UnwrapRef<GenericAchievement["display"]>>(Object, String, Function) |
earned * | processedPropType<boolean>(Boolean) |
requirements | processedPropType<Requirements>(Object, Array) |
image | processedPropType<string>(String) |
style | processedPropType<StyleValue>(String, Object, Array) |
classes | processedPropType<Record<string, boolean>>(Object) |
mark | processedPropType<boolean | string>(Boolean, String) |
small | processedPropType<boolean>(Boolean) |
id * | string |