Repository navigation
feat(Resizer): Rewrite for Jumpgate and Legacy games - #2371
Open
steverobertsuk wants to merge 13 commits into
Open
steverobertsuk wants to merge 13 commits into
steverobertsuk wants to merge 13 commits into
Conversation
…cales to sync-locales sync-locales used to re-send every string still identical to English on each run. Many are meant to stay English, so Hex (V) and Hex (H) turned into hexadecimal and CRL into a certificate revocation list. It also needed hand-editing all 23 locale files before a reworded English string would be translated again, and sent one request every 2 seconds. - Only strings missing from a locale are translated by default. --untranslated brings back the old behaviour. - --keys a.b,c.d translates the named keys again; unknown keys are an error. - --dry-run lists what would be translated, per locale and key. - --concurrency=N translates N locales at once (default 4); 429s and server errors are retried with back-off. - Placeholder-only strings are not sent, a translation whose placeholders did not survive keeps the English, mask tokens are matched in any case, and files are formatted with the Mod's Prettier settings so unchanged lines stay unchanged. - The estimate before confirming counts the strings to send. The script is now the same file in every Mod. DEVELOPERS.md lists the options. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…o sync-locales sync-locales used to re-send every string still identical to English on each run. Many are meant to stay English, so Hex (V) and Hex (H) turned into hexadecimal and CRL into a certificate revocation list. It also needed hand-editing all 23 locale files before a reworded English string would be translated again, and sent one request every 2 seconds. - Only strings missing from a locale are translated by default. --untranslated brings back the old behaviour. - --keys a.b,c.d translates the named keys again; unknown keys are an error. - --dry-run lists what would be translated, per locale and key. - --concurrency=N translates N locales at once (default 4); 429s and server errors are retried with back-off. - Placeholder-only strings are not sent, a translation whose placeholders did not survive keeps the English, mask tokens are matched in any case, and files are formatted with the Mod's Prettier settings so unchanged lines stay unchanged. - The estimate before confirming counts the strings to send. The script is now the same file in every Mod. DEVELOPERS.md lists the options. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Resizer 1.0 is built from ES modules under src/ like the other rewritten Mods (PageFX, TokenController, Hexploration), so it gets the same tooling: - package.json with Rollup and Prettier, and its lock file; - rollup.config.js, which bundles src/ into Resizer.js and the version snapshot folder, injecting the name, version and build date from script.json; - scripts/build.mjs and bump-version.mjs for builds and versions; - scripts/sync-locales.mjs, the shared locale sync script, unchanged; - .prettierrc.json, .prettierignore, .gitattributes (LF endings) and .gitignore (node_modules, zips and pre-release builds). Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…d undo Resizer 0.0.9 had not been touched since 2018 and predates Jumpgate. Scaling a page only knew Legacy drawings, so Jumpgate drawings, walls, doors and windows were left behind; it multiplied the page's distance per cell (5 ft cells became 10 ft); `scale 2 up` actually shrank the page because the direction word was read twice; it assumed 70 px cells everywhere; and undo lived in shared variables that a sandbox restart lost, or that could change the wrong object. 1.0 is a rewrite in modules: - geometry.js: pure maths for every object kind's zoom (graphics, text, pathv2, Legacy paths, doors and windows with their y-up handles), the page grid (snapping increment and Jumpgate grid offset), fit, centre, drawing boxes and map calibration. - operations.js: zoom (keeping scale_number, with an option to keep token sizes), resize in pixels, cells or page units, creature sizes, page size, fit, centre and calibrate. Legacy paths are drawn again at their new size, because Jumpgate neither redraws a Legacy path a Mod changes nor keeps its scale after a reload (found live). - undo.js: every change is recorded and the last 10 are kept in state, one entry per command across all pages; undo re-links Legacy paths that were drawn again. - pages.js: the GM's page, --pages lists and the page picker. - commands.js and menu.js: the chat menu, history, page picker and settings cards; Roll20 queries for the numbers; --ids for other Mods, whose commands are accepted and answered to the GM; every 0.0.9 command mapped onto the new ones. - state.js: state.RESIZER is upgraded in place, keeping a renamed command. - journals.js: the Help and Command Deck handouts. - index.js: the public Resizer API (zoomPage, undo, history and an onZoom hook for Mods that store page positions), keeping 0.0.9's CheckInstall and RegisterEventHandlers names. i18n.js picks a key's _one form when the count is 1. en-US holds every string; the other 23 locales are empty until the next commit. Tests run the built bundle against a Roll20 stub: every object kind zoomed and undone exactly, batches, calibration with grid offsets, creature sizes, the 0.0.9 upgrade and syntax, settings and handouts. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The Google endpoint that scripts/sync-locales.mjs uses refused every
request (HTTP 429), so the 23 locales were translated by Claude
instead, following the house rules: placeholders, --flags, command
words, setting keys and the handout names stay as they are; GM and Mod
use the tabletop and Roll20 senses; D&D creature sizes use the official
names where a translation exists; and Roll20 query labels contain no
| , { or }, which would break the prompts.
scripts/check-locale.mjs checks a locale against en-US: the same keys
and array lengths, the same placeholders and flags, and safe query
labels. All 23 pass. tests/locales.test.mjs renders the menu, settings,
history and both handouts in every language and checks that no
untranslated key shows.
Languages: af, ca, cs, da, de, el, es, fi, fr, he, hu, it, ja, ko, nl,
pl, pt-BR, pt-PT, ru, sv, tr, uk, zh-TW.
Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Resizer.js is now the Rollup build of src/, and 1.0.0/Resizer.js the byte-identical snapshot for the One-Click library. 0.0.9/ is left as Robin Kuiper released it. script.json: - version 1.0.0, with 0.0.9 in previousversions; - authors "Robin Kuiper, MidNiteShadow7"; - a new description covering zoom, calibration, creature sizes and undo; - a language useroption for the 24 languages; - modifies lists what 1.0 reads and writes, including Jumpgate pathv2, doors, windows and the page grid offset. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
README: rewritten for 1.0 - installation, quick start, zooming pages (what moves, why distances stay true, factors, --keep-tokens and --pages), fitting a map to the grid, resizing the selection, undo, the commands and settings, the API for other Mods, and an upgrade table from 0.0.9 that explains the old `scale` direction bug. CHANGELOG: 1.0.0 (fixed, added, changed), and the earlier releases 0.0.6 to 0.0.9 from Robin Kuiper's 2018 commits. DEVELOPERS: layout, build, the module map, how a zoom treats each object kind, the calibration maths with the live-checked grid offset directions, the undo history, state and translations. MOD_FILE_MAP: where each feature lives. TESTING: the live results in the Jumpgate test game (Walls Lab zoom and exact undo, menu queries, calibration with and without a grid offset, the page picker batch, hex pages, the Command Deck and the 0.0.9 upgrade) and a checklist for later releases. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…old one back Straight after a Mod changes a page, the GM's Jumpgate client can save the page back with some of its old settings. In a live check 2 of 4 zooms kept the new width but got the old snapping increment back, so the page had twice the squares and every distance doubled. The new page guard remembers what Resizer set on a page for 10 seconds. A client change that undoes part of it while keeping Resizer's width and height is set right again; a change to the page size itself is taken as the GM's own and left alone. Zoom, calibrate, page resize and undo all go through it. Afterwards 6 zooms and 6 undos in a row kept the right cell size. The test stub gains clientSet, a change made in a browser, which Roll20 announces with a change event. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
CHANGELOG: a fixed entry for the cell size Jumpgate put back after a zoom. DEVELOPERS and MOD_FILE_MAP: the new pageguard module and why it exists. TESTING: the Playwright spec in playwright-tests (8 of 8 passed in the test game), what it needs, how to run it, and the page guard check. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The Help and Command Deck handouts now use the plain Resizer 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.0.0 snapshot are rebuilt without a version bump and remain identical. Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
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 Resizer 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.0.0 copy carry the new icon path. The version number is unchanged. 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-11-07)
A full rewrite by MidNiteShadow7 of Ada Lindberg's PageFX 1.3, which had not changed since 2017. Version 1 tokens keep working, and
!pageFX onand!pageFX offstill work.Fixed
radius × 70 / scale), so areas were wrong on pages with a different snapping increment.randomdirection never worked for saved beam-like custom FX.Added
create,preset,fx,interval,direction,area,name,delete, and no-effect areas withnull create.start,stop,pause,resume,setIntensity,fire,create,remove,getEffect,listEffects,isRunning,registerPreset,listPresetsandcheckToken, alongside version 1's functions.status,rescan(take over copied tokens and forget deleted ones) andjournal rebuild.Changed
!pagefx(!page-fxtoo).!pageFX onand!pageFX offnow resume and pause every effect.state.PageFX, keyed by the effect token's ID. Version 1 tokens are taken over on the first start; their GM Notes, bars and interdiction marker drive them until they are changed from chat.