Foundry v13 migration

This commit is contained in:
2025-05-01 23:23:29 +02:00
parent 0ef689bf1b
commit 965fc02eb3
58 changed files with 192 additions and 172 deletions

View File

@ -12,7 +12,7 @@ export class EcrymeConfrontDialog extends Dialog {
width: 620, height: 'fit-content', 'z-index': 99999
});
let html = await renderTemplate('systems/fvtt-ecryme/templates/dialogs/confront-dialog.hbs', rollData);
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-ecryme/templates/dialogs/confront-dialog.hbs', rollData);
return new EcrymeConfrontDialog(actor, rollData, html, options);
}
@ -72,7 +72,7 @@ export class EcrymeConfrontDialog extends Dialog {
$("#confront-dice-pool").html(content)
content = await renderTemplate("systems/fvtt-ecryme/templates/dialogs/partial-confront-bonus-area.hbs", this.rollData )
$("#confront-bonus-pool").html(content)
}
/* -------------------------------------------- */
async refreshDialog() {
@ -83,7 +83,7 @@ export class EcrymeConfrontDialog extends Dialog {
let button = this.buttonDisabled
setTimeout(function () { $(".launchConfront").attr("disabled", button) }, 180)
}
/* ------------------ -------------------------- */
_canDragStart(selector) {
console.log("CAN DRAG START", selector, super._canDragStart(selector) )
@ -124,23 +124,23 @@ export class EcrymeConfrontDialog extends Dialog {
if ( data.dragType == "dice") {
let idx = Number(data.diceIndex)
console.log("DATA", data, event, event.srcElement.className)
if (event.srcElement.className.includes("execution") &&
if (event.srcElement.className.includes("execution") &&
this.rollData.availableDices.filter(d => d.location == "execution").length < 2) {
this.rollData.availableDices[idx].location = "execution"
}
if (event.srcElement.className.includes("preservation") &&
if (event.srcElement.className.includes("preservation") &&
this.rollData.availableDices.filter(d => d.location == "preservation").length < 2) {
this.rollData.availableDices[idx].location = "preservation"
}
if (event.srcElement.className.includes("dice-list")) {
this.rollData.availableDices[idx].location = "mainpool"
}
if (this.rollData.availableDices.filter(d => d.location == "execution").length == 2 && this.rollData.availableDices.filter(d => d.location == "preservation").length == 2) {
this.buttonDisabled = false
} else {
this.buttonDisabled = true
}
}
} else {
let idx = Number(data.bonusIndex)
if (event.srcElement.className.includes("execution")) {
@ -192,7 +192,7 @@ export class EcrymeConfrontDialog extends Dialog {
this.processTranscendence()
if (rollData.selectedSpecs && rollData.selectedSpecs.length > 0) {
rollData.spec = foundry.utils.duplicate(actor.getSpecialization(rollData.selectedSpecs[0]))
rollData.spec = foundry.utils.duplicate(actor.getSpecialization(rollData.selectedSpecs[0]))
rollData.specApplied = true
rollData.executionTotal += 2
rollData.preservationTotal += 2

View File

@ -7,7 +7,7 @@ export class EcrymeConfrontStartDialog extends Dialog {
static async create(actor, rollData) {
let options = { classes: ["fvtt-ecryme ecryme-confront-dialog"], width: 540, height: 'fit-content', 'z-index': 99999 }
let html = await renderTemplate('systems/fvtt-ecryme/templates/dialogs/confront-start-dialog.hbs', rollData);
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-ecryme/templates/dialogs/confront-start-dialog.hbs', rollData);
return new EcrymeConfrontStartDialog(actor, rollData, html, options);
}

View File

@ -6,7 +6,7 @@ export class EcrymeRollDialog extends Dialog {
static async create(actor, rollData) {
let options = { classes: ["ecryme-roll-dialog"], width: 540, height: 'fit-content', 'z-index': 99999 }
let html = await renderTemplate('systems/fvtt-ecryme/templates/dialogs/roll-dialog-generic.hbs', rollData);
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-ecryme/templates/dialogs/roll-dialog-generic.hbs', rollData);
return new EcrymeRollDialog(actor, rollData, html, options);
}
@ -52,7 +52,6 @@ export class EcrymeRollDialog extends Dialog {
activateListeners(html) {
super.activateListeners(html);
var dialog = this;
function onLoad() {
}
$(function () { onLoad(); });
@ -75,13 +74,13 @@ export class EcrymeRollDialog extends Dialog {
})
html.find('#roll-select-transcendence').change((event) => {
this.rollData.skillTranscendence = Number($('#roll-select-transcendence').val())
})
})
html.find('#roll-use-spleen').change((event) => {
this.rollData.useSpleen = event.currentTarget.checked
})
})
html.find('#roll-use-ideal').change((event) => {
this.rollData.useIdeal = event.currentTarget.checked
})
})
}
}