Chargement depuis les compendium sélectionnés

Fix, les compendiums systèmes n'étaient pas utilisés pour les herbes
et les compétences
This commit is contained in:
Vincent Vandemeulebrouck
2022-11-23 22:39:48 +01:00
parent 97ee5bc331
commit e78ae3b292
6 changed files with 35 additions and 45 deletions

View File

@ -1,6 +1,7 @@
import { RdDUtility } from "./rdd-utility.js";
import { RdDCalendrier } from "./rdd-calendrier.js";
import { Grammar } from "./grammar.js";
import { SystemCompendiums } from "./settings/system-compendiums.js";
/* -------------------------------------------- */
export class RdDHerbes extends Item {
@ -12,9 +13,8 @@ export class RdDHerbes extends Item {
}
static async listCategorieHerbes(categorie) {
return await RdDUtility.loadItems(
it => it.type == 'herbe' && it.system.categorie.toLowerCase() == categorie.toLowerCase(),
'foundryvtt-reve-de-dragon.botanique');
const herbes = await SystemCompendiums.getWorldOrCompendiumItems('herbe', 'botanique');
return herbes.filter(it => Grammar.equalsInsensitive(it.system.categorie, categorie));
}
/* -------------------------------------------- */