mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[PR] [Feature] 590 - Daggerheart Menu (#1007)
* Added menu with refresh tools * Replaced menu icon
This commit is contained in:
parent
eefb28c312
commit
f1b6d3851d
53 changed files with 730 additions and 350 deletions
33
module/applications/sidebar/sidebar.mjs
Normal file
33
module/applications/sidebar/sidebar.mjs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
export default class DhSidebar extends Sidebar {
|
||||
/** @override */
|
||||
static TABS = {
|
||||
...super.TABS,
|
||||
daggerheartMenu: {
|
||||
tooltip: 'DAGGERHEART.UI.Sidebar.daggerheartMenu.title',
|
||||
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;
|
||||
}, {});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue