mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 04: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) {
|
async _prepareDirectoryContext(context, options) {
|
||||||
await super._prepareDirectoryContext(context, options);
|
await super._prepareDirectoryContext(context, options);
|
||||||
const adversaryTypes = CONFIG.DH.ACTOR.allAdversaryTypes();
|
const adversaryTypes = CONFIG.DH.ACTOR.allAdversaryTypes();
|
||||||
|
const environmentTypes = CONFIG.DH.ACTOR.environmentTypes;
|
||||||
context.getTypeLabel = document => {
|
context.getTypeLabel = document => {
|
||||||
return document.type === 'adversary'
|
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'
|
: 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;
|
: null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue