diff --git a/module.json b/module.json index bab3f34..c4c056c 100644 --- a/module.json +++ b/module.json @@ -2,14 +2,24 @@ "id": "pf2e-persistent-damage", "title": "pf2e Persistent Damage", "description": "Macros that create effects to handle persistent damage", - "author": "Supe", - "version": "0.10.3", + "authors": [ + { + "name": "Supe" + } + ], + "version": "0.10.4", "compatibility": { "minimum": "10", - "verified": "10.285" + "verified": "10.286" }, "type": "module", - "system": ["pf2e"], + "relationships": { + "systems": [ + { + "id": "pf2e" + } + ] + }, "esmodules": ["./index.js"], "styles": ["./styles/styles.css"], "languages": [ @@ -39,5 +49,5 @@ ], "url": "https://github.com/CarlosFdez/pf2e-persistent-damage", "manifest": "https://github.com/CarlosFdez/pf2e-persistent-damage/releases/latest/download/module.json", - "download": "https://github.com/CarlosFdez/pf2e-persistent-damage/releases/download/v0.10.3/module.zip" + "download": "https://github.com/CarlosFdez/pf2e-persistent-damage/releases/download/v0.10.4/module.zip" } diff --git a/src/index.ts b/src/index.ts index 715be2c..3120f05 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,22 +60,24 @@ Hooks.on("pf2e.endTurn", (combatant: CombatantPF2e, _combat, userId: string) => */ Hooks.on("renderTokenHUD", (_app, $html: JQuery, tokenData: foundry.data.TokenData) => { setTimeout(() => { - $html - .find("div.status-effects [data-status-id='persistent-damage'] img") - .off() - .on("click", (evt) => { - if (evt.button !== 0 || !canvas.ready) { + const persistentEffect = $html.find("div.status-effects [data-status-id='persistent-damage']").get(0); + persistentEffect.addEventListener( + "click", + (event) => { + event.preventDefault(); + event.stopImmediatePropagation(); + + if (event.button !== 0 || !canvas.ready) { return; } - evt.preventDefault(); - evt.stopPropagation(); - const token = canvas.tokens.get(tokenData._id); if (token) { PF2EPersistentDamage.showDialog({ actor: token.actor }); } - }); + }, + { capture: true }, + ); }, 0); });