mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Replaced menu icon
This commit is contained in:
parent
4622d7ae51
commit
049bc27351
4 changed files with 52 additions and 1 deletions
|
|
@ -1,9 +1,33 @@
|
|||
export default class DhSidebar extends Sidebar {
|
||||
/** @override */
|
||||
static TABS = {
|
||||
...super.TABS,
|
||||
daggerheartMenu: {
|
||||
tooltip: 'DAGGERHEART.UI.Sidebar.daggerheartMenu.title',
|
||||
icon: 'fa-solid fa-bars'
|
||||
img: 'systems/daggerheart/assets/logos/FoundryBorneLogoWhite.svg'
|
||||
}
|
||||
};
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
tabs: {
|
||||
id: 'tabs',
|
||||
template: 'systems/daggerheart/templates/sidebar/tabs.hbs'
|
||||
}
|
||||
};
|
||||
|
||||
/** @override */
|
||||
async _prepareTabContext(context, options) {
|
||||
context.tabs = Object.entries(this.constructor.TABS).reduce((obj, [k, v]) => {
|
||||
let { documentName, gmOnly, tooltip, icon, img } = v;
|
||||
if (gmOnly && !game.user.isGM) return obj;
|
||||
if (documentName) {
|
||||
tooltip ??= getDocumentClass(documentName).metadata.labelPlural;
|
||||
icon ??= CONFIG[documentName]?.sidebarIcon;
|
||||
}
|
||||
obj[k] = { tooltip, icon, img };
|
||||
obj[k].active = this.tabGroups.primary === k;
|
||||
return obj;
|
||||
}, {});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,4 +23,5 @@
|
|||
|
||||
@import './settings/homebrew-settings/domains.less';
|
||||
|
||||
@import './sidebar/tabs.less';
|
||||
@import './sidebar/daggerheartMenu.less';
|
||||
|
|
|
|||
8
styles/less/ui/sidebar/tabs.less
Normal file
8
styles/less/ui/sidebar/tabs.less
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#interface #ui-right #sidebar {
|
||||
menu li button {
|
||||
img {
|
||||
width: 22px;
|
||||
max-width: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
templates/sidebar/tabs.hbs
Normal file
18
templates/sidebar/tabs.hbs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<nav class="tabs faded-ui" role="tablist" data-tooltip-direction="LEFT">
|
||||
<menu class="flexcol">
|
||||
{{#each tabs}}
|
||||
<li>
|
||||
<button type="button" class="ui-control plain icon {{#if icon}}{{icon}}{{/if}}" data-action="tab" data-tab="{{ @key }}"
|
||||
role="tab" aria-pressed="{{ active }}" data-group="primary" aria-label="{{ localize tooltip }}"
|
||||
aria-controls="{{ @key }}" data-tooltip>
|
||||
{{#if img}}<img src="{{img}}" />{{/if}}
|
||||
</button>
|
||||
<div class="notification-pip"></div>
|
||||
</li>
|
||||
{{/each}}
|
||||
<li>
|
||||
<button type="button" class="collapse ui-control plain icon fas fa-caret-left" data-tooltip
|
||||
aria-label="{{ localize "Expand" }}" data-action="toggleState"></button>
|
||||
</li>
|
||||
</menu>
|
||||
</nav>
|
||||
Loading…
Add table
Add a link
Reference in a new issue