diff --git a/CHANGELOG.md b/CHANGELOG.md index d4416e7..d92653d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - [#281](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/281) - Add tooltips to adaptation area. - [#298](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/298) - Don't add art skill in actor creation. - [#301](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/301) - SAN doesn't zero out when player updates sheet and the sanity is private. +- [#272](https://github.com/deltagreen-foundryvtt/delta-green-foundry-vtt-system/issues/272) - Fixed auto-marked skill failure rollbacks in chat bubbles. ## Version 1.6.1 - 2025-09-09 diff --git a/module/deltagreen.js b/module/deltagreen.js index 972c68a..f413d0b 100644 --- a/module/deltagreen.js +++ b/module/deltagreen.js @@ -190,7 +190,7 @@ Hooks.on("renderGamePause", function (_, html, options) { } }); -Hooks.on("renderChatLog", async (app, element, context, options) => { +function addEventListenerToChatMessage(element) { element.addEventListener("click", (event) => { const btnWithAction = event.target.closest("button[data-action]"); const message = event.target.closest("li[data-message-id]"); @@ -200,4 +200,14 @@ Hooks.on("renderChatLog", async (app, element, context, options) => { handleInlineActions(btnWithAction, messageId); } }); +} + +Hooks.on("renderChatLog", async (app, element) => { + addEventListenerToChatMessage(element); +}); + +Hooks.on("renderChatMessageHTML", async (app, element, context) => { + // ignore non chat card notifications + if (!context.canClose) return; + addEventListenerToChatMessage(element); });