This commit is contained in:
WBHarry 2026-05-23 23:55:46 +02:00
parent e4a3f105dc
commit cb2116ffef
4 changed files with 77 additions and 21 deletions

View file

@ -103,6 +103,20 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
_getEntryContextOptions() {
return [
...super._getEntryContextOptions(),
{
label: 'DAGGERHEART.UI.ChatLog.rerollActionRoll',
icon: '<i class="fa-solid fa-dice"></i>',
visible: li => {
const message = game.messages.get(li.dataset.messageId);
return game.user.isGM || message.isAuthor;
},
callback: async li => {
const message = game.messages.get(li.dataset.messageId);
const reroll = await message.rolls[0].reroll({ liveRoll: true });
message.update({ rolls: [reroll] });
}
},
{
label: 'DAGGERHEART.UI.ChatLog.rerollDamage',
icon: '<i class="fa-solid fa-dice"></i>',
@ -113,9 +127,11 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
: false;
return (game.user.isGM || message.isAuthor) && hasRolledDamage;
},
callback: li => {
callback: async li => {
const message = game.messages.get(li.dataset.messageId);
new game.system.api.applications.dialogs.RerollDamageDialog(message).render({ force: true });
const reroll = await message.rolls[0].reroll();
message.update({ rolls: [reroll] });
// new game.system.api.applications.dialogs.RerollDamageDialog(message).render({ force: true });
}
}
];