StoredSettings beta
Class of @v12-engine/client/app
export declare class StoredSettings implements SettingsLikeThe settings with no game running: a screen of them before the game (a start menu's Settings, settingsScene). The client's and the game's own (GameView.hud.settings), as a game would list them, their values read from where they are kept (ready) and written back as they are set, for the next game to read as it starts. What a setting does to the client (apply) waits for one; what one is before it was ever set (initial) is its default here
Members
constructor
constructor(
game?: GameSettings,
store?: SettingsStore,
languages?: Languages);Constructs a new instance of the StoredSettings class
def
def(id: string): SettingDef | undefined;The definition of the setting with that id, or undefined where there is none
get
get<V extends SettingValue = SettingValue>(id: string): V;The value of a setting by its id, typed as V; throws where there is no such setting
list
readonly list: Accessor<readonly SettingDef[]>;Every setting there is, in order: the client's, then the game's own
ready
readonly ready: Promise<void>;Done when what was kept is read and shown. Never rejects: a store that cannot be read leaves the defaults
reset
reset(id?: string): void;Puts a setting back to its default, or every setting not hidden when no id is given
set
set(id: string, value: SettingValue): void;Sets a setting, fitted to its definition; the store keeps it and what listens hears of it. Throws where there is no such setting
shown
shown(def: SettingDef): boolean;Whether the settings screen lists a setting: with no game running, whatever is not hidden