mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-16 13:41:07 +01:00
use enabled toggle to use localized initial label values.
This commit is contained in:
parent
32c224c472
commit
27ac324694
6 changed files with 33 additions and 14 deletions
|
|
@ -101,6 +101,7 @@
|
||||||
"traitArray": { "label": "Initial Trait Modifiers" }
|
"traitArray": { "label": "Initial Trait Modifiers" }
|
||||||
},
|
},
|
||||||
"Currency": {
|
"Currency": {
|
||||||
|
"enabled": "Enable Overrides",
|
||||||
"title": "Currency Overrides",
|
"title": "Currency Overrides",
|
||||||
"currencyName": "Currency Name",
|
"currencyName": "Currency Name",
|
||||||
"coinName": "Coin Name",
|
"coinName": "Coin Name",
|
||||||
|
|
|
||||||
|
|
@ -329,9 +329,20 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
},
|
},
|
||||||
items: this.document.items.filter(x => x.type === 'armor')
|
items: this.document.items.filter(x => x.type === 'armor')
|
||||||
},
|
},
|
||||||
currency: game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew).currency
|
currency: {
|
||||||
|
title: game.i18n.localize('DAGGERHEART.Sheets.PC.Gold.Title'),
|
||||||
|
coins: game.i18n.localize('DAGGERHEART.Sheets.PC.Gold.Coins'),
|
||||||
|
handfulls: game.i18n.localize('DAGGERHEART.Sheets.PC.Gold.Handfulls'),
|
||||||
|
bags: game.i18n.localize('DAGGERHEART.Sheets.PC.Gold.Bags'),
|
||||||
|
chests: game.i18n.localize('DAGGERHEART.Sheets.PC.Gold.Chests')
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const homebrewCurrency = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew).currency;
|
||||||
|
if (homebrewCurrency.enabled) {
|
||||||
|
context.inventory.currency = homebrewCurrency;
|
||||||
|
}
|
||||||
|
|
||||||
if (context.inventory.length === 0) {
|
if (context.inventory.length === 0) {
|
||||||
context.inventory = Array(1).fill(Array(5).fill([]));
|
context.inventory = Array(1).fill(Array(5).fill([]));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@ export default class DhHomebrew extends foundry.abstract.DataModel {
|
||||||
initial: () => [2, 1, 1, 0, 0, -1]
|
initial: () => [2, 1, 1, 0, 0, -1]
|
||||||
}),
|
}),
|
||||||
currency: new fields.SchemaField({
|
currency: new fields.SchemaField({
|
||||||
|
enabled: new fields.BooleanField({
|
||||||
|
required: true,
|
||||||
|
initial: false,
|
||||||
|
label: 'DAGGERHEART.Settings.Homebrew.Currency.enabled'
|
||||||
|
}),
|
||||||
title: new fields.StringField({
|
title: new fields.StringField({
|
||||||
required: true,
|
required: true,
|
||||||
initial: 'Gold',
|
initial: 'Gold',
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
<legend>
|
<legend>
|
||||||
{{localize "DAGGERHEART.Settings.Homebrew.Currency.title"}}
|
{{localize "DAGGERHEART.Settings.Homebrew.Currency.title"}}
|
||||||
</legend>
|
</legend>
|
||||||
|
{{formGroup settingFields.schema.fields.currency.fields.enabled value=settingFields._source.currency.enabled localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.currency.fields.title value=settingFields._source.currency.title localize=true}}
|
{{formGroup settingFields.schema.fields.currency.fields.title value=settingFields._source.currency.title localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.currency.fields.coins value=settingFields._source.currency.coins localize=true}}
|
{{formGroup settingFields.schema.fields.currency.fields.coins value=settingFields._source.currency.coins localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.currency.fields.handfulls value=settingFields._source.currency.handfulls localize=true}}
|
{{formGroup settingFields.schema.fields.currency.fields.handfulls value=settingFields._source.currency.handfulls localize=true}}
|
||||||
|
|
|
||||||
|
|
@ -21,23 +21,22 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="currency-section">
|
<div class="currency-section">
|
||||||
{{log this}}
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<span>{{this.inventory.currency.coins}}</span>
|
<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}}
|
{{formInput systemFields.gold.fields.coins value=source.system.gold.coins enriched=source.system.gold.coins localize=true toggled=true}}
|
||||||
</div>
|
</div>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<span>{{this.inventory.currency.handfulls}}</span>
|
<span>{{localize this.inventory.currency.handfulls}}</span>
|
||||||
{{formInput systemFields.gold.fields.handfulls value=source.system.gold.handfulls enriched=source.system.gold.handfulls localize=true toggled=true}}
|
{{formInput systemFields.gold.fields.handfulls value=source.system.gold.handfulls enriched=source.system.gold.handfulls localize=true toggled=true}}
|
||||||
</div>
|
</div>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<span>{{this.inventory.currency.bags}}</span>
|
<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}}
|
{{formInput systemFields.gold.fields.bags value=source.system.gold.bags enriched=source.system.gold.bags localize=true toggled=true}}
|
||||||
</div>
|
</div>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<span>{{this.inventory.currency.chests}}</span>
|
<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}}
|
{{formInput systemFields.gold.fields.chests value=source.system.gold.chests enriched=source.system.gold.chests localize=true toggled=true}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
|
|
||||||
|
{{log this}}
|
||||||
<fieldset class="left-main-container" style="padding-top: 0; margin-top: 8px;">
|
<fieldset class="left-main-container" style="padding-top: 0; margin-top: 8px;">
|
||||||
<legend class="legend" style="line-height: 2px;">{{localize "DAGGERHEART.Sheets.PC.Gold.Title"}}</legend>
|
<legend class="legend" style="line-height: 2px;">{{localize this.inventory.currency.title}}</legend>
|
||||||
|
|
||||||
<div class="gold-section">
|
<div class="gold-section">
|
||||||
<fieldset class="gold-fieldset">
|
<fieldset class="gold-fieldset">
|
||||||
<legend>
|
<legend>
|
||||||
{{localize "DAGGERHEART.Sheets.PC.Gold.Coins"}}
|
{{localize this.inventory.currency.coins}}
|
||||||
</legend>
|
</legend>
|
||||||
<div class="gold-column">
|
<div class="gold-column">
|
||||||
<div class="gold-row">
|
<div class="gold-row">
|
||||||
|
|
@ -27,7 +29,7 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="gold-fieldset">
|
<fieldset class="gold-fieldset">
|
||||||
<legend>
|
<legend>
|
||||||
{{localize "DAGGERHEART.Sheets.PC.Gold.Handfulls"}}
|
{{localize this.inventory.currency.handfulls}}
|
||||||
</legend>
|
</legend>
|
||||||
<div class="gold-column">
|
<div class="gold-column">
|
||||||
<div class="gold-row">
|
<div class="gold-row">
|
||||||
|
|
@ -50,7 +52,7 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="gold-fieldset">
|
<fieldset class="gold-fieldset">
|
||||||
<legend>
|
<legend>
|
||||||
{{localize "DAGGERHEART.Sheets.PC.Gold.Bags"}}
|
{{localize this.inventory.currency.bags}}
|
||||||
</legend>
|
</legend>
|
||||||
<div class="gold-column">
|
<div class="gold-column">
|
||||||
<div class="gold-row">
|
<div class="gold-row">
|
||||||
|
|
@ -76,7 +78,7 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="gold-fieldset" style="min-width: 56px;">
|
<fieldset class="gold-fieldset" style="min-width: 56px;">
|
||||||
<legend>
|
<legend>
|
||||||
{{localize "DAGGERHEART.Sheets.PC.Gold.Chests"}}
|
{{localize this.inventory.currency.chests}}
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
<div class="gold-column">
|
<div class="gold-column">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue