mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Fallback adversay and environment label to item type label
This commit is contained in:
parent
470337b00a
commit
24f94bd9b9
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue