From a89b017a99bb54b567c2021b1786bb2f2fb19783 Mon Sep 17 00:00:00 2001 From: Tim Evans Date: Wed, 10 Jun 2026 18:48:30 +0100 Subject: [PATCH] v1.7.1: Fix 5 GM tool classes scoped to module level (were accidentally injected inside SLAGMStatusWindow.close() body) --- zero-engine.mjs | 63 +++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/zero-engine.mjs b/zero-engine.mjs index deeab84..0f77b9f 100644 --- a/zero-engine.mjs +++ b/zero-engine.mjs @@ -7058,6 +7058,38 @@ class SLAGMStatusWindow extends Application { this._hooks = []; SLAGMStatusWindow._inst = null; + return super.close(options); + } + + activateListeners(html) { + super.activateListeners(html); + // Open sheet on portrait or name click + html[0].querySelectorAll('.gsw-portrait, .gsw-actor-name').forEach(el => { + el.addEventListener('click', () => { + game.actors.get(el.dataset.actorId)?.sheet?.render(true); + }); + }); + // Remove condition + html[0].querySelectorAll('.gsw-remove-cond').forEach(btn => { + btn.addEventListener('click', async (ev) => { + ev.stopPropagation(); + const actor = game.actors.get(btn.dataset.actorId); + if (!actor) return; + const condId = btn.dataset.condId; + // Remove matching active effects + const toDelete = actor.effects.filter(e => + e.statuses?.has(condId) || e.flags?.core?.statusId === condId + ).map(e => e.id); + if (toDelete.length) await actor.deleteEmbeddedDocuments('ActiveEffect', toDelete); + else await actor.toggleStatusEffect(condId, { active: false }); + }); + }); + // Post to chat + html[0].querySelector('.gsw-post-chat')?.addEventListener('click', () => _broadcastPCConditions()); + } +} +SLAGMStatusWindow._inst = null; + // ── 💳 CREDIT DISTRIBUTION ──────────────────────────────────────────────────────────── class SLACreditDistributionTool extends Application { constructor(...args) { @@ -8647,37 +8679,6 @@ class SLAConditionApplicator extends Application { } SLAConditionApplicator._inst = null; - return super.close(options); - } - - activateListeners(html) { - super.activateListeners(html); - // Open sheet on portrait or name click - html[0].querySelectorAll('.gsw-portrait, .gsw-actor-name').forEach(el => { - el.addEventListener('click', () => { - game.actors.get(el.dataset.actorId)?.sheet?.render(true); - }); - }); - // Remove condition - html[0].querySelectorAll('.gsw-remove-cond').forEach(btn => { - btn.addEventListener('click', async (ev) => { - ev.stopPropagation(); - const actor = game.actors.get(btn.dataset.actorId); - if (!actor) return; - const condId = btn.dataset.condId; - // Remove matching active effects - const toDelete = actor.effects.filter(e => - e.statuses?.has(condId) || e.flags?.core?.statusId === condId - ).map(e => e.id); - if (toDelete.length) await actor.deleteEmbeddedDocuments('ActiveEffect', toDelete); - else await actor.toggleStatusEffect(condId, { active: false }); - }); - }); - // Post to chat - html[0].querySelector('.gsw-post-chat')?.addEventListener('click', () => _broadcastPCConditions()); - } -} -SLAGMStatusWindow._inst = null; // ── ACTOR DIRECTORY BUTTONS ────────────────────────────────────────────────── Hooks.on('renderActorDirectory', (app, html) => {