Repository navigation
feat(Hexploration): Rewrite for Jumpgate and Legacy games - #2362
Open
steverobertsuk wants to merge 24 commits into
Open
steverobertsuk wants to merge 24 commits into
steverobertsuk wants to merge 24 commits into
Conversation
Version 1 was concatenated by Grunt and linted by JSHint with globals copied from ItsATrap. Version 2 uses the same pipeline as ConditionTracker and CombatEncounterDirector: Rollup bundles ES modules from src/ into Hexploration.js and a version snapshot folder, Prettier formats the output, and scripts handle version bumps and locale syncing. Node's built-in test runner replaces the lint step. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Version 1 stopped working in Jumpgate: shapes drawn there are pathv2 objects, which it looked up as Legacy paths, and its hex sizes were measured from the Legacy grid. It also relied on four unsupported helper mods. The rewrite is self-contained and split into ES modules: - Reads and draws both path and pathv2, choosing by the game engine. - Uses exact hex geometry: Legacy keeps v1's spacing so old maps stay aligned; Jumpgate uses the client's regular 70 px hexes and the page grid offset set by the map alignment tool. - Draws hexes on the foreground layer when available, in batches so large fills do not trip the API watchdog. - Reveals along a token's whole route and under large tokens, with line of sight, a glimpse mode and per-hex reveal limits. Only player tokens reveal by default, so GM-moved monsters no longer uncover the map. - Hides player-visible names, bars and auras of tokens under covered hexes, because Roll20 draws them above the foreground layer. - Adds hidden locations, named hexes, reveal and conceal, undo, reset, rescan for copied pages, grid calibration, page overrides and a status card. - Restricts every command to GMs, escapes chat output, and keeps the v1 commands and migrates v1 state. - Adds Help and Command Deck handouts and 24 languages. Locales not yet translated fall back to English. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The hex grid and path maths are pure modules, so they are tested directly, including round trips, page coverage, token footprints, calibration and both path formats. A small stand-in for the Roll20 sandbox loads the built Hexploration.js and drives real commands and token moves for Jumpgate, Legacy and v1 upgrade scenarios, failing if the mod logs an error. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The README covers installation, commands, settings, how revealing works, Jumpgate and Legacy behaviour and the API for other mods, and credits Ada Lindberg as the original author alongside the new maintainer. CHANGELOG, DEVELOPERS, MOD_FILE_MAP and TESTING follow the same layout as the other rebuilt mods; TESTING includes the in-game checklist and test game setup. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Updates script.json for the One-Click library (version 2.0.0, no dependencies, new description, authors and useroptions for hex layer, revealing tokens and language) and adds the built Hexploration.js with its identical 2.0.0 snapshot. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The locale files committed with the rewrite were mostly English stubs, so every language other than English fell back to the en-US strings. Machine-translate the full en-US set into the other 23 locales, re-translating the count messages that were reworded to the "Label: n" style and the new covered-token strings. Strings the translator returned in English or half-translated were retranslated; those left matching English are shared words or Roll20's own names, such as "Status" and "Hex (V)". Format the locale files with the project's Prettier settings, and rebuild the script and the 2.0.0 snapshot so they carry the translations. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The changelog listed versions without saying when they were released, which made it hard to tell how old the version 1 releases are. Add a date to each version heading, matching ConditionTracker's style. The version 1 dates are the last change to each version folder on master; 2.0.0 carries the build date and should be updated on submission. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The Help handout listed all 24 languages as one comma-separated line, which was hard to scan and did not make clear which code to type. Show them as a table with the English name and flag, the native name, and the code to use with !hexploration set language. Add the three column headings to every locale, and rebuild the script and the 2.0.0 snapshot. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Version 1 had src/Chat.js. The rewrite replaced it on a case-insensitive file system, so git kept the capital C while every import names ./chat.js, which would break the build on a case-sensitive checkout. Rename the tracked file to chat.js to match the imports and the other mods. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Google Translate read "hex" as hexadecimal in 15 languages, as "witches" in Afrikaans, and turned "Command Deck" into a ship's deck. Many button and setting labels were also unnatural, and some help text quoted labels that did not match the buttons. Hand-translate the affected strings, review the labels in every locale, and keep the help text in step with the labels it quotes. Keep "Command Deck" in English everywhere: it is the name of a handout, so the deck subtitle now comes from a DECK_TITLE constant rather than a translation. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Roll20 on Windows shows emoji flags as letter pairs, so flags drawn from an emoji font are unreliable. Draw each locale's flag as a Twemoji SVG image, as ConditionTracker does: before each code in the Help handout's language table, on the language picker buttons, and beside the current language on the settings card. Rebuild the script and the 2.0.0 snapshot. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Google Translate turned "!hexploration set language" in the Help handout's language section into Italian words, so Italian users were told to type a command that does not exist. Put the command back, and rebuild the script and the 2.0.0 snapshot. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Jumpgate's pathv2 objects silently ignore rgb() and rgba() fill and stroke colours and keep the colour they already had. The default glimpse colour is rgba(34,34,34,0.5), so glimpsed hexes in Jumpgate stayed solid and glimpse appeared not to work, as a user reported. The same applied to rgba() fill colours meant to make see-through hexes. Colours written to pathv2 hexes are now converted to #rrggbb, or to #rrggbbaa when they have transparency; both are accepted and drawn see-through. Legacy paths accept rgba(), so they keep the colour as set. The conversion covers new hexes, restyled hexes, undo and glimpse. Hexes that 2.0.0 marked as glimpsed without changing their colour are repainted the next time a token sees them. The test stub now drops pathv2 colours Jumpgate would reject, so the tests catch this kind of regression. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Roll20 chat strips inline background colours written as #rrggbbaa or as rgb() with a fourth value, so the swatch next to such a colour on the settings card was empty. A user found the swatch did not match the colour they had set. Swatches now draw colours with transparency as rgba(), which chat keeps, and opaque colours as #rrggbb. The text beside the swatch still shows the colour exactly as it was typed. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The colour fixes left it unclear which colour formats the settings accept and why the colour on a Jumpgate hex can differ in form from the one typed. A user had used rgb() with a fourth value and could not tell whether it was supported. The README gains a Colours section listing the hex, rgb() and rgba() forms, how transparency is written in each, how Jumpgate hexes are converted to #rrggbb or #rrggbbaa, and why colour names should be avoided in Jumpgate. The Fill and Glimpse Colour rows now speak of a colour with transparency rather than only rgba(). The testing checklist gains glimpse, fill and swatch checks with the colour forms the user reported. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
A user changed Hex Reveal Distance and Line of Sight, saw no difference, and could not work out what either did from the help. Both behave as designed, but the help did not say when they matter: - Hex Reveal Distance is stored on each hex when it is filled, so changing it does nothing to hexes already on the map. - Hexes are revealed nearest first, so Line of Sight only blocks behind hexes that stay covered, and needs a Sight Distance of 2 or more. The help handout, the settings descriptions and the README now say so, with a mountain range example: fill the mountains with Hex Reveal Distance 0, then the land beyond with no limit. The README gives the example as commands in a new Terrain That Blocks Sight section, and notes that glimpsed hexes do not block Line of Sight. The five changed strings are translated into all 23 other languages, using each language's existing setting names so the help matches the buttons. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Bumps the version to 2.0.1 for the Jumpgate glimpse and colour fixes, the swatch fix and the clearer sight help. It is released alongside 2.0.0 in the same pull request, so 2.0.0 is added to the previous versions and its snapshot folder is left as it was. The rebuilt script is copied to the new 2.0.1 folder, and the changelog, testing checklist, developer notes and README API example carry the new version. The README introduction now says "Version 2" so it does not need changing for each release. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Version 1 had src/Locations.js and src/State.js. The rewrite replaced them on a case-insensitive file system, so git kept the capitals while every import names ./locations.js and ./state.js. A clone on a case-sensitive file system could not build the script. Rename the tracked files to match the imports, as was done for chat.js. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Naming a hex in Jumpgate made Roll20 show "Something Went Wrong" and stop drawing the tabletop, and it happened again every time the page was opened. A text created through the API without a font gets the font "unset", and Jumpgate cannot render it. Name labels are now created in Arial. Labels made by 2.0.0 and 2.0.1 are given the font when the sandbox starts, and when Rescan re-links them, so pages that already crash are mended without renaming every hex. The test stub now gives a text the "unset" font, as Roll20 does, so the tests would catch a label made without one. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
A fill that covers a token marked with Mark Location hides it and uses up the mark. Undo Fill put the token back on the token layer but did not restore the mark, so the next fill covered it as an ordinary token: it stayed visible under the hexes to the GM only and was never announced when the party found it. The fill now records which hidden tokens were marked, and undo marks them again, so filling after an undo hides them as before. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Name labels sit on the GM layer, which Jumpgate draws below the foreground layer, even while the GM layer is selected. With hexes on the foreground layer, the default, a label is hidden under its own hex, and the help still said the GM would see it. The help handout, in all 24 languages, and the README now say that in Jumpgate the labels only show over covered hexes when Hex Layer is set to the token layer, and that each name is still announced when its hex is revealed. The translations use each language's own names for the setting and the layers. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Bumps the version to 2.0.2 for the name label and Undo Fill fixes and the note on where labels show in Jumpgate. Like 2.0.1, it goes into the same pull request as 2.0.0, so 2.0.1 joins the previous versions and its snapshot folder is left as it was. The rebuilt script is copied to the new 2.0.2 folder, and the changelog, testing checklist, developer notes and README API example carry the new version. The testing checklist gains checks for the label crash, the repair of older labels and Undo Fill keeping marked locations. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The machine translations rendered "hex" as the wrong word in many languages: hexadecimal (French, German, Finnish), witch (German, Danish, Dutch), spell (Portuguese, Turkish), magic (Hebrew), a hexadecagon or a solid shape (Greek, Russian) and game counters (Danish, Swedish). Some messages were partly left in English, several said the opposite of the English, and Legacy was translated as "heritage" instead of being kept as Roll20's name for the old editor. Every string in the 23 translations was proofread against the English and corrected where it was wrong: - Each language now uses one word for hex, matching its setting names, so the help and messages agree with the buttons. In Russian, Ukrainian, Polish and Czech, the two setting names that used the long word for hexagon now use the short word every other string uses. - Leftover English, broken grammar and inverted meanings are fixed, and invisible zero-width spaces left by the translator are removed. - The `!hexploration set language` command in the help is no longer translated, so it works when copied. - A corrupted colour example, rgba(0,0,0,0,8), is fixed in Czech and Hungarian. Placeholders, keys and list lengths are unchanged in every language. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The translations are bundled into the script, so rebuild it and refresh the 2.0.2 snapshot folder to match. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
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.0.0 - 2026-10-29
A full rewrite by MidNiteShadow7 of Ada Lindberg's Hexploration, which no longer worked in Jumpgate games.
Fixed
pathv2) can be filled, hexes are drawn aspathv2, and deleted Jumpgate hexes are forgotten.Added
white-towermarker still works.Hexploration.revealAround(token)API for other Mods, and automatic support for tokens moved by TokenMod.Changed
!hexplorationwith subcommands. The version 1!hexploration_*commands still work.2.0.1 - 2026-10-30
Fixed
rgb()andrgba()colours on drawn shapes, so glimpsed hexes kept their solid fill. Fill, border and glimpse colours are now converted to#rrggbbor#rrggbbaafor Jumpgate hexes, sorgba()fill colours make see-through hexes too. Hexes left solid by 2.0.0 are repainted the next time a token sees them.#rrggbbaacolours andrgb()colours with a fourth value, leaving the swatch empty.Changed
Signed-off-by: Steve Roberts steve@shadowcomputers.co.uk