import{_ as e,c as t,o as a,N as r}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: game/settings","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/game/settings.md","lastUpdated":null}'),o={name:"api/modules/game/settings.md"},n=r('
• default: Settings
The player settings object. Stores data that persists across all saves. Automatically saved to localStorage whenever changed.
profectus/src/game/settings.ts:56
• Const
gameComponents: CoercableComponent
[]
A list of components to add to the root of the page.
profectus/src/game/settings.ts:119
• Const
infoComponents: CoercableComponent
[]
A list of components to show in the info modal.
profectus/src/game/settings.ts:112
• Const
settingFields: CoercableComponent
[]
A list of fields to append to the settings modal.
profectus/src/game/settings.ts:105
▸ hardResetSettings(): void
A function that erases all player settings, including all saves.
void
profectus/src/game/settings.ts:58
▸ loadSettings(): void
Loads the player settings from localStorage. Calls the GlobalEvents.loadSettings event for custom properties to be included. Custom properties should be added by the file they relate to, so they won't be included if the file is tree shaken away. Custom properties should also register the field to modify said setting using registerSettingField.
void
profectus/src/game/settings.ts:77
▸ registerGameComponent(component
): void
Register a component to be displayed at the root of the page.
Name | Type |
---|---|
component | CoercableComponent |
void
profectus/src/game/settings.ts:121
▸ registerInfoComponent(component
): void
Register a component to be displayed in the info modal.
Name | Type |
---|---|
component | CoercableComponent |
void
profectus/src/game/settings.ts:114
▸ registerSettingField(component
): void
Register a field to be displayed in the settings modal.
Name | Type |
---|---|
component | CoercableComponent |
void