Skip to content

Token HUD Indicator

Right-clicking a token opens its HUD. When Show TokenHUD is on, a coloured icon appears in the HUD’s right panel for the token’s current lighting condition:

ConditionIconColourSource value
BrightSun (fas fa-sun)Gold (rgb(255 215 0))flags.tokenlightcondition.lightLevel = 'bright'
DimFilled moon (fas fa-moon)Silver (rgb(192 192 192))flags.tokenlightcondition.lightLevel = 'dim'
DarkOutlined moon (far fa-moon)Grey (rgb(102 102 102))flags.tokenlightcondition.lightLevel = 'dark'

The badge is a disabled <button> element with id light-level-indicator-icon and CSS classes control-icon token-light-condition <condition>. Tooltip text is Light Level: Bright, Light Level: Dim, or Light Level: Dark depending on the current condition.

If a token’s HUD opens with a stale indicator from a previous selection, the element is removed and re-created with the current condition.

Both GMs and players see the badge. The displayed condition is read from flags.tokenlightcondition.lightLevel on the actor, which the GM client writes and Foundry replicates to all connected clients.

For players, this means the indicator can briefly lag a movement until the GM client has finished the recalculation and flag update.

The badge is suppressed if any of the following are true:

  • The world enable setting is off (toolbar toggled off).
  • The client setting Show TokenHUD is off for the user.
  • The selected token’s actor type is not character or npc.
  • The actor’s current HP is not greater than 0.
  • More than one token is selected and the HUD-opened token cannot be resolved (multi-select uses the token the HUD was triggered for).

The colour rules live in styles/tokenlightcondition.css and use a single nested .control-icon.token-light-condition selector with &.bright, &.dim, &.dark modifiers. Override them in a world stylesheet or another module’s CSS by matching the same selectors.