Registers game settings and creates a backing Svelte store for each setting. The Svelte store will update the Foundry game settings and vice versa when changes occur to the Foundry game settings the updated data is set to the store.

Note: It is possible to add multiple onChange callbacks on registration.

ExtraProps - Defines additional properties for game setting options / data that child implementations may define.

Type Parameters

  • ExtraProps extends Record<string, any> = {}
Hierarchy

Constructors

Accessors

  • get namespace(): string
  • Returns string

    Returns namespace set in constructor.

Methods

  • Returns a readable Game Settings store for the associated key.

    Type Parameters

    • T

    Parameters

    • key: string

      Game setting key.

    Returns Readable<T>

    The associated store for the given game setting key.

  • Returns a writable Game Settings store for the associated key.

    Type Parameters

    • T

    Parameters

    • key: string

      Game setting key.

    Returns MinimalWritable<T>

    The associated store for the given game setting key.

  • Returns a writable Game Settings store for the associated key.

    Type Parameters

    • T

    Parameters

    • key: string

      Game setting key.

    Returns MinimalWritable<T>

    The associated store for the given game setting key.

  • Returns an iterable for the game setting keys from existing stores.

    Parameters

    • Optionalregex: RegExp

      Optional regular expression to filter by game setting keys.

    Returns IterableIterator<string>

    Iterable iterator of game setting keys.

  • Registers a setting with TJSGameSettings and Foundry core.

    Parameters

    • setting: TJSGameSettings.Options.GameSetting<ExtraProps>

      A GameSetting instance to set to Foundry game settings.

    • OptionalcoreConfig: 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 void

  • Registers multiple settings.

    Parameters

    • settings: Iterable<TJSGameSettings.Options.GameSetting<ExtraProps>>

      An iterable list of game setting configurations to register.

    • OptionalcoreConfig: 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 void

    An object containing all TJSGameSetting store subscriber handlers for each setting key added.