mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Show adversary and environment type
This commit is contained in:
parent
b3fcf926be
commit
24ec7673b5
3 changed files with 20 additions and 15 deletions
|
|
@ -2703,10 +2703,9 @@
|
||||||
},
|
},
|
||||||
"Sidebar": {
|
"Sidebar": {
|
||||||
"actorDirectory": {
|
"actorDirectory": {
|
||||||
"adversary": "Tier {tier} Adversary",
|
"tier": "Tier {tier} {type}",
|
||||||
"character": "Level {level} Character",
|
"character": "Level {level} Character",
|
||||||
"companion": "{partner}'s Companion",
|
"companion": "{partner}'s Companion"
|
||||||
"environment": "Tier {tier} Environment"
|
|
||||||
},
|
},
|
||||||
"daggerheartMenu": {
|
"daggerheartMenu": {
|
||||||
"title": "Daggerheart Menu",
|
"title": "Daggerheart Menu",
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,19 @@
|
||||||
export default class DhActorDirectory extends foundry.applications.sidebar.tabs.ActorDirectory {
|
export default class DhActorDirectory extends foundry.applications.sidebar.tabs.ActorDirectory {
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
renderUpdateKeys: [
|
renderUpdateKeys: ['system.levelData.level.current', 'system.partner', 'system.tier']
|
||||||
"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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<a class="entry-name ellipsis" data-action="activateEntry">
|
<a class="entry-name ellipsis" data-action="activateEntry">
|
||||||
<span>{{name}}</span>
|
<span>{{name}}</span>
|
||||||
{{#if (eq type "adversary")}}
|
{{#if (or (eq type "adversary") (eq type "environment"))}}
|
||||||
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.adversary" tier=system.tier}}</span>
|
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.tier" tier=system.tier type=(@root.getTypeLabel this)}}</span>
|
||||||
{{else if (eq type "character")}}
|
{{else if (eq type "character")}}
|
||||||
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.character" level=system.levelData.level.current}}</span>
|
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.character" level=system.levelData.level.current}}</span>
|
||||||
{{else if (eq type "companion")}}
|
{{else if (eq type "companion")}}
|
||||||
|
|
@ -14,8 +14,6 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="entry-subtitle">{{localize "TYPES.Actor.companion"}}</span>
|
<span class="entry-subtitle">{{localize "TYPES.Actor.companion"}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else if (eq type "environment")}}
|
|
||||||
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.environment" tier=system.tier}}</span>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue