Skip to content

feat(Concentration): Overhauls mod with v1.1.0 features and UX - #2367

Open
steverobertsuk wants to merge 9 commits into
Roll20:masterfrom
steverobertsuk:sr/concentration-v1-1-0
Open

steverobertsuk wants to merge 9 commits into
Roll20:masterfrom
steverobertsuk:sr/concentration-v1-1-0

Conversation

@steverobertsuk

Copy link
Copy Markdown
Contributor

This release significantly overhauls the Concentration mod, rewriting its core into ES modules with modern development tooling. It introduces a host of new features and user experience improvements, alongside comprehensive test coverage and translations into 24 languages. Version 1.0 settings, macros, and commands remain fully compatible.

Fixed:

  • Concentration end messages now accurately report when a spell concludes, avoiding ambiguity.
  • Player interactions with "Roll" and "Advantage" buttons are corrected to function as intended, rolling for the token's players or the GM.
  • Damage detection now correctly compares HP bar values numerically, preventing misinterpretations of changes.
  • One-Click settings on the Mod's page now correctly apply on startup.
  • Changing the HP Bar setting no longer requires a restart of the API.
  • Unlinked tokens now manage their concentration independently, resolving an issue where a single failed save affected all tokens from the same sheet.
  • Whisper targeting for send_reminder_to: character now correctly uses the character's full name and includes a copy for the GM.
  • Parsing of 5e OGL spell cards is improved, specifically addressing cases where charname appeared before name.

Added:

  • Explicit end-of-concentration messages, including "is no longer concentrating on…", "loses concentration on…", and "drops to 0 hit points and loses concentration on…".
  • Support for spell switching, allowing concentration to be shifted to a new spell with appropriate messaging.
  • Manual changes to the concentration marker (adding or removing) now trigger corresponding concentration start or end events with messages.
  • A new End at 0 HP setting (default on) to automatically end concentration when a token drops to 0 hit points without requiring a save.
  • Concentration save DCs now cap at 30, aligning with D&D 2024 rules.
  • New chat commands: end, status, help, and journal.
  • Two new GM-only handouts: Concentration - Help (full instructions) and Concentration - Command Deck (buttons for all actions).
  • Custom token markers can now be used for the Status Marker setting, with automatic migration of existing markers upon change.
  • An extended public API (globalThis.Concentration) for other Mods, offering isConcentrating, spellOf, start, end, and list methods.
  • Translations into 24 languages, configurable via a new Language setting.
  • Enhanced D&D 2024 spell card detection, leveraging the message's character ID when available.
  • Improved token lifecycle management: deleting concentrating tokens ends their concentration, new linked tokens of a concentrating character automatically receive the marker, and pasted marked tokens are correctly tracked.

Security:

  • Spell cards now only initiate concentration for characters controlled by the sender (or from the GM and other Mods), preventing unauthorised marking by any player.

Changed:

  • D&D 2024 cards that only mention "concentration" in their text (e.g., War Caster feat cards) can now start concentration but will no longer replace an existing named spell. Repeated spell cards for the current spell are now ignored.
  • Chat cards now use a new, consistent style aligned with other Mods, featuring settings presented as buttons within a single card.
  • The reset command now prompts for confirmation and preserves existing concentration records.
  • The source code has been refactored into ES modules under src/ and bundled using Rollup.
  • Developer documentation (docs/) has been integrated into README.md, TESTING.md, and DEVELOPERS.md.
  • New Node.js-based test suite added for enhanced stability and easier development.

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

Version 1.1 is split into modules under src/, as the other Mods I maintain
are, so it needs the same Rollup build, version bump and Prettier setup.
sync-locales waits longer between Google Translate requests than the other
Mods' copies, as the shorter waits were refused with HTTP 429.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Ending concentration posted nothing, so the last line in chat was often
the earlier "is now concentrating on" message, which read as if ending had
started it again. Every way concentration ends now says so, and on which
spell, and naming a different spell switches to it.

The rewrite also fixes players' Roll buttons acting on their selected
token, damage compared as text, unlinked tokens sharing a marker, the
One-Click settings never being read, and spell cards marking characters
the sender does not control. Chat output uses the card style of the other
Mods, and the text is translated into 24 languages.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The tests run the Mod against a Roll20 stub, so start, switch, end, saves,
sheet detection and migration from version 1.0 can be checked without a
game.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The README, changelog and new developer, file map and testing guides
follow the layout of the other Mods. The old docs folder is replaced by
TESTING.md and the README's troubleshooting section.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The 1.1.0 folder holds the same build as Concentration.js. script.json
lists the new settings for the One-Click page and the handout and token
permissions the Mod now uses.

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

The Help and Command Deck handouts now use the plain Concentration 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. A test covers new handouts and handouts made before.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The root script and the 1.1.0 snapshot are rebuilt without a version bump and remain identical.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…e 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 Concentration 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.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The built script and its 1.1.0 copy carry the new icon path. 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants