Breaking Changes
- Raise the minimum Foundry VTT version to v14. Verified compatible through 14.366.
- Remove the standalone logging-level setting. Log verbosity is controlled centrally through 3DS:ATLAS.
- Rename the stored Delay Calculations setting key to camelCase. No migration runs, so a world that configured a delay loses it and reverts to no delay. Re-enter the value after upgrading.
- Require the 3DS:ATLAS module for logging, update notices and translations.
- [#12] Light levels are recalculated on Foundry v14 source semantics, so existing worlds will see different levels on the first refresh after upgrade.
- [#12] Remove the Global Illumination setting. The scene's global light and its darkness range are always read.
- [#14] Store the token light level on the TokenDocument instead of the actor, so two tokens sharing one linked actor stop overwriting each other's level.
- [#15] Remove the module enable setting and its lighting toolbar toggle. Disabling the module in Manage Modules is the only kill switch.
- [#8] Remove the Negative Lights Support setting. Lights configured to create darkness always lower a token's level. Earlier versions ignored them unless the off-by-default toggle was enabled.
New Features
- [#11] Report the drawn scene, effect queue depth and per-token light level counts to the 3DS:ATLAS troubleshooter.
- [#12] Add a
tokenlightcondition.gatherLightSourceshook for contributing lights the scene does not model as Foundry lights. - [#16] Add
getEffectiveLightLevel(token), which reports dark as dim when the token's vision mode sees unlit ground. - [#16] Add
recalculate(token, position)for updating a single token. - [#7] Add a public module API at
game.modules.get("tokenlightcondition").api, mirrored onglobalThis.TLC.api, exposing determineLightLevel, getEffectiveLightLevel, getLightLevel, recalculate and refreshAllTokenLighting. - [#7][#16] Fire a
tokenlightcondition.lightLevelChangedhook with (tokenDocument, newLevel, oldLevel) on every client, keyed on the token flag write. It reports null when a token's light level is cleared and skips tokens whose effect write failed.
Bug Fixes
- [#10] Match the PF2e legacy item cleanup on the English names earlier versions actually wrote, so a translated world no longer leaves an orphaned effect item behind.
- [#11] Correct the dnd5e verified compatibility version, which was recording a Foundry version number instead of a dnd5e one.
- [#12] Apply light-restricting tiles to every source and test them against the painted tile instead of its bounding box.
- [#12] Rebuild the light level calculation on Foundry v14 source semantics. Each light is tested with core's own point test, so light walls occlude instead of sight walls and a light's Constrained by Walls setting is honoured.
- [#12] Score a globally lit scene with no ambient lights from the scene's global light, dim or bright, instead of dark for every token.
- [#12] Stop light passing through a floor, and match core's cylinder for range when a token is above or below a light.
- [#12] Take darkness from the token's point, so Adjust Darkness Level regions apply.
- [#12] Treat darkness sources as darkness rather than ordinary light and resolve them against light by priority, so a token standing in magical darkness reads dark.
- [#13] Contain a failure in one game system's effect setup so it can no longer abort the rest of initialization.
- [#13] Draw the dim and dark lighting effects on the token again by forcing the effect icon to always show.
- [#13] Identify the dim and dark effects by module flag instead of a pinned id, so a repeat write clears the previous effect instead of stacking a second one.
- [#13] Match PF2e lighting effect items by module flag or slug instead of their localized name, so renamed or translated items are still found, reused and deduped.
- [#13] Read the Chris's Premades effect interface setting through a guarded check, so an unregistered setting no longer aborts module startup or silently suppresses every effect.
- [#14] Keep processing the effect queue while the Foundry tab is backgrounded.
- [#14] Leave the stored light level and its effect unchanged when a calculation or effect write fails, so the token retries on its next recalculation.
- [#14] Re-derive each queued token's level at the moment its effects are written instead of replaying the level captured when it was queued. Aged queue entries are recalculated instead of discarded.
- [#14] Resolve
refreshAllTokenLightingonly after the flags and effects are committed, and coalesce concurrent full refreshes instead of dropping them. - [#15] Clear the dim and dark effects from every token on the scene when Add Token Effects is turned off, and re-apply them from each token's stored light level when it is turned back on.
- [#15] Register settings at init instead of ready. PF2e effect item creation and Chris's Premades wiring are no longer silently skipped, and a token is no longer ignored for one pass the first time it is seen.
- [#16] Fix the HUD badge to read the token whose HUD is open, which previously errored for linked actors with two or more tokens controlled.
- [#16] Hide the HUD badge instead of showing a fabricated Bright when no level is stored.
- [#17] Clear the effects left on a linked actor when its last token is deleted.
- [#17] Follow animated day/night darkness transitions and direct animateDarkness calls, which previously froze every token at the pre-transition level.
- [#17] Recalculate a moved token from its committed destination after the movement animation ends instead of from the interpolated position mid-drag.
- [#17] Recalculate on actor HP changes, so a downed token clears its level and a healed one re-acquires it.
- [#17] Recalculate on scene load and scene switch, wall and door changes, and light-restricting tile changes.
- [#17] Refresh every token when a light-emitting token is created, hidden or moved, instead of only that token.
- [#17] Retrigger a recalculation when a light-emitting token rotates, since that is what aims a light cone.
- [#18] Run the lighting pipeline only on the 3DS:ATLAS primary GM, so a connected Assistant GM no longer duplicates effect writes.
- [#8] Measure the bright radius as the same elevation cylinder core uses for the outer radius, so a token hovering well above a torch is no longer scored bright on planar distance alone. Contributed sources from the gatherLightSources hook are measured against the same elevation band.
Changes
- Repo tooling only, no runtime effect: standalone eslint, prettier and stylelint configs, .vscode and i18n-ally settings, formatting passes, and the MIT LICENSE copyright holder rename.
- [#10] Rename the HUD element to a module-prefixed id and class, with its three colours on module-owned CSS custom properties.
- [#10] Route the dim and dark effect names, their descriptions and the HUD label through ATLAS localization, and give the PF2e effects the same wording as every other system.
- [#10] Split the single script into api, hooks, effect-queue and lighting-controller modules with an explicit bootstrap entry, flatten the utils directory and break the settings/queue import cycle. Internal restructure, no behaviour change.
- [#12] Gather and order the light source list once per refresh instead of once per token, and stop the scan once a token is bright on a scene with no darkness sources.
- [#13] Trim the effect flags to a single type discriminator.
- [#16] Accept a Token or a TokenDocument on every API entry point.
- [#16] Give the HUD badge a working tooltip and make it keyboard focusable.
- [#16] Publish the API at init instead of ready, so
module.activeis a sufficient guard. - [#17] Skip the refresh and log when the acting GM is not viewing the active scene, since light can only be computed for the drawn scene.
- [#9] Build the module as a single minified rollup bundle with an extracted stylesheet, and ship the release zip from the built dist directory instead of the raw source folders. Packaging only, no runtime behaviour change.
Documentation
- Refresh the module's listing description.
- Update the bug report form's version examples to reference current Foundry (14.366) and dnd5e (6.0.0) releases.
- [#11] Correct the HUD indicator description in the README and drop the stale Foundry V13 compatibility caveats.
- [#11] Fix the Readme and License links in the module manifest, which pointed at a nonexistent dev branch and returned a GitHub 404 from the module listing.
- [#11] Remove the magical darkness drawing feature from the README along with its dead implementation. It was never wired to anything.
- [#11] Require a troubleshooter file on the bug report form.
- [#17] Document the active scene limitation in the README Known Limitations section.
What's Changed
Full Changelog: release-1.2.0...release-1.3.0
Installation: To manually install this release, use the following manifest URL: https://github.com/Sayshal/tokenlightcondition/releases/download/release-1.3.0/module.json