Fix: deprecated in 0.8

This commit is contained in:
Vincent Vandemeulebrouck 2021-05-18 22:07:01 +02:00
parent d9618c6bbf
commit 853e7f4334

View File

@ -10,7 +10,7 @@ const typeDisplayName = {
"competence": "Compétence", "competence": "Compétence",
"herbe": "Plante", "herbe": "Plante",
"ingredient": "Ingrédient", "ingredient": "Ingrédient",
"queue": "Queue de dragon", "queue": "Queue de Dragon",
"ombre": "Ombre de Thanatos", "ombre": "Ombre de Thanatos",
"souffle": "Souffle de Dragon", "souffle": "Souffle de Dragon",
"tete": "Tête de Dragon", "tete": "Tête de Dragon",
@ -24,7 +24,7 @@ const typeDisplayName = {
"tarot": "Carte de tarot draconique", "tarot": "Carte de tarot draconique",
"tache": "Tâche", "tache": "Tâche",
"meditation": "Méditation", "meditation": "Méditation",
"musique": "Morceau de musique", "musique": "Mélodie",
"chant": "Chanson", "chant": "Chanson",
"creature": "Créature", "creature": "Créature",
"entite": "Entité", "entite": "Entité",
@ -40,12 +40,12 @@ export class RddCompendiumOrganiser {
console.log('onRenderCompendium', compendium, html, data); console.log('onRenderCompendium', compendium, html, data);
let pack = compendium.collection let pack = compendium.collection
if (pack.metadata.system === 'foundryvtt-reve-de-dragon') { if (pack.metadata.system === 'foundryvtt-reve-de-dragon') {
const content = await pack.getContent();
html.find('.directory-item').each((i, element) => { html.find('.directory-item').each((i, element) => {
let entity = pack.get(element.dataset.documentId); const entity = pack.get(element.dataset.documentId);
if (entity?.entity === 'Actor' || entity?.entity === 'Item') { const entityName = entity?.documentName;
const typeName = typeDisplayName[entity.data.type] ?? Misc.upperFirst(entity.data.type); if (entityName === 'Actor' || entityName === 'Item') {
const entityType = entity.data.type;
const typeName = typeDisplayName[entityType] ?? Misc.upperFirst(entitytype);
RddCompendiumOrganiser.insertEntityType(element, typeName); RddCompendiumOrganiser.insertEntityType(element, typeName);
} }
}); });