Module: game/settings
Interfaces
Variables
default
• default: Settings
The player settings object. Stores data that persists across all saves. Automatically saved to localStorage whenever changed.
Defined in
profectus/src/game/settings.ts:53
gameComponents
• Const
gameComponents: CoercableComponent
[]
A list of components to add to the root of the page.
Defined in
profectus/src/game/settings.ts:115
infoComponents
• Const
infoComponents: CoercableComponent
[]
A list of components to show in the info modal.
Defined in
profectus/src/game/settings.ts:108
settingFields
• Const
settingFields: CoercableComponent
[]
A list of fields to append to the settings modal.
Defined in
profectus/src/game/settings.ts:101
Functions
hardResetSettings
▸ hardResetSettings(): void
Returns
void
loadSettings
▸ 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.
Returns
void
registerGameComponent
▸ registerGameComponent(component
): void
Register a component to be displayed at the root of the page.
Parameters
Name | Type |
---|---|
component | CoercableComponent |
Returns
void
registerInfoComponent
▸ registerInfoComponent(component
): void
Register a component to be displayed in the info modal.
Parameters
Name | Type |
---|---|
component | CoercableComponent |
Returns
void
registerSettingField
▸ registerSettingField(component
): void
Register a field to be displayed in the settings modal.
Parameters
Name | Type |
---|---|
component | CoercableComponent |
Returns
void