mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Omit currency section if all are disabled
This commit is contained in:
parent
b31ab36029
commit
a4899f6598
3 changed files with 24 additions and 40 deletions
|
|
@ -89,6 +89,7 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
|
||||||
value: context.source.system.gold[key]
|
value: context.source.system.gold[key]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
context.inventory.hasCurrency = Object.values(context.inventory.currencies).some((c) => c.enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,18 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="currency-section">
|
{{#if this.inventory.hasCurrency}}
|
||||||
{{#each this.inventory.currencies as | currency |}}
|
<div class="currency-section">
|
||||||
{{#if currency.enabled}}
|
{{#each this.inventory.currencies as | currency |}}
|
||||||
<div class="input">
|
{{#if currency.enabled}}
|
||||||
<span>{{localize currency.label}}</span>
|
<div class="input">
|
||||||
{{formInput currency.field value=currency.value enriched=currency.value toggled=true}}
|
<span>{{localize currency.label}}</span>
|
||||||
</div>
|
{{formInput currency.field value=currency.value enriched=currency.value toggled=true}}
|
||||||
{{/if}}
|
</div>
|
||||||
{{/each}}
|
{{/if}}
|
||||||
</div>
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="items-section">
|
<div class="items-section">
|
||||||
{{> 'daggerheart.inventory-items'
|
{{> 'daggerheart.inventory-items'
|
||||||
|
|
|
||||||
|
|
@ -15,37 +15,18 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="currency-section">
|
{{#if inventory.hasCurrency}}
|
||||||
{{#each this.inventory.currencies as | currency |}}
|
<div class="currency-section">
|
||||||
{{#if currency.enabled}}
|
{{#each this.inventory.currencies as | currency |}}
|
||||||
<div class="input">
|
{{#if currency.enabled}}
|
||||||
<span>{{localize currency.label}}</span>
|
<div class="input">
|
||||||
{{formInput currency.field value=currency.value enriched=currency.value toggled=true}}
|
<span>{{localize currency.label}}</span>
|
||||||
</div>
|
{{formInput currency.field value=currency.value enriched=currency.value toggled=true}}
|
||||||
{{/if}}
|
</div>
|
||||||
{{/each}}
|
{{/if}}
|
||||||
{{!-- <div class="input">
|
{{/each}}
|
||||||
<span>{{localize this.inventory.currency.coins}}</span>
|
|
||||||
{{formInput systemFields.gold.fields.coins value=source.system.gold.coins enriched=source.system.gold.coins
|
|
||||||
localize=true toggled=true}}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="input">
|
{{/if}}
|
||||||
<span>{{localize this.inventory.currency.handfuls}}</span>
|
|
||||||
{{formInput systemFields.gold.fields.handfuls value=source.system.gold.handfuls
|
|
||||||
enriched=source.system.gold.handfuls localize=true toggled=true}}
|
|
||||||
</div>
|
|
||||||
<div class="input">
|
|
||||||
<span>{{localize this.inventory.currency.bags}}</span>
|
|
||||||
{{formInput systemFields.gold.fields.bags value=source.system.gold.bags enriched=source.system.gold.bags
|
|
||||||
localize=true toggled=true}}
|
|
||||||
</div>
|
|
||||||
<div class="input">
|
|
||||||
<span>{{localize this.inventory.currency.chests}}</span>
|
|
||||||
{{formInput systemFields.gold.fields.chests value=source.system.gold.chests
|
|
||||||
enriched=source.system.gold.chests localize=true toggled=true}}
|
|
||||||
</div> --}}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="items-section">
|
<div class="items-section">
|
||||||
{{> 'daggerheart.inventory-items'
|
{{> 'daggerheart.inventory-items'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue