mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 12:54:16 +02:00
Added triggerChatRollFx
This commit is contained in:
parent
17b9719c09
commit
6cb31ac3b7
13 changed files with 65 additions and 67 deletions
|
|
@ -864,3 +864,18 @@ export function camelize(str) {
|
|||
})
|
||||
.replace(/\s+/g, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers DiceSoNice rolls or dice roll audio for rolls. Not used for duality rolls.
|
||||
* @param { Roll[] } rolls
|
||||
* @return { void }
|
||||
*/
|
||||
export async function triggerChatRollFx(rolls, options = { whisper: false, blind: false }) {
|
||||
const { whisper, blind } = options;
|
||||
if (game.modules.get('dice-so-nice')?.active) {
|
||||
const rerollPromises = rolls.map(roll => game.dice3d.showForRoll(roll, game.user, true, whisper, blind));
|
||||
await Promise.allSettled(rerollPromises);
|
||||
} else {
|
||||
foundry.audio.AudioHelper.play({ src: CONFIG.sounds.dice });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue