mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
[Fix] Allow disabling coins (#1381)
* Add ability to disable coins * Omit currency section if all are disabled
This commit is contained in:
parent
f680ade1da
commit
ccdd413933
4 changed files with 25 additions and 41 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
<div class="toggleable-row">
|
||||
{{formGroup settingFields.schema.fields.currency.fields.coins.fields.label value=settingFields._source.currency.coins.label localize=true}}
|
||||
<input type="checkbox" {{checked settingFields._source.currency.coins.enabled}} disabled />
|
||||
<input type="checkbox" name="currency.coins.enabled" {{checked settingFields._source.currency.coins.enabled}} />
|
||||
</div>
|
||||
<div class="toggleable-row">
|
||||
{{formGroup settingFields.schema.fields.currency.fields.handfuls.fields.label value=settingFields._source.currency.handfuls.label localize=true}}
|
||||
|
|
|
|||
|
|
@ -12,16 +12,18 @@
|
|||
</a>
|
||||
</div>
|
||||
|
||||
<div class="currency-section">
|
||||
{{#each this.inventory.currencies as | currency |}}
|
||||
{{#if currency.enabled}}
|
||||
<div class="input">
|
||||
<span>{{localize currency.label}}</span>
|
||||
{{formInput currency.field value=currency.value enriched=currency.value toggled=true}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{#if this.inventory.hasCurrency}}
|
||||
<div class="currency-section">
|
||||
{{#each this.inventory.currencies as | currency |}}
|
||||
{{#if currency.enabled}}
|
||||
<div class="input">
|
||||
<span>{{localize currency.label}}</span>
|
||||
{{formInput currency.field value=currency.value enriched=currency.value toggled=true}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="items-section">
|
||||
{{> 'daggerheart.inventory-items'
|
||||
|
|
|
|||
|
|
@ -15,37 +15,18 @@
|
|||
</a>
|
||||
</div>
|
||||
|
||||
<div class="currency-section">
|
||||
{{#each this.inventory.currencies as | currency |}}
|
||||
{{#if currency.enabled}}
|
||||
<div class="input">
|
||||
<span>{{localize currency.label}}</span>
|
||||
{{formInput currency.field value=currency.value enriched=currency.value toggled=true}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
{{!-- <div class="input">
|
||||
<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}}
|
||||
{{#if inventory.hasCurrency}}
|
||||
<div class="currency-section">
|
||||
{{#each this.inventory.currencies as | currency |}}
|
||||
{{#if currency.enabled}}
|
||||
<div class="input">
|
||||
<span>{{localize currency.label}}</span>
|
||||
{{formInput currency.field value=currency.value enriched=currency.value toggled=true}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="input">
|
||||
<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>
|
||||
{{/if}}
|
||||
|
||||
<div class="items-section">
|
||||
{{> 'daggerheart.inventory-items'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue