Foundry v13 migration

This commit is contained in:
2025-05-01 08:48:02 +02:00
parent 342f9c2342
commit d647fcc35e
40 changed files with 249 additions and 212 deletions

View File

@@ -6,7 +6,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
static async create(actor, tirageData) {
let options = { classes: ["MaleficesDialog"], width: 720, height: 740, 'z-index': 99999 };
let html = await renderTemplate('systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs', tirageData);
let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs', tirageData);
return new MaleficesTirageTarotDialog(actor, tirageData, html, options);
}
@@ -36,7 +36,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
async sendCardRequest() {
this.tirageData.state = 'waiting-user-card'
let msg = await MaleficesUtility.createChatMessage(this.tirageData.user.name, "useronly", {
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/request-tarot-card.hbs`, this.tirageData)
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/request-tarot-card.hbs`, this.tirageData)
})
//msg.setFlag("world", "tirage-data", this.tirageData)
console.log("MSG IS", msg)
@@ -50,7 +50,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
if ( selectedCard.system.isdualside) { // Cas des cartes pouvant avoir 2 sens
selectedCard.system.ispositif = (Math.random() > 0.5)
}
console.log("CARD SELECTED:", selectedCard)
console.log("CARD SELECTED:", selectedCard)
// Cas spécial de la Roue de la Fortune
if ( selectedCard.name.toLowerCase().includes("fortune")) {
this.tirageData.maxPlayerCard += 1
@@ -63,7 +63,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
}
}
this.tirageData.deck = newList
return selectedCard
}
@@ -74,9 +74,9 @@ export class MaleficesTirageTarotDialog extends Dialog {
let selectedCard = this.drawCard()
selectedCard.system.isgm = false
await MaleficesUtility.createChatMessage(this.tirageData.user.name, "gmroll", {
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
})
if (this.tirageData.cards[0].name == "???") {
if (this.tirageData.cards[0].name == "???") {
this.tirageData.cards.shift()
}
this.tirageData.cards.push(selectedCard)
@@ -87,9 +87,9 @@ export class MaleficesTirageTarotDialog extends Dialog {
let selectedCard = this.drawCard()
selectedCard.system.isgm = true
await MaleficesUtility.createChatMessage(this.tirageData.user.name, "blindroll", {
content: await renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-malefices/templates/chat/display-tarot-card.hbs`, selectedCard)
})
if (this.tirageData.secretCards[0].name == "???") {
if (this.tirageData.secretCards[0].name == "???") {
this.tirageData.secretCards.shift()
}
this.tirageData.secretCards.push(selectedCard)
@@ -124,7 +124,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
}
/* -------------------------------------------- */
async refreshDialog() {
const content = await renderTemplate("systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs", this.tirageData)
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-malefices/templates/dialogs/tirage-tarot-dialog.hbs", this.tirageData)
this.data.content = content
this.render(true)
}
@@ -133,7 +133,7 @@ export class MaleficesTirageTarotDialog extends Dialog {
activateListeners(html) {
super.activateListeners(html);
var dialog = this;
let dialog = this;
function onLoad() {
}
$(function () { onLoad(); });
@@ -150,6 +150,6 @@ export class MaleficesTirageTarotDialog extends Dialog {
dialog.attributeToActor(actorId)
}
})
}
}