From 24f94bd9b9f1182487727e4d5f9f1f3bd93df5ce Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Wed, 26 Nov 2025 22:10:19 -0500 Subject: [PATCH] Fallback adversay and environment label to item type label --- module/applications/sidebar/tabs/actorDirectory.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/applications/sidebar/tabs/actorDirectory.mjs b/module/applications/sidebar/tabs/actorDirectory.mjs index bf0d5eb3..4a528e74 100644 --- a/module/applications/sidebar/tabs/actorDirectory.mjs +++ b/module/applications/sidebar/tabs/actorDirectory.mjs @@ -8,11 +8,12 @@ export default class DhActorDirectory extends foundry.applications.sidebar.tabs. async _prepareDirectoryContext(context, options) { await super._prepareDirectoryContext(context, options); const adversaryTypes = CONFIG.DH.ACTOR.allAdversaryTypes(); + const environmentTypes = CONFIG.DH.ACTOR.environmentTypes; context.getTypeLabel = document => { return document.type === 'adversary' - ? game.i18n.localize(adversaryTypes[document.system.type].label) + ? game.i18n.localize(adversaryTypes[document.system.type]?.label ?? 'TYPES.Actor.adversary') : document.type === 'environment' - ? game.i18n.localize(CONFIG.DH.ACTOR.environmentTypes[document.system.type].label) + ? game.i18n.localize(environmentTypes[document.system.type]?.label ?? 'TYPES.Actor.environment') : null; }; }