fix(HealthColors): Version 2.1.1 - Bug fixes#2217
Open
steverobertsuk wants to merge 4 commits intoRoll20:masterfrom
Open
fix(HealthColors): Version 2.1.1 - Bug fixes#2217steverobertsuk wants to merge 4 commits intoRoll20:masterfrom
steverobertsuk wants to merge 4 commits intoRoll20:masterfrom
Conversation
Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
… menu interaction - Fixed aura visibility threshold for tokens at or above the configured HP threshold, ensuring correct aura behavior. - Updated `!aura` settings menu to always show the interactive GM menu after changes, resolving issues with read-only panels. - Enhanced token refresh logic to immediately re-evaluate existing tokens when the HP threshold changes. - Removed unused `applyDefaultAura` function and cleaned up redundant code. - Refactored command dispatch in `handleInput` to reduce boilerplate and improve readability. - Updated progress messages to reflect the script name and changed terminology for clarity. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
- Added version 1.7.1 sourced from Roll20 forums for selectable previous version. - Fixed aura visibility threshold logic for tokens based on HP. - Improved settings menu interaction after changes. - Enhanced error handling for missing custom FX names. - Refactored code for clarity and reduced complexity. - Updated JSDoc comments for accuracy. - Added new commands for FX management and settings visibility. - Updated README with new command references and usage instructions. - Updated script.json to reflect new version and authors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[2.1.1] – 2026-05-07 · Milestone
Added
Fixed
Percentage PC/NPC): tokens at or above the configured HP threshold were incorrectly shown a green default aura instead of having the aura hidden. Changed comparison from>=to>and replacedapplyDefaultAura()withclearAuras()in the above-threshold branch so the aura correctly disappears when a token's HP is not below the threshold. Also added a guard so a threshold of0clears the aura rather than treating it as "always show". (#1)!aurasettings menu after a change: clicking a button and submitting the dialog caused a non-interactive read-only panel (using<span>pills) to appear in public chat instead of re-displaying the interactive GM-whispered menu. Root cause washandleInputcallingshowSettingsInGameChat()on every setting change instead ofshowMenu(). The interactive GM menu is now always shown after a change; the read-only public snapshot remains available via the explicit!aura settingscommand. (#3, #4)!aura percnot refreshing tokens already on the map: changing the HP threshold now immediately re-evaluates all existing tokens viamenuForceUpdate(), so tokens that were visible under the old threshold are correctly cleared (or revealed) without requiring a token move.USEBLOODattribute is set to a custom custfx name that no longer exists in the campaign (e.g. after a campaign reset or character import). The error message now identifies the character by name so the GM knows whichUSEBLOODattribute to correct. The script also falls back to-DefaultHurtso a visual effect still plays instead of silently doing nothing. (#2)Changed
applyDefaultAurafunction — it was superseded byclearAuras()in the threshold fix but never deleted.changedSettingvariable fromhandleInput— it was assigned in ~20 places but never read, asshowMenu()was always called unconditionally at the end of the function.SCRIPT_NAME; text changed from"Fixing N Tokens"/"Finished Fixing Tokens"to"Refreshing N Tokens"/"Finished Refreshing Tokens".handleInputcommand dispatch refactored — 27 switch cases reduced to 5 dispatch-table lookups (TOGGLES,STRINGS,FLOATS,SHAPES,HEXES) plus a 13-case switch for commands with unique behaviour, removing ~100 lines of repetitive boilerplate.showSettingsInGameChatrefactored to reduce cognitive complexity: extractedboolPillandnamePillmodule-level helpers (read-only counterparts to the existingtoggleBtn/nameBtn), replacing 8 repeated inline ternary expressions and an inlinepickNameStyleclosure.@param [update]fromapplyAuraAndDead(parameter was removed in an earlier refactor); correctedspawnDefaultFxByIddescription which falsely claimed to tighten particle profile settings; correctedboolPilldescription (background colour, not text colour); correctedregisterEventHandlerslistingchange:tokeninstead ofchange:graphic; documented the missing British/American colour-key variants onFX_PARAM_DEFAULTS; removed stalepColorreturn-type entry fromresolveTypeConfig.