[Feature] Roll Effect Toggles (#1510)

* Initial

* .

* .

* Update module/dice/dhRoll.mjs

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>

---------

Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
WBHarry 2026-01-13 01:15:00 +01:00 committed by GitHub
parent 883aaeec02
commit 27b7758f7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 266 additions and 39 deletions

View file

@ -199,6 +199,8 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
let config = this.prepareConfig(event);
if (!config) return;
await this.addEffects(config);
if (Hooks.call(`${CONFIG.DH.id}.preUseAction`, this, config) === false) return;
// Display configuration window if necessary
@ -265,6 +267,16 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
return config;
}
/** */
async addEffects(config) {
let effects = [];
if (this.actor) {
effects = Array.from(await this.actor.allApplicableEffects());
}
config.effects = effects;
}
/**
* Method used to know if a configuration dialog must be shown or not when there is no roll.
* @param {*} config Object that contains workflow datas. Usually made from Action Fields prepareConfig methods.