[Fix] Address PR review feedback for starting gold feature

- Disabled denominations now receive 0 at character creation
- Replace CharacterGoldField subclass with GoldField options callback;
  initial value logic now lives in character.mjs
- Use formInput instead of plain text inputs for denomination labels
- Rename "Quantity Name" column header to "Denomination"
- Remove initialCurrency from resourceConfig and currency sync from
  refreshConfig (no longer needed)
This commit is contained in:
Iohan Trézze 2026-06-05 23:27:37 -03:00
parent d549a609e3
commit 83b25f4771
6 changed files with 39 additions and 30 deletions

View file

@ -3,7 +3,7 @@ import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs';
import DhLevelData from '../levelData.mjs';
import { commonActorRules } from './base.mjs';
import DhCreature from './creature.mjs';
import { attributeField, stressDamageReductionRule, bonusField, CharacterGoldField } from '../fields/actorField.mjs';
import { attributeField, stressDamageReductionRule, bonusField, GoldField } from '../fields/actorField.mjs';
import { ActionField } from '../fields/actionField.mjs';
import DHCharacterSettings from '../../applications/sheets-configs/character-settings.mjs';
import { getArmorSources } from '../../helpers/utils.mjs';
@ -64,7 +64,18 @@ export default class DhCharacter extends DhCreature {
core: new fields.BooleanField({ initial: false })
})
),
gold: new CharacterGoldField(),
gold: new GoldField({
initial: () => {
const homebrew = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew);
const { coins, handfuls, bags, chests } = homebrew.currency;
return {
coins: coins.enabled ? coins.initialAmount : 0,
handfuls: handfuls.enabled ? handfuls.initialAmount : 0,
bags: bags.enabled ? bags.initialAmount : 0,
chests: chests.enabled ? chests.initialAmount : 0
};
}
}),
scars: new fields.NumberField({ initial: 0, integer: true, label: 'DAGGERHEART.GENERAL.scars' }),
biography: new fields.SchemaField({
background: new fields.HTMLField(),