Fix: détermination niveau de base

simplification: déterminer les catégories en fonction du type d'Item
This commit is contained in:
2024-09-27 22:39:49 +02:00
parent 599fdc752d
commit 9c17f85fa8
5 changed files with 26 additions and 27 deletions

View File

@ -12,7 +12,7 @@ import { SystemCompendiums } from "./settings/system-compendiums.js";
import { Misc } from "./misc.js";
import { RdDTimestamp } from "./time/rdd-timestamp.js";
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
import { ITEM_TYPES } from "./item.js";
import { ITEM_TYPES, RdDItem } from "./item.js";
/**
* Extend the basic ItemSheet for RdD specific items
@ -107,7 +107,7 @@ export class RdDItemSheet extends ItemSheet {
}
const competences = await SystemCompendiums.getCompetences('personnage');
formData.categories = this.item.getCategories()
formData.categories = RdDItem.getCategories(this.item.type)
if (this.item.type == 'tache' || this.item.type == 'livre' || this.item.type == 'meditation' || this.item.type == 'oeuvre') {
formData.caracList = foundry.utils.duplicate(game.model.Actor.personnage.carac)
formData.caracList["reve-actuel"] = foundry.utils.duplicate(game.model.Actor.personnage.reve.reve)
@ -258,7 +258,7 @@ export class RdDItemSheet extends ItemSheet {
if (this.item.isCompetence()) {
const categorie = event.currentTarget.value;
const level = RdDItemCompetence.getNiveauBase(categorie, this.item.getCategories());
const level = RdDItemCompetence.getNiveauBase(categorie, this.item.type);
this.item.system.base = level;
this.html.find('[name="system.base"]').val(level);
}