mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
.
This commit is contained in:
parent
23a497bab8
commit
2e4d3de379
5 changed files with 90 additions and 44 deletions
|
|
@ -266,23 +266,24 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
async _prepareSidebarContext(context, _options) {
|
||||
context.isDeath = this.document.system.deathMoveViable;
|
||||
context.sidebarFavoritesEmpty = this.document.system.sidebarFavorites.length === 0;
|
||||
context.showfavorites = !context.sidebarFavoritesEmpty || this.document.system.usedUnarmed;
|
||||
|
||||
const initialFavorites = this.document.system.usedUnarmed
|
||||
? {
|
||||
equipment: {
|
||||
label: 'DAGGERHEART.GENERAL.equipment',
|
||||
items: [{ type: 'attack', value: this.document.system.usedUnarmed }]
|
||||
}
|
||||
}
|
||||
: {};
|
||||
context.sidebarFavorites = this.document.system.sidebarFavorites.reduce((acc, item) => {
|
||||
const type = item.type === 'domainCard' ? item.type : 'equipment';
|
||||
const label = type === 'domainCard' ? 'DAGGERHEART.GENERAL.loadout' : 'DAGGERHEART.GENERAL.equipment';
|
||||
if (!acc[type]) acc[type] = { label, items: [] };
|
||||
acc[type].items.push({ type: item.type, value: item });
|
||||
// const initialFavorites = this.document.system.usedUnarmed
|
||||
// ? {
|
||||
// equipment: {
|
||||
// label: 'DAGGERHEART.GENERAL.equipment',
|
||||
// items: [{ type: 'attack', value: this.document.system.usedUnarmed }]
|
||||
// }
|
||||
// }
|
||||
// : {};
|
||||
// context.sidebarFavorites = this.document.system.sidebarFavorites.reduce((acc, item) => {
|
||||
// const type = item.type === 'domainCard' ? item.type : 'equipment';
|
||||
// const label = type === 'domainCard' ? 'DAGGERHEART.GENERAL.loadout' : 'DAGGERHEART.GENERAL.equipment';
|
||||
// if (!acc[type]) acc[type] = { label, items: [] };
|
||||
// acc[type].items.push({ type: item.type, value: item });
|
||||
|
||||
return acc;
|
||||
}, initialFavorites);
|
||||
// return acc;
|
||||
// }, initialFavorites);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue