Merge pull request #273 from deltagreen-foundryvtt/tobifroe/272/skill-fail-rollback-fix

fix(#272): hook into renderChatMessageHTML for skill fail rollbacks
This commit is contained in:
ThingsCouldGetDicey
2025-12-07 16:57:33 +00:00
committed by GitHub
2 changed files with 12 additions and 1 deletions
+1
View File
@@ -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
+11 -1
View File
@@ -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);
});