Foundry v13 migration
This commit is contained in:
@@ -7,10 +7,10 @@ export class MaleficesRollDialog extends Dialog {
|
||||
|
||||
let options = { classes: ["MaleficesDialog"], width: 540, height: 'fit-content', 'z-index': 99999 }
|
||||
let html
|
||||
if (rollData.attr && rollData.attr.iscard) {
|
||||
html = await renderTemplate('systems/fvtt-malefices/templates/dialogs/confrontation-dialog.hbs', rollData);
|
||||
if (rollData?.attr?.iscard) {
|
||||
html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-malefices/templates/dialogs/confrontation-dialog.hbs', rollData);
|
||||
} else {
|
||||
html = await renderTemplate('systems/fvtt-malefices/templates/dialogs/roll-dialog-generic.hbs', rollData);
|
||||
html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-malefices/templates/dialogs/roll-dialog-generic.hbs', rollData);
|
||||
}
|
||||
|
||||
return new MaleficesRollDialog(actor, rollData, html, options);
|
||||
@@ -18,7 +18,7 @@ export class MaleficesRollDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(actor, rollData, html, options, close = undefined) {
|
||||
let isCard = rollData.attr && rollData.attr.iscard
|
||||
let isCard = rollData?.attr?.iscard
|
||||
let conf = {
|
||||
title: (isCard) ? "Jet" : "Tirage",
|
||||
content: html,
|
||||
@@ -45,7 +45,7 @@ export class MaleficesRollDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
roll() {
|
||||
let isCard = this.rollData.attr && this.rollData.attr.iscard
|
||||
let isCard = this.rollData?.attr?.iscard
|
||||
if (isCard) {
|
||||
MaleficesUtility.tirageConfrontationMalefices(this.rollData)
|
||||
} else {
|
||||
@@ -64,7 +64,6 @@ export class MaleficesRollDialog extends Dialog {
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
var dialog = this;
|
||||
function onLoad() {
|
||||
}
|
||||
$(function () { onLoad(); });
|
||||
@@ -87,6 +86,6 @@ export class MaleficesRollDialog extends Dialog {
|
||||
html.find('#confrontationModif').change((event) => {
|
||||
this.rollData.confrontationModif = Number(event.currentTarget.value)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user