Show adversary and environment type

This commit is contained in:
Carlos Fernandez 2025-11-25 06:45:13 -05:00
parent b3fcf926be
commit 24ec7673b5
3 changed files with 20 additions and 15 deletions

View file

@ -1,11 +1,19 @@
export default class DhActorDirectory extends foundry.applications.sidebar.tabs.ActorDirectory {
static DEFAULT_OPTIONS = {
renderUpdateKeys: [
"system.levelData.level.current",
"system.partner",
"system.tier"
]
}
renderUpdateKeys: ['system.levelData.level.current', 'system.partner', 'system.tier']
};
static _entryPartial = "systems/daggerheart/templates/ui/sidebar/actor-document-partial.hbs";
}
static _entryPartial = 'systems/daggerheart/templates/ui/sidebar/actor-document-partial.hbs';
async _prepareDirectoryContext(context, options) {
await super._prepareDirectoryContext(context, options);
const adversaryTypes = CONFIG.DH.ACTOR.allAdversaryTypes();
context.getTypeLabel = document => {
return document.type === 'adversary'
? game.i18n.localize(adversaryTypes[document.system.type].label)
: document.type === 'environment'
? game.i18n.localize(CONFIG.DH.ACTOR.environmentTypes[document.system.type].label)
: null;
};
}
}