Settings
The module registers seven settings. Six are visible in Configure Settings → Token Light Condition. The seventh (enable) is controlled by the lighting toolbar button and is not shown in the settings UI.
Settings reference
Section titled “Settings reference”| Name | Scope | Type | Default | Notes |
|---|---|---|---|---|
| Show TokenHud | Client | Boolean | On | Toggles the lighting badge in the token HUD. See Token HUD Indicator. |
| Add Token Effects | World | Boolean | On | When off, the module still tracks lighting via the lightLevel flag but does not apply Dark or Dim ActiveEffects. See Active Effects. |
| Global Illumination | World | Boolean | Off | When on, scene-wide global light grants Bright before individual sources are evaluated. See Light Source Handling. |
| Delay Calculations | World | Number | 0 | Range 0-3000 ms, step 50. Debounces recalculations so bursts of events resolve in one pass. |
| Negative Lights Support | World | Boolean | Off | Experimental. Lets sources with negative luminosity downgrade the condition. See Light Source Handling. |
| Logging Level | Client | Choice | Warnings & Errors | Off, Errors Only, Warnings & Errors, All Messages. Controls the verbosity of console output. Level 1 routes through console.error, level 2 through console.warn, and level 3 (verbose) through console.debug. All levels use a coloured module prefix for filtering. |
Hidden enable setting
Section titled “Hidden enable setting”The world enable setting is registered with config: false and is intentionally hidden from the settings UI. Its value reflects the state of the Toggle Token Light Condition button in the lighting controls. Flipping the button writes to this setting; the setting’s onChange keeps the toolbar button’s active state in sync if the value is changed by another path (such as a macro or another GM client).
The setting defaults to true, so the module is enabled on first install.
Hint text
Section titled “Hint text”The hints visible in the settings UI come from lang/en.json:
- Show TokenHud: Choose to display the HUD element when right clicking on token.
- Add Token Effects: Enable to add lighting condition effects to tokens. Disable to only track lighting with flags (TokenHUD will still work).
- Global Illumination: Enable use of Global Illumination settings in determining token light conditions.
- Delay Calculations: Delays the light condition calculation by the configured milliseconds.
- Negative Lights Support: Negative luminance will provide dim or dark conditions instead of removing them.
- Logging Level: Control the verbosity of console logging for debugging purposes.
The settings UI also displays the section header Experimental Options above the Negative Lights setting (sourced from TOKENLIGHTCONDITION.Settings.ExperimentalOptions).
onChange side effects
Section titled “onChange side effects”| Setting | What flipping it triggers |
|---|---|
enable (hidden) | Syncs the toolbar button’s active state to match the new value and re-renders controls. Token refresh on enable and effect clearing on disable are handled by TokenHelpers.toggleModule(), called from the toolbar button’s own onChange, not from this setting’s handler. |
| Add Token Effects | When turned on: re-initializes the effects system for the current game system. When turned off: refreshes all token lighting (which will skip effect creation). |
| Global Illumination | Refreshes all token lighting so the new value is applied immediately. |
| Logging Level | Updates the in-memory log level so future log calls respect the new verbosity. |
| Show TokenHud, Delay Calculations, Negative Lights Support | No immediate refresh. The new value takes effect on the next recalculation. |