Compare commits

..

No commits in common. "030fd857db9d2e605666d366211cd26fa27ef46e" and "6c8246294c51ae19bf5db51ca91335e0fe24c286" have entirely different histories.

2 changed files with 9 additions and 4 deletions

View file

@ -123,7 +123,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
context.advantage = this.config.roll?.advantage; context.advantage = this.config.roll?.advantage;
context.disadvantage = this.config.roll?.disadvantage; context.disadvantage = this.config.roll?.disadvantage;
context.diceOptions = CONFIG.DH.GENERAL.diceTypes; context.diceOptions = CONFIG.DH.GENERAL.diceTypes;
context.dieFaces = CONFIG.DH.GENERAL.dieFaces.reduce((acc, face) => { context.diceFaces = CONFIG.DH.GENERAL.dieFaces.reduce((acc, face) => {
acc[face] = `d${face}`; acc[face] = `d${face}`;
return acc; return acc;
}, {}); }, {});
@ -156,7 +156,12 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
} }
if (this.config.uses) this.config.uses = foundry.utils.mergeObject(this.config.uses, rest.uses); if (this.config.uses) this.config.uses = foundry.utils.mergeObject(this.config.uses, rest.uses);
if (rest.roll?.dice) { if (rest.roll?.dice) {
this.roll = foundry.utils.mergeObject(this.roll, rest.roll.dice) Object.entries(rest.roll.dice).forEach(([key, value]) => {
if(key === 'advantageFaces')
this.roll[key] = Number.parseInt(value);
else
this.roll[key] = value;
});
} }
if (rest.hasOwnProperty('trait')) { if (rest.hasOwnProperty('trait')) {
this.config.roll.trait = rest.trait; this.config.roll.trait = rest.trait;

View file

@ -157,8 +157,8 @@
<option value="{{add this 1}}" {{#if (eq @root.roll.advantageNumber (add this 1))}} selected{{/if}}>{{add this 1}}</option> <option value="{{add this 1}}" {{#if (eq @root.roll.advantageNumber (add this 1))}} selected{{/if}}>{{add this 1}}</option>
{{/times}} {{/times}}
</select> </select>
<select name="roll.dice.advantageFaces"{{#unless advantage}} disabled{{/unless}} data-dtype="Number"> <select name="roll.dice.advantageFaces"{{#unless advantage}} disabled{{/unless}}>
{{selectOptions dieFaces selected=@root.roll.advantageFaces}} {{selectOptions diceFaces selected=@root.roll.advantageFaces}}
</select> </select>
</div> </div>
{{#if abilities}} {{#if abilities}}