Preparation callbacks pour nouveaux Rolls

This commit is contained in:
2025-01-26 21:29:01 +01:00
parent acfab362a0
commit 7ed9a4a12b
9 changed files with 178 additions and 112 deletions

View File

@ -259,7 +259,7 @@ export class RdDRoll extends Dialog {
this.updateRollResult(html);
});
}
/* -------------------------------------------- */
close() {
if (this.rollData.canClose) {
@ -269,15 +269,12 @@ export class RdDRoll extends Dialog {
}
async onAction(action) {
this.rollData.forceDiceResult = Number.parseInt(this.html.find("[name='force-dice-result']").val()) ?? -1;
await RdDResolutionTable.rollData(this.rollData);
console.log("RdDRoll -=>", this.rollData, this.rollData.rolled);
if (action.callbacks)
for (let callback of action.callbacks) {
if (callback.condition == undefined || callback.condition(this.rollData)) {
await callback.action(this.rollData);
}
}
this.rollData.forceDiceResult = Number.parseInt(this.html.find("[name='force-dice-result']").val()) ?? -1
await RdDResolutionTable.rollData(this.rollData)
for (let callback of action.callbacks) {
await callback.action(this.rollData)
}
}
async setSelectedSort(sort) {