1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
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('<h1 id="module-features-achievements-achievement" tabindex="-1">Module: features/achievements/achievement <a class="header-anchor" href="#module-features-achievements-achievement" aria-label="Permalink to "Module: features/achievements/achievement""></a></h1><h2 id="enumerations" tabindex="-1">Enumerations <a class="header-anchor" href="#enumerations" aria-label="Permalink to "Enumerations""></a></h2><h3 id="achievementdisplay" tabindex="-1">AchievementDisplay <a class="header-anchor" href="#achievementdisplay" aria-label="Permalink to "AchievementDisplay""></a></h3><p>• <strong>AchievementDisplay</strong>: <code>Object</code></p><p>Modes for only displaying some achievements.</p><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th></tr></thead><tbody><tr><td style="text-align:left;"><code>All</code></td><td style="text-align:left;"><code>"all"</code></td></tr><tr><td style="text-align:left;"><code>Configurable</code></td><td style="text-align:left;"><code>"configurable"</code></td></tr><tr><td style="text-align:left;"><code>Incomplete</code></td><td style="text-align:left;"><code>"incomplete"</code></td></tr><tr><td style="text-align:left;"><code>None</code></td><td style="text-align:left;"><code>"none"</code></td></tr></tbody></table><h4 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/achievements/achievement.tsx#L50" target="_blank" rel="noreferrer">profectus/src/features/achievements/achievement.tsx:50</a></p><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to "Interfaces""></a></h2><h3 id="achievementoptions" tabindex="-1">AchievementOptions <a class="header-anchor" href="#achievementoptions" aria-label="Permalink to "AchievementOptions""></a></h3><p>• <strong>AchievementOptions</strong>: <code>Object</code></p><p>An object that configures an <a href="./achievement#achievement">Achievement</a>.</p><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>classes?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a><<code>string</code>, <code>boolean</code>>></td><td style="text-align:left;">Dictionary of CSS classes to apply to this feature.</td></tr><tr><td style="text-align:left;"><code>display?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> | { <code>effectDisplay?</code>: <a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> ; <code>optionsDisplay?</code>: <a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> ; <code>requirement?</code>: <a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> }></td><td style="text-align:left;">The display to use for this achievement.</td></tr><tr><td style="text-align:left;"><code>image?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>string</code>></td><td style="text-align:left;">An image to display as the background for this achievement.</td></tr><tr><td style="text-align:left;"><code>mark?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>string</code> | <code>boolean</code>></td><td style="text-align:left;">Shows a marker on the corner of the feature.</td></tr><tr><td style="text-align:left;"><code>onComplete?</code></td><td style="text-align:left;"><code>VoidFunction</code></td><td style="text-align:left;">A function that is called when the achievement is completed.</td></tr><tr><td style="text-align:left;"><code>requirements?</code></td><td style="text-align:left;"><a href="./../game/requirements#requirements"><code>Requirements</code></a></td><td style="text-align:left;">The requirement(s) to earn this achievement. Can be left null if using <a href="./achievement#complete">complete</a>.</td></tr><tr><td style="text-align:left;"><code>showPopups?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>boolean</code>></td><td style="text-align:left;">Whether or not to display a notification popup when this achievement is earned.</td></tr><tr><td style="text-align:left;"><code>small?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>boolean</code>></td><td style="text-align:left;">Toggles a smaller design for the feature.</td></tr><tr><td style="text-align:left;"><code>style?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="./feature#stylevalue"><code>StyleValue</code></a>></td><td style="text-align:left;">CSS to apply to this feature.</td></tr><tr><td style="text-align:left;"><code>visibility?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>boolean</code> | <a href="./feature#visibility"><code>Visibility</code></a>></td><td style="text-align:left;">Whether this achievement should be visible.</td></tr></tbody></table><h4 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/achievements/achievement.tsx#L61" target="_blank" rel="noreferrer">profectus/src/features/achievements/achievement.tsx:61</a></p><hr><h3 id="baseachievement" tabindex="-1">BaseAchievement <a class="header-anchor" href="#baseachievement" aria-label="Permalink to "BaseAchievement""></a></h3><p>• <strong>BaseAchievement</strong>: <code>Object</code></p><p>The properties that are added onto a processed <a href="./achievement#achievementoptions">AchievementOptions</a> to create an <a href="./achievement#achievement">Achievement</a>.</p><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>[Component]</code></td><td style="text-align:left;"><a href="./feature#genericcomponent"><code>GenericComponent</code></a></td><td style="text-align:left;">The Vue component used to render this feature.</td></tr><tr><td style="text-align:left;"><code>[GatherProps]</code></td><td style="text-align:left;">() => <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a><<code>string</code>, <code>unknown</code>></td><td style="text-align:left;">A function to gather the props the vue component requires for this feature.</td></tr><tr><td style="text-align:left;"><code>complete</code></td><td style="text-align:left;"><code>VoidFunction</code></td><td style="text-align:left;">A function to complete this achievement.</td></tr><tr><td style="text-align:left;"><code>earned</code></td><td style="text-align:left;"><a href="./../game/persistence#persistent"><code>Persistent</code></a><<code>boolean</code>></td><td style="text-align:left;">Whether or not this achievement has been earned.</td></tr><tr><td style="text-align:left;"><code>id</code></td><td style="text-align:left;"><code>string</code></td><td style="text-align:left;">An auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates.</td></tr><tr><td style="text-align:left;"><code>type</code></td><td style="text-align:left;">typeof <a href="./achievement#achievementtype"><code>AchievementType</code></a></td><td style="text-align:left;">A symbol that helps identify features of the same type.</td></tr></tbody></table><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/achievements/achievement.tsx#L97" target="_blank" rel="noreferrer">profectus/src/features/achievements/achievement.tsx:97</a></p><h2 id="type-aliases" tabindex="-1">Type Aliases <a class="header-anchor" href="#type-aliases" aria-label="Permalink to "Type Aliases""></a></h2><h3 id="achievement" tabindex="-1">Achievement <a class="header-anchor" href="#achievement" aria-label="Permalink to "Achievement""></a></h3><p>Ƭ <strong>Achievement</strong><<code>T</code>>: <a href="./feature#replace"><code>Replace</code></a><<code>T</code> & <a href="./achievement#baseachievement"><code>BaseAchievement</code></a>, { <code>classes</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"classes"</code>]> ; <code>display</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"display"</code>]> ; <code>image</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"image"</code>]> ; <code>mark</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"mark"</code>]> ; <code>showPopups</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"showPopups"</code>], <code>true</code>> ; <code>style</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"style"</code>]> ; <code>visibility</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"visibility"</code>], <a href="./feature#visible"><code>Visible</code></a>> }></p><p>An object that represents a feature with requirements that is passively earned upon meeting certain requirements.</p><h4 id="type-parameters" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to "Type parameters""></a></h4><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th></tr></thead><tbody><tr><td style="text-align:left;"><code>T</code></td><td style="text-align:left;">extends <a href="./achievement#achievementoptions"><code>AchievementOptions</code></a></td></tr></tbody></table><h4 id="defined-in-3" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-3" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/achievements/achievement.tsx#L113" target="_blank" rel="noreferrer">profectus/src/features/achievements/achievement.tsx:113</a></p><hr><h3 id="genericachievement" tabindex="-1">GenericAchievement <a class="header-anchor" href="#genericachievement" aria-label="Permalink to "GenericAchievement""></a></h3><p>Ƭ <strong>GenericAchievement</strong>: <a href="./feature#replace"><code>Replace</code></a><<a href="./achievement#achievement"><code>Achievement</code></a><<a href="./achievement#achievementoptions"><code>AchievementOptions</code></a>>, { <code>showPopups</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<code>boolean</code>> ; <code>visibility</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<a href="./feature#visibility"><code>Visibility</code></a> | <code>boolean</code>> }></p><p>A type that matches any valid <a href="./achievement#achievement">Achievement</a> object.</p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/achievements/achievement.tsx#L127" target="_blank" rel="noreferrer">profectus/src/features/achievements/achievement.tsx:127</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to "Variables""></a></h2><h3 id="achievementtype" tabindex="-1">AchievementType <a class="header-anchor" href="#achievementtype" aria-label="Permalink to "AchievementType""></a></h3><p>• <code>Const</code> <strong>AchievementType</strong>: typeof <a href="./achievement#achievementtype"><code>AchievementType</code></a></p><p>A symbol used to identify <a href="./achievement#achievement">Achievement</a> features.</p><h4 id="defined-in-5" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-5" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/achievements/achievement.tsx#L47" target="_blank" rel="noreferrer">profectus/src/features/achievements/achievement.tsx:47</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><h3 id="createachievement" tabindex="-1">createAchievement <a class="header-anchor" href="#createachievement" aria-label="Permalink to "createAchievement""></a></h3><p>▸ <strong>createAchievement</strong><<code>T</code>>(<code>optionsFunc?</code>): <a href="./achievement#achievement"><code>Achievement</code></a><<code>T</code>></p><p>Lazily creates an achievement with the given options.</p><h5 id="type-parameters-1" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-1" aria-label="Permalink to "Type parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th></tr></thead><tbody><tr><td style="text-align:left;"><code>T</code></td><td style="text-align:left;">extends <a href="./achievement#achievementoptions"><code>AchievementOptions</code></a></td></tr></tbody></table><h5 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>optionsFunc?</code></td><td style="text-align:left;"><a href="./feature#optionsfunc"><code>OptionsFunc</code></a><<code>T</code>, <a href="./achievement#baseachievement"><code>BaseAchievement</code></a>, <a href="./achievement#genericachievement"><code>GenericAchievement</code></a>></td><td style="text-align:left;">Achievement options.</td></tr></tbody></table><h5 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h5><p><a href="./achievement#achievement"><code>Achievement</code></a><<code>T</code>></p><h4 id="defined-in-6" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-6" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/achievements/achievement.tsx#L139" target="_blank" rel="noreferrer">profectus/src/features/achievements/achievement.tsx:139</a></p><h2 id="components" tabindex="-1">Components <a class="header-anchor" href="#components" aria-label="Permalink to "Components""></a></h2><h3 id="achievement-component" tabindex="-1">Achievement Component <a class="header-anchor" href="#achievement-component" aria-label="Permalink to "Achievement Component""></a></h3><h4 id="props" tabindex="-1">Props <a class="header-anchor" href="#props" aria-label="Permalink to "Props""></a></h4><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th></tr></thead><tbody><tr><td style="text-align:left;"><code>visibility</code>*</td><td style="text-align:left;"><code>processedPropType<Visibility | boolean>(Number, Boolean)</code></td></tr><tr><td style="text-align:left;"><code>display</code></td><td style="text-align:left;"><code>processedPropType<UnwrapRef<GenericAchievement["display"]>>(Object, String, Function)</code></td></tr><tr><td style="text-align:left;"><code>earned</code>*</td><td style="text-align:left;"><code>processedPropType<boolean>(Boolean)</code></td></tr><tr><td style="text-align:left;"><code>requirements</code></td><td style="text-align:left;"><code>processedPropType<Requirements>(Object, Array)</code></td></tr><tr><td style="text-align:left;"><code>image</code></td><td style="text-align:left;"><code>processedPropType<string>(String)</code></td></tr><tr><td style="text-align:left;"><code>style</code></td><td style="text-align:left;"><code>processedPropType<StyleValue>(String, Object, Array)</code></td></tr><tr><td style="text-align:left;"><code>classes</code></td><td style="text-align:left;"><code>processedPropType<Record<string, boolean>>(Object)</code></td></tr><tr><td style="text-align:left;"><code>mark</code></td><td style="text-align:left;"><code>processedPropType<boolean | string>(Boolean, String)</code></td></tr><tr><td style="text-align:left;"><code>small</code></td><td style="text-align:left;"><code>processedPropType<boolean>(Boolean)</code></td></tr><tr><td style="text-align:left;"><code>id</code>*</td><td style="text-align:left;"><code>string</code></td></tr></tbody></table>',58),l=[c];function n(i,r,s,h,p,f){return a(),t("div",null,l)}const g=e(d,[["render",n]]);export{u as __pageData,g as default};
|