Skip to content

feat(HealthColors): Introduces shared ownership with DeathTracker - #2375

Open
steverobertsuk wants to merge 6 commits into
Roll20:masterfrom
steverobertsuk:sr/healthcolors-v2-5-0
Open

steverobertsuk wants to merge 6 commits into
Roll20:masterfrom
steverobertsuk:sr/healthcolors-v2-5-0

Conversation

@steverobertsuk

Copy link
Copy Markdown
Contributor

Implements a shared ownership system with DeathTracker (v1.0+) to co-manage death saves, token colours, and particle effects. HealthColors now optionally defers control over these areas to DeathTracker or disables them entirely, preventing conflicts. Also updates the help handout to display the HealthColors icon and include detailed documentation on the new ownership system.

[2.5.0] – 2026-11-04

Added

  • Who handles what, shared with DeathTracker. HealthColors and DeathTracker 1.0 or later can both do three things: track death saves with the dying, stable and dead markers, colour tokens by health, and play hurt and heal effects. A new Who handles what section at the top of the !aura menu, and !aura owner <deathsaves|colours|effects> <HealthColors|DeathTracker|off>, choose which Mod does each, or neither. The choice is stored once (state.ModOwners) and DeathTracker's settings show and change the same values, so the two Mods always agree; changing it in either refreshes both Mods' tokens.
  • At first, with DeathTracker installed, DeathTracker handles death saves and HealthColors the colours and effects. Without DeathTracker, HealthColors handles all three. DeathTracker 0.1 is not affected.
  • When HealthColors does not handle death saves it adds no dead (Red X), dying or stable marker of its own and its Death Save Integration stays idle (no field watching, no polling; !aura deathsaves sync says who handles them). When it does not handle colours it adds no aura or tint and takes its own off; when it does not handle effects it plays no heal or hurt FX. The death sound and nameplates are always HealthColors'.
  • The GM menu, the help handout (command table and the DeathTracker integration, marked detected or not installed) and the startup log show who handles what. The public API gains HealthColors.ownersChanged(), which DeathTracker calls after a change.

Breaking Changes

None. This update is additive and enhances compatibility with DeathTracker.

Signed-off-by: Steve Roberts steve@shadowcomputers.co.uk

DeathTracker 1.0 sets the dead, dying, stable and bloodied markers and
tracks death saves itself. With both Mods running, HealthColors also
added its Red X or dying marker to the same tokens, so the two fought
over markers and HealthColors marked PCs nobody controlled as dead.

When DeathTracker 1.0 or later is installed (it exposes
isManagingDeathSaves; 0.1 does not), HealthColors now adds no dead,
dying or stable marker and its Death Save Integration stays idle:
no field watching, no polling, and `!aura deathsaves sync` says why.
It still colours tokens and plays the death sound. The GM menu, the
help handout (DeathTracker detected or not installed) and the startup
log say so. Released as 2.5.0, with its snapshot.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
HealthColors and DeathTracker 1.0 can both track death saves with the
dying, stable and dead markers, colour tokens by health and play hurt
and heal effects. Until now HealthColors simply stood aside on death
saves whenever DeathTracker was installed, with no way to choose.

A new "Who handles what" section at the top of the !aura menu, and
!aura owner <deathsaves|colours|effects> <HealthColors|DeathTracker|off>,
choose which Mod does each, or neither. The choice is kept once in
state.ModOwners, which DeathTracker reads and writes as well, so the two
Mods always agree, and a change in either refreshes both Mods' tokens
(the public API gains ownersChanged for this). With DeathTracker
installed, DeathTracker starts with death saves and HealthColors with
the colours and effects; without it, HealthColors does all three.

When HealthColors does not handle an area it leaves it alone: no 0 HP
markers and an idle Death Save Integration, no aura or tint (its own is
taken off), or no heal and hurt effects. The death sound and nameplates
stay HealthColors'. The help handout, menu notes and startup log show
the choice. Still released as 2.5.0, with its snapshot.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The README gains the "Who handles what" menu section, the !aura owner
command and a table of the three shared areas, and the DeathTracker
integration now describes the shared choice. TESTING.md checks the
starting choice and hand-overs from both Mods' menus.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
… Journal

The Help & Reference handout now use the plain HealthColors icon from Roll20's file store as their journal icon (the handout avatar). The icon is set when a handout is created and added to handouts from earlier versions, so existing games get it too.

Roll20 stores the avatar as max.webp with a number, so a handout counts as having the icon when its avatar contains the image's path. Only the webp files exist (thumb.png is a 404), so the URL uses thumb.webp. The root script and the 2.5.0 snapshot stay identical.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
… handout

Roll20 always stores a handout's journal icon as the full-size file, whatever size the Mod asks for, and shows that file at its natural size at the top of an open handout. The HealthColors icon was a 1024 pixel upload, so it filled the handout above the text.

The icon now points at a 100 pixel copy of the same artwork. Handouts from earlier builds are matched on the image path, so they change to the small icon the next time the Mod starts.

The 2.5.0 copy is updated with the script. The version number is unchanged.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant