mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Show subtitles for various actor types in actor directory
This commit is contained in:
parent
d137e33c3d
commit
b3fcf926be
6 changed files with 53 additions and 0 deletions
|
|
@ -63,6 +63,7 @@ CONFIG.ui.combat = applications.ui.DhCombatTracker;
|
||||||
CONFIG.ui.chat = applications.ui.DhChatLog;
|
CONFIG.ui.chat = applications.ui.DhChatLog;
|
||||||
CONFIG.ui.hotbar = applications.ui.DhHotbar;
|
CONFIG.ui.hotbar = applications.ui.DhHotbar;
|
||||||
CONFIG.ui.sidebar = applications.sidebar.DhSidebar;
|
CONFIG.ui.sidebar = applications.sidebar.DhSidebar;
|
||||||
|
CONFIG.ui.actors = applications.sidebar.DhActorDirectory;
|
||||||
CONFIG.ui.daggerheartMenu = applications.sidebar.DaggerheartMenu;
|
CONFIG.ui.daggerheartMenu = applications.sidebar.DaggerheartMenu;
|
||||||
CONFIG.ui.resources = applications.ui.DhFearTracker;
|
CONFIG.ui.resources = applications.ui.DhFearTracker;
|
||||||
CONFIG.ui.countdowns = applications.ui.DhCountdowns;
|
CONFIG.ui.countdowns = applications.ui.DhCountdowns;
|
||||||
|
|
|
||||||
|
|
@ -2702,6 +2702,12 @@
|
||||||
"documentIsMissing": "The {documentType} is missing from the world."
|
"documentIsMissing": "The {documentType} is missing from the world."
|
||||||
},
|
},
|
||||||
"Sidebar": {
|
"Sidebar": {
|
||||||
|
"actorDirectory": {
|
||||||
|
"adversary": "Tier {tier} Adversary",
|
||||||
|
"character": "Level {level} Character",
|
||||||
|
"companion": "{partner}'s Companion",
|
||||||
|
"environment": "Tier {tier} Environment"
|
||||||
|
},
|
||||||
"daggerheartMenu": {
|
"daggerheartMenu": {
|
||||||
"title": "Daggerheart Menu",
|
"title": "Daggerheart Menu",
|
||||||
"startSession": "Start Session",
|
"startSession": "Start Session",
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
export { default as DaggerheartMenu } from './tabs/daggerheartMenu.mjs';
|
export { default as DaggerheartMenu } from './tabs/daggerheartMenu.mjs';
|
||||||
|
export { default as DhActorDirectory } from './tabs/actorDirectory.mjs';
|
||||||
export { default as DhSidebar } from './sidebar.mjs';
|
export { default as DhSidebar } from './sidebar.mjs';
|
||||||
|
|
|
||||||
11
module/applications/sidebar/tabs/actorDirectory.mjs
Normal file
11
module/applications/sidebar/tabs/actorDirectory.mjs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
export default class DhActorDirectory extends foundry.applications.sidebar.tabs.ActorDirectory {
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
renderUpdateKeys: [
|
||||||
|
"system.levelData.level.current",
|
||||||
|
"system.partner",
|
||||||
|
"system.tier"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
static _entryPartial = "systems/daggerheart/templates/ui/sidebar/actor-document-partial.hbs";
|
||||||
|
}
|
||||||
|
|
@ -13,3 +13,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.actors-sidebar {
|
||||||
|
.directory-item.actor .entry-name:has(.entry-subtitle) {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
line-height: 1rem;
|
||||||
|
padding-top: 0.125rem;
|
||||||
|
.entry-subtitle {
|
||||||
|
color: var(--color-text-subtle);
|
||||||
|
font-size: var(--font-size-12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
templates/ui/sidebar/actor-document-partial.hbs
Normal file
21
templates/ui/sidebar/actor-document-partial.hbs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<li class="directory-item entry document {{@root.documentCls}} flexrow" data-entry-id="{{id}}">
|
||||||
|
{{#if thumbnail}}
|
||||||
|
<img class="thumbnail" src="{{thumbnail}}" alt="{{name}}" loading="lazy">
|
||||||
|
{{/if}}
|
||||||
|
<a class="entry-name ellipsis" data-action="activateEntry">
|
||||||
|
<span>{{name}}</span>
|
||||||
|
{{#if (eq type "adversary")}}
|
||||||
|
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.adversary" tier=system.tier}}</span>
|
||||||
|
{{else if (eq type "character")}}
|
||||||
|
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.character" level=system.levelData.level.current}}</span>
|
||||||
|
{{else if (eq type "companion")}}
|
||||||
|
{{#if system.partner}}
|
||||||
|
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.companion" partner=system.partner.name}}</span>
|
||||||
|
{{else}}
|
||||||
|
<span class="entry-subtitle">{{localize "TYPES.Actor.companion"}}</span>
|
||||||
|
{{/if}}
|
||||||
|
{{else if (eq type "environment")}}
|
||||||
|
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.environment" tier=system.tier}}</span>
|
||||||
|
{{/if}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue