diff --git a/module/actor/base-actor-sheet.js b/module/actor/base-actor-sheet.js index 389bbf54..b63c8350 100644 --- a/module/actor/base-actor-sheet.js +++ b/module/actor/base-actor-sheet.js @@ -54,7 +54,7 @@ export class RdDBaseActorSheet extends ActorSheet { notesmj: await TextEditor.enrichHTML(this.actor.system.notesmj, { async: true }), options: options, } - this.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); + RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); formData.calc = { fortune: this.toSolsDeniers(this.actor.getFortune()), prixTotalEquipement: this.actor.computePrixTotalEquipement(), @@ -76,7 +76,7 @@ export class RdDBaseActorSheet extends ActorSheet { } /* -------------------------------------------- */ - filterItemsPerTypeForSheet(formData, itemTypes) { + static filterItemsPerTypeForSheet(formData, itemTypes) { formData.recettescuisine = Misc.arrayOrEmpty(itemTypes['recettecuisine']); formData.recettesAlchimiques = Misc.arrayOrEmpty(itemTypes['recettealchimique']); formData.maladies = Misc.arrayOrEmpty(itemTypes['maladie']); diff --git a/module/item-conteneur-sheet.js b/module/item-conteneur-sheet.js index e545cadf..744ba751 100644 --- a/module/item-conteneur-sheet.js +++ b/module/item-conteneur-sheet.js @@ -1,3 +1,4 @@ +import { RdDBaseActorSheet } from "./actor/base-actor-sheet.js"; import { RdDItemSheet } from "./item-sheet.js"; import { RdDSheetUtility } from "./rdd-sheet-utility.js"; import { RdDUtility } from "./rdd-utility.js"; @@ -27,7 +28,7 @@ export class RdDConteneurItemSheet extends RdDItemSheet { /* -------------------------------------------- */ prepareConteneurData(formData) { - RdDUtility.filterEquipementParType(formData, this.actor.itemTypes); + RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets); formData.subItems = formData.conteneurs.find(it => it._id == this.item.id)?.subItems;