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",
"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);
}
});