Compare commits

...

2 commits

Author SHA1 Message Date
WBHarry
030fd857db Changed diceFaces->dieFaces for consistency 2026-04-16 09:56:43 +02:00
WBHarry
8495b4adcc . 2026-04-16 09:45:22 +02:00
2 changed files with 4 additions and 9 deletions

View file

@ -123,7 +123,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
context.advantage = this.config.roll?.advantage;
context.disadvantage = this.config.roll?.disadvantage;
context.diceOptions = CONFIG.DH.GENERAL.diceTypes;
context.diceFaces = CONFIG.DH.GENERAL.dieFaces.reduce((acc, face) => {
context.dieFaces = CONFIG.DH.GENERAL.dieFaces.reduce((acc, face) => {
acc[face] = `d${face}`;
return acc;
}, {});
@ -156,12 +156,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
}
if (this.config.uses) this.config.uses = foundry.utils.mergeObject(this.config.uses, rest.uses);
if (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;
});
this.roll = foundry.utils.mergeObject(this.roll, rest.roll.dice)
}
if (rest.hasOwnProperty('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>
{{/times}}
</select>
<select name="roll.dice.advantageFaces"{{#unless advantage}} disabled{{/unless}}>
{{selectOptions diceFaces selected=@root.roll.advantageFaces}}
<select name="roll.dice.advantageFaces"{{#unless advantage}} disabled{{/unless}} data-dtype="Number">
{{selectOptions dieFaces selected=@root.roll.advantageFaces}}
</select>
</div>
{{#if abilities}}