Adaptation Feuilles Acteurs

This commit is contained in:
Vincent Vandemeulebrouck
2021-03-25 03:18:27 +01:00
parent 5fb8d22a7a
commit 43cf091345
25 changed files with 277 additions and 237 deletions

View File

@ -36,14 +36,14 @@ export class RddCompendiumOrganiser {
Hooks.on('renderCompendium', async (pack, html, data) => RddCompendiumOrganiser.onRenderCompendium(pack, html, data))
}
static async onRenderCompendium(pack, html, data) {
console.log('onRenderCompendium', pack, html, data);
static async onRenderCompendium(compendium, html, data) {
console.log('onRenderCompendium', compendium, html, data);
let pack = compendium.collection
if (pack.metadata.system === 'foundryvtt-reve-de-dragon') {
const content = await pack.getContent();
html.find('.directory-item').each((i, element) => {
let entity = content.find(it => it._id === element.dataset.entryId);
let entity = pack.get(element.dataset.documentId);
if (entity?.entity === 'Actor' || entity?.entity === 'Item') {
const typeName = typeDisplayName[entity.data.type] ?? Misc.upperFirst(entity.data.type);
RddCompendiumOrganiser.insertEntityType(element, typeName);