mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19:54 +02:00
[Feature] Reload Check (#2051)
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
This commit is contained in:
parent
8d68166e4c
commit
26bcc2dddc
22 changed files with 223 additions and 14 deletions
|
|
@ -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() {
|
||||
|
|
@ -275,4 +278,10 @@ 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 needsReload = await message.system.action.handleReload?.({ awaitRoll: true });
|
||||
await message.update({ 'system.needsReload': needsReload });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue