Skip to content

Commit

Permalink
release: 0.10.4 fix compatibility with little details
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosFdez committed Oct 4, 2022
1 parent fcf17a4 commit 56875ba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
20 changes: 15 additions & 5 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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"
}
20 changes: 11 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down

0 comments on commit 56875ba

Please sign in to comment.