2022-03-13 16:17:04 +01:00
|
|
|
import { Imperium5Utility } from "./imperium5-utility.js";
|
|
|
|
|
2022-03-19 09:30:00 +01:00
|
|
|
export class Imperium5RollDialog extends Dialog {
|
2022-03-13 16:17:04 +01:00
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
static async create(actor, rollData ) {
|
|
|
|
|
2022-03-19 09:30:00 +01:00
|
|
|
let options = { classes: ["Imperium5Dialog"], width: 620, height: 380, 'z-index': 99999 }
|
|
|
|
let html = await renderTemplate('systems/fvtt-imperium5/templates/roll-dialog-generic.html', rollData)
|
2022-03-13 16:17:04 +01:00
|
|
|
|
2022-03-19 09:30:00 +01:00
|
|
|
return new Imperium5RollDialog(actor, rollData, html, options )
|
2022-03-13 16:17:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
constructor(actor, rollData, html, options, close = undefined) {
|
|
|
|
let conf = {
|
2022-03-19 09:30:00 +01:00
|
|
|
title:"Jet",
|
2022-03-13 16:17:04 +01:00
|
|
|
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 () {
|
2022-03-19 09:30:00 +01:00
|
|
|
Imperium5Utility.rollImperium5( this.rollData )
|
2022-03-13 16:17:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
activateListeners(html) {
|
2022-03-19 09:30:00 +01:00
|
|
|
super.activateListeners(html)
|
2022-03-13 16:17:04 +01:00
|
|
|
|
2022-03-19 09:30:00 +01:00
|
|
|
var dialog = this
|
2022-03-13 16:17:04 +01:00
|
|
|
function onLoad() {
|
|
|
|
}
|
2022-03-19 09:30:00 +01:00
|
|
|
$(function () { onLoad(); })
|
2022-03-13 16:17:04 +01:00
|
|
|
}
|
|
|
|
}
|