Migration à Foundry v11/v12 + changes requests

This commit is contained in:
2024-04-27 23:28:28 +02:00
parent 0b86c3b159
commit 1e0f982b90
30 changed files with 473 additions and 415 deletions

View File

@@ -43,27 +43,38 @@ export class VadentisItemSheet extends ItemSheet {
/* -------------------------------------------- */
async getData() {
const objectData = VadentisUtility.data(this.object);
let itemData = foundry.utils.deepClone(VadentisUtility.templateData(this.object));
let itemData = foundry.utils.deepClone(this.object.system);
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
type: this.object.type,
img: this.object.img,
name: this.object.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: itemData,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
isGM: game.user.isGM
isGM: game.user.isGM,
}
if (objectData.type == 'sort') {
if (itemData.description) {
formData.description = await TextEditor.enrichHTML(this.object.system.description, { async: true })
}
if (itemData.notes) {
formData.notes = await TextEditor.enrichHTML(this.object.system.notes, { async: true })
}
if (itemData.effect) {
formData.effect = await TextEditor.enrichHTML(this.object.system.effect, { async: true })
}
if (itemData.criticaleffect) {
formData.criticaleffect = await TextEditor.enrichHTML(this.object.system.criticaleffect, { async: true })
}
if (this.object.type == 'sort') {
formData.donnees = await VadentisUtility.getDonnees();
}
if (objectData.type == 'devotion') {
if (this.object.type == 'devotion') {
formData.eglises = await VadentisUtility.getEglises();
}