Some corrections and adds to Consumables and Loot compendia (#492)

This commit is contained in:
WBHarry 2025-08-01 01:25:28 +02:00 committed by GitHub
parent 3e333d3533
commit 6ca24b3db7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 2142 additions and 540 deletions

View file

@ -7,7 +7,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
this.roll = roll;
this.config = config;
this.config.experiences = [];
this.reactionOverride = config.roll.type === 'reaction';
this.reactionOverride = config.roll?.type === 'reaction';
if (config.source?.action) {
this.item = config.data.parent.items.get(config.source.item) ?? config.data.parent;
@ -149,16 +149,16 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
static toggleReaction() {
if (this.config.roll) {
this.reactionOverride = !this.reactionOverride;
this.config.roll.type = this.reactionOverride
? CONFIG.DH.ITEM.actionTypes.reaction.id
: this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id
? null
: this.config.roll.type;
this.render();
}
}
static async submitRoll() {
this.config.roll.type = this.reactionOverride
? CONFIG.DH.ITEM.actionTypes.reaction.id
: this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id
? null
: this.config.roll.type;
await this.close({ submitted: true });
}