forked from public/foundryvtt-reve-de-dragon
Sync
This commit is contained in:
@ -7,9 +7,10 @@ import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
||||
* Extend the base Dialog entity to select roll parameters
|
||||
* @extends {Dialog}
|
||||
*/
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDRoll extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async create(actor, rollData, dialogConfig, ...actions) {
|
||||
|
||||
RdDRoll._ensureCorrectActions(actions);
|
||||
@ -24,6 +25,7 @@ export class RdDRoll extends Dialog {
|
||||
return new RdDRoll(actor, rollData, html, options, actions);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static _setDefaultOptions(actor, rollData) {
|
||||
|
||||
mergeObject(rollData,
|
||||
@ -45,6 +47,7 @@ export class RdDRoll extends Dialog {
|
||||
{ overwrite: false });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static _ensureCorrectActions(actions) {
|
||||
if (actions.length == 0) {
|
||||
throw 'No action defined';
|
||||
@ -56,6 +59,7 @@ export class RdDRoll extends Dialog {
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(actor, rollData, html, options, actions) {
|
||||
let conf = {
|
||||
title: actions[0].label,
|
||||
@ -73,9 +77,9 @@ export class RdDRoll extends Dialog {
|
||||
this.rollData = rollData;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onAction(action, html) {
|
||||
await RdDResolutionTable.rollData(this.rollData);
|
||||
|
||||
console.log("RdDRoll -=>", this.rollData, this.rollData.rolled);
|
||||
|
||||
if (action.callbacks)
|
||||
|
Reference in New Issue
Block a user