mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Fixed so that the reaction rolls from chat messages work with diceSoNice (#1465)
This commit is contained in:
parent
1b7893324a
commit
7e2b144bf4
1 changed files with 12 additions and 20 deletions
|
|
@ -124,29 +124,21 @@ export default class SaveField extends fields.SchemaField {
|
|||
*/
|
||||
static async updateSaveMessage(result, message, targetId) {
|
||||
if (!result) return;
|
||||
const updateMsg = async function (message, targetId, result) {
|
||||
// setTimeout(async () => {
|
||||
const chatMessage = ui.chat.collection.get(message._id),
|
||||
changes = {
|
||||
flags: {
|
||||
[game.system.id]: {
|
||||
reactionRolls: {
|
||||
[targetId]: {
|
||||
result: result.roll.total,
|
||||
success: result.roll.success
|
||||
}
|
||||
|
||||
const chatMessage = ui.chat.collection.get(message._id),
|
||||
changes = {
|
||||
flags: {
|
||||
[game.system.id]: {
|
||||
reactionRolls: {
|
||||
[targetId]: {
|
||||
result: result.roll.total,
|
||||
success: result.roll.success
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
await chatMessage.update(changes);
|
||||
// }, 100);
|
||||
};
|
||||
if (game.modules.get('dice-so-nice')?.active)
|
||||
game.dice3d
|
||||
.waitFor3DAnimationByMessageID(result.message.id ?? result.message._id)
|
||||
.then(async () => await updateMsg(message, targetId, result));
|
||||
else await updateMsg(message, targetId, result);
|
||||
}
|
||||
};
|
||||
await chatMessage.update(changes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue