Fix ouverture de conteneurs

This commit is contained in:
Vincent Vandemeulebrouck 2023-01-13 01:51:26 +01:00
parent 969e5f6b2d
commit 0c36cf3c47
2 changed files with 4 additions and 3 deletions

View File

@ -54,7 +54,7 @@ export class RdDBaseActorSheet extends ActorSheet {
notesmj: await TextEditor.enrichHTML(this.actor.system.notesmj, { async: true }), notesmj: await TextEditor.enrichHTML(this.actor.system.notesmj, { async: true }),
options: options, options: options,
} }
this.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
formData.calc = { formData.calc = {
fortune: this.toSolsDeniers(this.actor.getFortune()), fortune: this.toSolsDeniers(this.actor.getFortune()),
prixTotalEquipement: this.actor.computePrixTotalEquipement(), 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.recettescuisine = Misc.arrayOrEmpty(itemTypes['recettecuisine']);
formData.recettesAlchimiques = Misc.arrayOrEmpty(itemTypes['recettealchimique']); formData.recettesAlchimiques = Misc.arrayOrEmpty(itemTypes['recettealchimique']);
formData.maladies = Misc.arrayOrEmpty(itemTypes['maladie']); formData.maladies = Misc.arrayOrEmpty(itemTypes['maladie']);

View File

@ -1,3 +1,4 @@
import { RdDBaseActorSheet } from "./actor/base-actor-sheet.js";
import { RdDItemSheet } from "./item-sheet.js"; import { RdDItemSheet } from "./item-sheet.js";
import { RdDSheetUtility } from "./rdd-sheet-utility.js"; import { RdDSheetUtility } from "./rdd-sheet-utility.js";
import { RdDUtility } from "./rdd-utility.js"; import { RdDUtility } from "./rdd-utility.js";
@ -27,7 +28,7 @@ export class RdDConteneurItemSheet extends RdDItemSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
prepareConteneurData(formData) { prepareConteneurData(formData) {
RdDUtility.filterEquipementParType(formData, this.actor.itemTypes); RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets); this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
formData.subItems = formData.conteneurs.find(it => it._id == this.item.id)?.subItems; formData.subItems = formData.conteneurs.find(it => it._id == this.item.id)?.subItems;