Update the privacy handling for the rows to be more dynamic and support more than just private or public rolls
This commit is contained in:
parent
f66510c811
commit
6dbc0a817f
9 changed files with 103 additions and 57 deletions
|
|
@ -9,13 +9,13 @@ Hooks.on(`preCreateChatMessage`, (_message, context, options, author) => {
|
|||
/** An object of dice denomination to rows to add */
|
||||
const rows = {};
|
||||
|
||||
const mode = determinePrivacyFromRollMode(options.rollMode);
|
||||
const privacy = determinePrivacyFromRollMode(options.rollMode);
|
||||
for (const roll of context.rolls) {
|
||||
for (const die of roll.dice) {
|
||||
const size = die.denomination;
|
||||
rows[size] ??= [];
|
||||
for (const result of die.results) {
|
||||
rows[size].push({ mode, value: result.result });
|
||||
rows[size].push({ privacy, value: result.result });
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue