mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Order character sidebar equip items (#1837)
This commit is contained in:
parent
cc822856e5
commit
53f77972e3
2 changed files with 15 additions and 12 deletions
|
|
@ -3,7 +3,7 @@ import DhDeathMove from '../../dialogs/deathMove.mjs';
|
|||
import { CharacterLevelup, LevelupViewMode } from '../../levelup/_module.mjs';
|
||||
import DhCharacterCreation from '../../characterCreation/characterCreation.mjs';
|
||||
import FilterMenu from '../../ux/filter-menu.mjs';
|
||||
import { getArmorSources, getDocFromElement, getDocFromElementSync } from '../../../helpers/utils.mjs';
|
||||
import { getArmorSources, getDocFromElement, getDocFromElementSync, sortBy } from '../../../helpers/utils.mjs';
|
||||
|
||||
/**@typedef {import('@client/applications/_types.mjs').ApplicationClickAction} ApplicationClickAction */
|
||||
|
||||
|
|
@ -226,6 +226,11 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
context.resources.stress.emptyPips =
|
||||
context.resources.stress.max < maxResource ? maxResource - context.resources.stress.max : 0;
|
||||
|
||||
context.equippedItems = sortBy(
|
||||
this.document.items.filter(i => i.system.equipped),
|
||||
i => (i.type === 'weapon' ? (i.system.secondary ? 1 : 0) : 2)
|
||||
);
|
||||
|
||||
context.beastformActive = this.document.effects.find(x => x.type === 'beastform');
|
||||
|
||||
return context;
|
||||
|
|
|
|||
|
|
@ -113,13 +113,11 @@
|
|||
type='attack'
|
||||
}}
|
||||
{{/if}}
|
||||
{{#each document.items as |item|}}
|
||||
{{#if item.system.equipped}}
|
||||
{{#each equippedItems as |item|}}
|
||||
{{> 'daggerheart.inventory-item-compact'
|
||||
item=item
|
||||
type=item.type
|
||||
}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue