Merged with action branch

This commit is contained in:
WBHarry 2025-06-24 23:30:37 +02:00
commit 90e7000b9c
19 changed files with 280 additions and 496 deletions

View file

@ -8,8 +8,11 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
this.config.experiences = [];
if (config.source?.action) {
this.item = config.actor.parent.items.get(config.source.item);
this.action = this.item.system.actions.find(a => a._id === config.source.action);
this.item = config.data.parent.items.get(config.source.item);
this.action =
config.data.attack?._id == config.source.action
? config.data.attack
: this.item.system.actions.find(a => a._id === config.source.action);
}
}
@ -47,9 +50,9 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
async _prepareContext(_options) {
const context = await super._prepareContext(_options);
context.experiences = Object.keys(this.config.actor.experiences).map(id => ({
context.experiences = Object.keys(this.config.data.experiences).map(id => ({
id,
...this.config.actor.experiences[id]
...this.config.data.experiences[id]
}));
context.selectedExperiences = this.config.experiences;
context.advantage = this.config.advantage;