Added support for reload rules

This commit is contained in:
WBHarry 2026-07-01 12:53:48 +02:00
parent 70388dbd73
commit 3817469e35
11 changed files with 99 additions and 3 deletions

View file

@ -152,6 +152,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
html.querySelectorAll('.risk-it-all-button').forEach(element =>
element.addEventListener('click', event => this.riskItAllClearStressAndHitPoints(event, data))
);
for (const element of html.querySelectorAll('.roll-reload-check')) {
element.addEventListener('click', event => this.onRollReloadCheck(event, message));
}
};
setupHooks() {
@ -297,4 +300,12 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
const actor = game.actors.get(event.target.dataset.actorId);
new game.system.api.applications.dialogs.RiskItAllDialog(actor, resourceValue).render({ force: true });
}
async onRollReloadCheck(_event, messageData) {
const message = game.messages.get(messageData._id);
const needReload = await message.system.action.handleReload?.({ awaitRoll: true });
await message.update({
'system.needReload': needReload
});
}
}