diff --git a/module/rdd-compendium-organiser.js b/module/rdd-compendium-organiser.js index 7ee331a6..1bc56339 100644 --- a/module/rdd-compendium-organiser.js +++ b/module/rdd-compendium-organiser.js @@ -10,7 +10,7 @@ const typeDisplayName = { "competence": "Compétence", "herbe": "Plante", "ingredient": "Ingrédient", - "queue": "Queue de dragon", + "queue": "Queue de Dragon", "ombre": "Ombre de Thanatos", "souffle": "Souffle de Dragon", "tete": "Tête de Dragon", @@ -24,7 +24,7 @@ const typeDisplayName = { "tarot": "Carte de tarot draconique", "tache": "Tâche", "meditation": "Méditation", - "musique": "Morceau de musique", + "musique": "Mélodie", "chant": "Chanson", "creature": "Créature", "entite": "Entité", @@ -40,12 +40,12 @@ export class RddCompendiumOrganiser { 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 = pack.get(element.dataset.documentId); - if (entity?.entity === 'Actor' || entity?.entity === 'Item') { - const typeName = typeDisplayName[entity.data.type] ?? Misc.upperFirst(entity.data.type); + const entity = pack.get(element.dataset.documentId); + const entityName = entity?.documentName; + if (entityName === 'Actor' || entityName === 'Item') { + const entityType = entity.data.type; + const typeName = typeDisplayName[entityType] ?? Misc.upperFirst(entitytype); RddCompendiumOrganiser.insertEntityType(element, typeName); } });