Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Aura/Tint HealthColors API v2.0.0

1780236091

Edited 1780236178
MidNiteShadow7
Pro
API Scripter
Hi Ed, I've created an update that can be manually installed from here:&nbsp; <a href="https://www.dropbox.com/scl/fi/gteg92lz330dpk0wjujiz/HealthColors_v2.1.4.beta.1.zip?rlkey=pe35742kf9gwn0baqfj8w38uj&amp;dl=0" rel="nofollow">https://www.dropbox.com/scl/fi/gteg92lz330dpk0wjujiz/HealthColors_v2.1.4.beta.1.zip?rlkey=pe35742kf9gwn0baqfj8w38uj&amp;dl=0</a> As I am not a DM, I don't have games set up using those mods, but I will aim to create a test game later today or tomorrow if possible (working on a few other sites atm), and I will post when I have had a chance. But in the meantime, feel free to download the beta version linked above and see if it works on a copy of your game. Below is the current CHANGELOG: [2.1.4.beta.1] – 2026-05-31 · Milestone Fixed Fixed HealthColors not responding when HP is changed by an external script (e.g. AlterBars) that modifies the character attribute linked to a token bar rather than the token bar directly. Roll20 fires change:graphic too late in this path — prev.bar1_value already reflects the new value, so the early-return guard blocked every update. Added a dedicated change:attribute listener ( registerAttributeListener ) that fires reliably with genuine old/new values, verifies the token's bar is actually linked to the changed attribute, constructs a correct fakePrev , and calls handleToken with the real delta so aura/tint and dead-status update correctly. Fixed duplicate particle FX spawning when both the change:attribute and change:graphic listeners fire for the same HP change. The recentAttrFires Set tracks tokens recently handled by the attribute listener; the change:graphic wrapper ( handleTokenChange ) passes update='YES' for those tokens to suppress the redundant FX, and the marker is cleared after a 250 ms deduplication window. Fixed TokenMod's observer receiving the raw handleToken instead of handleTokenChange , causing TokenMod-triggered HP changes to bypass FX deduplication entirely. Fixed a race condition in applyAttrHpChange where two rapid HP changes within the 50 ms propagation window could cause the first timeout to overwrite the bar value already set by the second change. At timeout fire time the live bar value is now compared three ways: if it matches newVal Roll20 already propagated it (skip the set); if it matches neither oldVal nor newVal a concurrent change has landed (bail entirely); only if it still equals oldVal is the bar written. Fixed add:graphic handler: corrected from change:graphic to add:graphic in registerEventHandlers and added a null guard so the delayed token lookup safely handles tokens deleted before the 400 ms fires. Changed Extracted four input-normalization helpers ( normalizePercent , normalizePositiveNumber , normalizeYesNoOff , normalizeTrackName ) and applied them throughout handleInput , replacing ad-hoc inline validation with consistent, tested helpers. JSDoc corrections: applyDeadStatus.prevValue type widened to {number|string} ; toggleBtn and boolPill background-color descriptions corrected from green/red to blue/red (the true/false button background is #6FAEC7 , not green); registerEventHandlers bullet list updated to name handleTokenChange and add:graphic correctly.
Thanks. Appreciate all you have done
Ed W. said: Thanks. Appreciate all you have done Please let me know if that fix has worked for you. If not, I'll take another look at the code.
Hey MidNite, &nbsp;Sorry the fix didn't work. Still doesn't detect if the hit points are reduced by another macro like alterbars