diff --git a/modules/DicePool.js b/modules/DicePool.js index 0b219ef..a527d67 100644 --- a/modules/DicePool.js +++ b/modules/DicePool.js @@ -121,7 +121,7 @@ export default class DicePool async roll() { const roll = WFRP3eRoll.create( - this.renderDiceExpression(), + this.formula, this.checkData?.actor ? this.checkData.actor.getRollData() : {}, {checkData: this.checkData, flavor: this.flavor, startingSymbols: this.symbols} ); diff --git a/modules/WFRP3eRoll.js b/modules/WFRP3eRoll.js index 4ebcca0..5b0f088 100644 --- a/modules/WFRP3eRoll.js +++ b/modules/WFRP3eRoll.js @@ -200,6 +200,7 @@ export default class WFRP3eRoll extends Roll if(!Number.isNumeric(total)) { throw new Error(game.i18n.format("DICE.ErrorNonNumeric", {formula: this.formula})); } + return total; } diff --git a/modules/applications/DicePoolBuilder.js b/modules/applications/DicePoolBuilder.js index 814de9a..b542b8c 100644 --- a/modules/applications/DicePoolBuilder.js +++ b/modules/applications/DicePoolBuilder.js @@ -145,7 +145,7 @@ export default class DicePoolBuilder extends FormApplication { // if sound was not passed search for sound dropdown value if(!this.sound) { - const sound = html.find(".sound-selection")?.[0]?.value; + const sound = this.element.find(".sound-selection")?.[0]?.value; if(sound) { this.sound = sound; @@ -174,13 +174,13 @@ export default class DicePoolBuilder extends FormApplication } if(!this.flavor) { - const flavor = html.find(".flavor-text")?.[0]?.value; + const flavor = this.element.find(".flavor-text")?.[0]?.value; if(flavor) this.flavor = flavor; } - const sentToPlayer = html.find(".user-selection")?.[0]?.value; + const sentToPlayer = this.element.find(".user-selection")?.[0]?.value; if(sentToPlayer) { let container = $(`
`)[0]; @@ -188,7 +188,7 @@ export default class DicePoolBuilder extends FormApplication const messageText = `
${game.i18n.localize("WFRP3e.SentDicePoolRollHint")}
- ${$(container).html()} + ${$(container).this.element()}
`;