Skip to content

Gaslight 2.3.1 + 2.4.0 - #2330

Open
KenanMillet wants to merge 2 commits into
Roll20:masterfrom
KenanMillet:gaslight-2.4.0
Open

Gaslight 2.3.1 + 2.4.0#2330
KenanMillet wants to merge 2 commits into
Roll20:masterfrom
KenanMillet:gaslight-2.4.0

Conversation

@KenanMillet

Copy link
Copy Markdown
Contributor

Gaslight 2.3.1 + 2.4.0 — sandbox terminology + GL-SCRATCH pageFolder

Summary

Two versions in one PR:

  • 2.3.1 — documentation/terminology only: refer to the sandbox as the "Latest sandbox (Mod Script Sandbox v1.5)" instead of "experimental/Jumpgate", matching Roll20's current Mod Scripts settings. No behavior change.
  • 2.4.0 — scratch pages now live in a dedicated GL-SCRATCH pageFolder so they stay out of sight. Any page in the folder is treated as a scratch page, in-use copies are moved next to the master during quick and returned to the folder on merge, and the folder is auto-created/maintained. Latest-sandbox (v1.5+) only; v1.0 (Legacy) is unaffected.

Both versions ship with their own snapshot folder and previousversions entry, so each remains individually installable from the one-click version dropdown (2.4.0 is "Latest").

Depends on ScriptKit (unchanged from 2.3.0). Gaslight guards every ScriptKit call and degrades gracefully if it's absent, but ScriptKit is required for the intended help/guide experience.

What's new

2.3.1

Sandbox terminology — the quick gating error, help/guide text, code comments, and README now say "Latest sandbox (Mod Script Sandbox v1.5)" rather than "experimental/Jumpgate", matching what users actually see in the Mod Scripts settings dropdown ("Mod Script Sandbox v1.5 (Latest)"). Purely wording; no functional change.

2.4.0

GL-SCRATCH pageFolder (Latest sandbox v1.5+) — scratch pages now live in a dedicated GL-SCRATCH page folder. Any page in the folder is a scratch page (regardless of name), so setup is just "drop a few blank pages into the folder" — no naming required. Uses the v1.5 pageFolder object and the page placeIn/placeAfter/placeBefore methods. Gated on sandboxVersion >= 1.5 (numeric compare, so future 1.6/2.0 don't regress); every folder operation is additionally method-guarded and wrapped so a failure degrades to the prior behavior rather than breaking a split.

In-use copies sit next to the master — during quick, a scratch page taken into use is moved out of the folder to sit adjacent to the master page (via placeAfter(master) — lands at the master's folder level, root or otherwise). On merge, recycled scratch pages are wiped, renamed back to GL-SCRATCH, and returned to the folder for reuse.

Auto-maintenance — on startup the GL-SCRATCH folder is auto-created (if absent) and any loose pages named GL-SCRATCH are tucked into it. When a page is added to or dragged into the folder: an empty page is auto-named GL-SCRATCH; a non-empty page (a real map dropped in by mistake) is ejected back to where it came from (its origin folder, or root just before the GL-SCRATCH folder) with a heads-up whisper to the GM. "Empty" is defined by the same object set quick clones (graphic/path/pathv2/text/door/window/pin).

Open-page reminder — Roll20 only initializes a page's z-order the first time a GM views it, and there is no API way to seed it (a never-viewed page has _zorder === false and createObj throws on it). Gaslight now whispers a reminder to open newly-added scratch pages once, the getting-started guide says so up front, and the quick pre-flight error was rewritten to be clear (it no longer glues player names onto the shared GL-SCRATCH page name).

v1.0 (Legacy) unaffected — with no pageFolder API, all of the above is inert and Gaslight falls back to the existing flat, name-based GL-SCRATCH behavior.

Files changed

  • Gaslight/Gaslight.js — 2.3.1 terminology + 2.4.0 folder feature.
  • Gaslight/2.3.1/Gaslight.js, Gaslight/2.4.0/Gaslight.js — version snapshots (2.3.0 snapshot left frozen).
  • Gaslight/script.json — version 2.4.0, previousversions now includes 2.3.0 and 2.3.1, refreshed description/changelog/command list.
  • Gaslight/README.md — updated setup (folder workflow + open-once note), command table, and v2.3.1 / v2.4.0 changelog sections.

Testing

Tested in-game on the Latest sandbox (v1.5):

  • Startup migration: GL-SCRATCH folder auto-created; loose GL-SCRATCH-named pages moved into it.
  • Adding a blank page in the folder → auto-named GL-SCRATCH, with an open-once reminder when the page is uninitialized.
  • Dragging a non-empty page into the folder → ejected back to its origin folder (verified both the from-a-subfolder case and the from-root case) with a GM whisper; empty pages are kept and renamed.
  • !gaslight quick full cycle: blank pages in the folder → cloned onto, moved next to the master, split; !gaslight merge → wiped, renamed, and returned to the GL-SCRATCH folder for reuse.
  • quick pre-flight on never-viewed scratch pages → clear, non-misleading error telling the GM to open the folder's pages once (the raw Roll20 createObj crash on uninitialized pages was reproduced separately and reported to Roll20).
  • v1.0 fallback path unchanged (flat name-based behavior).
  • script.json validated against script.json.schema.

Notes

  • 2.4.0's folder behavior is entirely v1.5+; no change to on-page config, linking, or sync.
  • The never-viewed-page z-order limitation is a Roll20 sandbox constraint (no API to initialize it); Gaslight surfaces it clearly rather than working around it.

Reword 'experimental/Jumpgate sandbox' to 'Latest sandbox (Mod Script Sandbox v1.5)' across the error message, help/guide text, comments, and README to match Roll20's current Mod Scripts settings. No behavior change. Adds 2.3.1 snapshot, changelog entry, and regenerated script.json.
On the Latest sandbox (v1.5+), scratch pages live in an auto-created GL-SCRATCH pageFolder. Any page in the folder is a scratch page (drop blank pages in; no naming needed). In-use copies are moved next to the master during quick and returned to the folder on merge. Empty pages added to the folder are auto-named GL-SCRATCH; non-empty pages dropped in by mistake are ejected back to their origin with a GM notice. Startup migrates loose GL-SCRATCH-named pages into the folder. GMs are reminded to open new scratch pages once (Roll20 only initializes a page when first viewed). v1.0 (Legacy) is unaffected — flat name-based behavior. Clearer uninitialized-page error. Adds 2.4.0 snapshot, changelog, README, and regenerated script.json.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant