From b2d8c2439a64261ee1cb0e1758fdbe273f8da419 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 17 Dec 2022 20:06:51 +0100 Subject: [PATCH] Fix: affichage des descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pour les feuilles dérivées de RdDItemSheet, il faut appeler super.getData() pour préparer les données à afficher dans le formulaire. --- module/item-rencontre-sheet.js | 9 +-------- module/item-signedraconique-sheet.js | 13 ++----------- templates/item-rencontre-sheet.html | 2 -- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/module/item-rencontre-sheet.js b/module/item-rencontre-sheet.js index e806222c..50a34834 100644 --- a/module/item-rencontre-sheet.js +++ b/module/item-rencontre-sheet.js @@ -23,15 +23,8 @@ export class RdDRencontreItemSheet extends RdDItemSheet { /* -------------------------------------------- */ async getData() { - const formData = duplicate(this.item); + const formData = await super.getData(); mergeObject(formData, { - title: formData.name, - isGM: game.user.isGM, - owner: this.actor?.isOwner, - isOwned: this.actor ? true : false, - actorId: this.actor?.id, - editable: this.isEditable, - cssClass: this.isEditable ? "editable" : "locked", effets: { succes: { liste: RdDRencontre.getEffetsSucces(), diff --git a/module/item-signedraconique-sheet.js b/module/item-signedraconique-sheet.js index 823d459c..119a446c 100644 --- a/module/item-signedraconique-sheet.js +++ b/module/item-signedraconique-sheet.js @@ -23,18 +23,9 @@ export class RdDSigneDraconiqueItemSheet extends RdDItemSheet { /* -------------------------------------------- */ async getData() { - const formData = duplicate(this.item); + const formData = await super.getData(); this.tmrs = TMRUtility.buildSelectionTypesTMR(this.item.system.typesTMR); - mergeObject(formData, { - tmrs: this.tmrs, - title: formData.name, - isGM: game.user.isGM, - owner: this.actor?.isOwner, - isOwned: this.actor ? true : false, - actorId: this.actor?.id, - editable: this.isEditable, - cssClass: this.isEditable ? "editable" : "locked", - }); + formData.tmrs = this.tmrs; return formData; } diff --git a/templates/item-rencontre-sheet.html b/templates/item-rencontre-sheet.html index e00336f5..edc87565 100644 --- a/templates/item-rencontre-sheet.html +++ b/templates/item-rencontre-sheet.html @@ -9,9 +9,7 @@ Fréquences {{/unless}} -
-
{{#if isOwned}}