diff --git a/module/applications/sheets/api/base-actor.mjs b/module/applications/sheets/api/base-actor.mjs index 02dcc448..bed42011 100644 --- a/module/applications/sheets/api/base-actor.mjs +++ b/module/applications/sheets/api/base-actor.mjs @@ -89,6 +89,7 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) { value: context.source.system.gold[key] }; } + context.inventory.hasCurrency = Object.values(context.inventory.currencies).some((c) => c.enabled); } return context; diff --git a/templates/sheets/actors/character/inventory.hbs b/templates/sheets/actors/character/inventory.hbs index 52de7f3c..e96d597c 100644 --- a/templates/sheets/actors/character/inventory.hbs +++ b/templates/sheets/actors/character/inventory.hbs @@ -12,16 +12,18 @@ -
- {{#each this.inventory.currencies as | currency |}} - {{#if currency.enabled}} -
- {{localize currency.label}} - {{formInput currency.field value=currency.value enriched=currency.value toggled=true}} -
- {{/if}} - {{/each}} -
+ {{#if this.inventory.hasCurrency}} +
+ {{#each this.inventory.currencies as | currency |}} + {{#if currency.enabled}} +
+ {{localize currency.label}} + {{formInput currency.field value=currency.value enriched=currency.value toggled=true}} +
+ {{/if}} + {{/each}} +
+ {{/if}}
{{> 'daggerheart.inventory-items' diff --git a/templates/sheets/actors/party/inventory.hbs b/templates/sheets/actors/party/inventory.hbs index 1596d47e..a3397145 100644 --- a/templates/sheets/actors/party/inventory.hbs +++ b/templates/sheets/actors/party/inventory.hbs @@ -15,37 +15,18 @@
-
- {{#each this.inventory.currencies as | currency |}} - {{#if currency.enabled}} -
- {{localize currency.label}} - {{formInput currency.field value=currency.value enriched=currency.value toggled=true}} -
- {{/if}} - {{/each}} - {{!--
- {{localize this.inventory.currency.coins}} - {{formInput systemFields.gold.fields.coins value=source.system.gold.coins enriched=source.system.gold.coins - localize=true toggled=true}} + {{#if inventory.hasCurrency}} +
+ {{#each this.inventory.currencies as | currency |}} + {{#if currency.enabled}} +
+ {{localize currency.label}} + {{formInput currency.field value=currency.value enriched=currency.value toggled=true}} +
+ {{/if}} + {{/each}}
-
- {{localize this.inventory.currency.handfuls}} - {{formInput systemFields.gold.fields.handfuls value=source.system.gold.handfuls - enriched=source.system.gold.handfuls localize=true toggled=true}} -
-
- {{localize this.inventory.currency.bags}} - {{formInput systemFields.gold.fields.bags value=source.system.gold.bags enriched=source.system.gold.bags - localize=true toggled=true}} -
-
- {{localize this.inventory.currency.chests}} - {{formInput systemFields.gold.fields.chests value=source.system.gold.chests - enriched=source.system.gold.chests localize=true toggled=true}} -
--}} - -
+ {{/if}}
{{> 'daggerheart.inventory-items'