This commit is contained in:
Dapoolp 2025-07-31 15:24:35 +02:00
parent faa32c1fba
commit 56e11943b7
9 changed files with 72 additions and 79 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 });
}