fvtt-imperium5/modules/imperium5-roll-dialog.js

54 lines
1.4 KiB
JavaScript

import { Imperium5Utility } from "./imperium5-utility.js";
export class Imperium5RollDialog extends Dialog {
/* -------------------------------------------- */
static async create(actor, rollData ) {
let options = { classes: ["Imperium5Dialog"], width: 620, height: 380, 'z-index': 99999 }
let html = await renderTemplate('systems/fvtt-imperium5/templates/roll-dialog-generic.html', rollData)
return new Imperium5RollDialog(actor, rollData, html, options )
}
/* -------------------------------------------- */
constructor(actor, rollData, html, options, close = undefined) {
let conf = {
title:"Jet",
content: html,
buttons: {
roll: {
icon: '<i class="fas fa-check"></i>',
label: "Roll !",
callback: () => { this.roll() }
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Cancel",
callback: () => { this.close() }
} },
close: close
}
super(conf, options);
this.actor = actor;
this.rollData = rollData;
}
/* -------------------------------------------- */
roll () {
Imperium5Utility.rollImperium5( this.rollData )
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html)
var dialog = this
function onLoad() {
}
$(function () { onLoad(); })
}
}