mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 15:03:37 +02:00
Only showing the menu if there are extra resources
This commit is contained in:
parent
94a320b91c
commit
e102a28305
2 changed files with 10 additions and 1 deletions
|
|
@ -227,6 +227,9 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
async _preparePartContext(partId, context, options) {
|
||||
context = await super._preparePartContext(partId, context, options);
|
||||
switch (partId) {
|
||||
case 'header':
|
||||
await this._prepareHeaderContext(context, options);
|
||||
break;
|
||||
case 'loadout':
|
||||
await this._prepareLoadoutContext(context, options);
|
||||
break;
|
||||
|
|
@ -241,6 +244,12 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
return context;
|
||||
}
|
||||
|
||||
async _prepareHeaderContext(context, _options) {
|
||||
context.hasExtraResources = Object.keys(CONFIG.DH.ACTOR.characterResources).some(
|
||||
key => !CONFIG.DH.ACTOR.characterBaseResources[key]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare render context for the Loadout part.
|
||||
* @param {ApplicationRenderContext} context
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@
|
|||
</span>
|
||||
{{/times}}
|
||||
</div>
|
||||
<button type="button" class="resource-manager" data-action="toggleResourceManagement"><i class="fa-solid fa-bars"></i></button>
|
||||
{{#if hasExtraResources}}<button type="button" class="resource-manager" data-action="toggleResourceManagement"><i class="fa-solid fa-bars"></i></button>{{/if}}
|
||||
</div>
|
||||
{{#if document.system.class.value}}
|
||||
<div class="domains-section">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue