Lien vers Items monde/compendium

This commit is contained in:
Vincent Vandemeulebrouck
2022-12-23 00:34:50 +01:00
parent 7bec249e8d
commit 81e3ceb4dc
3 changed files with 26 additions and 2 deletions

View File

@ -87,6 +87,11 @@ export class SystemCompendiums extends FormApplication {
return items;
}
static async loadDocument(document) {
const pack = game.packs.get(document.pack);
return await pack.getDocument(document.id ?? document._id);
}
static async getItems(compendium, itemType = undefined) {
const items = await SystemCompendiums.getPackContent(compendium, 'Item');
return (itemType ? items.filter(it => it.type == itemType) : items);