This commit is contained in:
Dapoolp 2025-07-06 02:40:32 +02:00
parent 450fe60db6
commit 0eb5a7276f
3 changed files with 13 additions and 2 deletions

View file

@ -264,3 +264,7 @@ Hooks.on('renderJournalDirectory', async (tab, html, _, options) => {
};
}
});
Hooks.on(`${CONFIG.DH.id}.postRollDuality`, async(roll, config, message) => {
console.log(roll, config, message)
});

View file

@ -19,7 +19,7 @@ export default class DHRoll extends Roll {
}
static async buildConfigure(config = {}, message = {}) {
config.hooks = [...(config.hooks ?? []), ''];
config.hooks = [...this.getHooks(), ''];
config.dialog ??= {};
for (const hook of config.hooks) {
if (Hooks.call(`${CONFIG.DH.id}.preRoll${hook.capitalize()}`, config, message) === false) return null;
@ -94,6 +94,10 @@ export default class DHRoll extends Roll {
config.dialog.configure ??= !(config.event.shiftKey || config.event.altKey || config.event.ctrlKey);
}
static getHooks(hooks) {
return hooks ?? [];
}
formatModifier(modifier) {
const numTerm = modifier < 0 ? '-' : '+';
return [

View file

@ -79,7 +79,10 @@ export default class DualityRoll extends D20Roll {
return game.i18n.localize(label);
}
updateFormula() {}
static getHooks(hooks) {
return [...(hooks ?? []), 'Duality'];
}
createBaseDice() {
if (