Class TJSGameSettingsWithUI
Hierarchy
- TJSGameSettings
- TJSGameSettingsWithUI (view full)
Index
Constructors
Accessors
Methods
Constructors
constructor
- new TJSGame
Settings (namespace): TJSGameSettingsWithUIWithUI Creates the TJSGameSettings instance.
Parameters
- namespace: string
The namespace for all settings.
Returns TJSGameSettingsWithUI
- namespace: string
Accessors
namespace
- get namespace(): string
Returns string
Returns namespace set in constructor.
uiControl
Methods
data
- data(regex?): IterableIterator<GameSettingOptions, any, any>
Returns an iterable for the game setting data; GameSettingData.
Parameters
Optional
regex: RegExpOptional regular expression to filter by game setting keys.
Returns IterableIterator<GameSettingOptions, any, any>
Iterable iterator of GameSettingData.
entries
- entries<T>(regex?): IterableIterator<[string, Writable<T>], any, any>
Type Parameters
Parameters
Optional
regex: RegExpOptional regular expression to filter by game setting keys.
Returns IterableIterator<[string, Writable<T>], any, any>
Iterable iterator of keys and stores.
getReadableStore
getStore
getWritableStore
keys
- keys(regex?): IterableIterator<string, any, any>
Returns an iterable for the game setting keys from existing stores.
Parameters
Optional
regex: RegExpOptional regular expression to filter by game setting keys.
Returns IterableIterator<string, any, any>
Iterable iterator of game setting keys.
register
- register(setting, coreConfig?): Function
Registers a setting with TJSGameSettings and Foundry core.
Note: The specific store subscription handler assigned to the passed in store or store created for the setting internally is returned from this function. In some cases when setting up custom stores particularly of object types with several child property stores (
propertyStore
) it is necessary to only update the setting store and not all subscribers to the custom store as thepropertyStore
instances are also subscribers to the custom store.This allows the custom store in the
set
implementation to mainly only trigger the TJSGameSettings subscriber handler on updates and not all the connectedpropertyStore
instances.Parameters
- setting: GameSetting
A GameSetting instance to set to Foundry game settings.
Optional
coreConfig: booleanWhen false this overrides the
setting.options.config
parameter when registering the setting with Foundry. This allows the settings to be displayed in the app itself, but removed from the standard Foundry configuration location.
Returns Function
The specific store subscription handler assigned to the passed in store.
- setting: GameSetting
registerAll
- register
All (settings, coreConfig): {
[key: string]: Function;
} Registers multiple settings.
Please refer to the note in TJSGameSettings.register about the returned object of store subscriber handler functions.
Parameters
- settings: Iterable<GameSetting, any, any>
An iterable list of game setting configurations to register.
- coreConfig: boolean
When false this overrides the
setting.options.config
parameter when registering the setting with Foundry. This allows the settings to be displayed in the app itself, but removed from the standard Foundry configuration location.
Returns {
[key: string]: Function;
}An object containing all TJSGameSetting store subscriber handlers for each setting
key
added.[key: string]: Function
- settings: Iterable<GameSetting, any, any>
stores
- stores<T>(regex?): IterableIterator<Writable<T>, any, any>
Type Parameters
Parameters
Optional
regex: RegExpOptional regular expression to filter by game setting keys.
Returns IterableIterator<Writable<T>, any, any>
Iterable iterator of stores.
Extends TJSGameSettings with UI control for working with
TJSSettingsEdit
andTJSSettingsSwap
components. Instead of extendingTJSGameSettings
simply extendTJSGameSettingsWithUI
instead when creating reactive game settings that utilize the above components.