Skip to content

[Feature] Configurable starting gold amounts in Homebrew settings#1969

Open
TrezzeIohan wants to merge 3 commits into
Foundryborne:mainfrom
TrezzeIohan:feat/homebrew-settings-gold-734
Open

[Feature] Configurable starting gold amounts in Homebrew settings#1969
TrezzeIohan wants to merge 3 commits into
Foundryborne:mainfrom
TrezzeIohan:feat/homebrew-settings-gold-734

Conversation

@TrezzeIohan
Copy link
Copy Markdown

@TrezzeIohan TrezzeIohan commented Jun 4, 2026

Hi, guys! This is my first time contributing to a project; any feedback is appreciated.

This pull request aims to solve issue #734

Added initialAmount field to each currency type (coins, handfuls, bags, chests) in the Homebrew settings schema. Defaults match book values (0, 1, 0, 0).

  • Homebrew.mjs: added initialAmount NumberField per currency; _initializeSource coerces empty submissions to 0; refreshConfig() syncs values to CONFIG.DH.RESOURCE.character.initialCurrency
  • resourceConfig.mjs: added mutable initialCurrency object on character export
  • actorField.mjs: added CharacterGoldField subclass that reads initial values from config at actor creation time
  • character.mjs: switched from GoldField to CharacterGoldField
  • settings.hbs: restructured currency section to CSS Grid with column headers ("Quantity Name" / "Starting Amount") instead of per-field inline labels
  • settings.less: added .currency-rows grid styles
  • en.json: added quantityName and initialAmount localisation keys
Screenshot from 2026-06-04 00-17-41

@CarlosFdez
Copy link
Copy Markdown
Contributor

Hello, thank you for working on the PR.

The idea seems sound, though I have a few observations.

  1. Disabled denominations will still get the initial value, which will be revealed when un-disabling it. The initial value should maybe set the values for disabled ones to zero somewhere.
  2. Instead of making a CharacterGoldField subclass, you could add args to the GoldField to pass to the second parameter of the schemafield during initialization. You could then set an initial value callback from within the character itself.
  3. Instead of outright giving up the schema based form input stuff (since formGroup doesn't work), you could use formInput instead. That should work for the text inputs.
  4. Quantity Name doesn't feel like the right name for the column. Perhaps Denomination or Category Name? That's what its called in the book (both terms are used at various points on page 104 of the CRB).

Added `initialAmount` field to each currency type (coins, handfuls, bags, chests)
in the Homebrew settings schema. Defaults match book values (0, 1, 0, 0).

- Homebrew.mjs: added `initialAmount` NumberField per currency; `_initializeSource`
  coerces empty submissions to 0; `refreshConfig()` syncs values to
  `CONFIG.DH.RESOURCE.character.initialCurrency`
- resourceConfig.mjs: added mutable `initialCurrency` object on `character` export
- actorField.mjs: added `CharacterGoldField` subclass that reads initial values
  from config at actor creation time
- character.mjs: switched from `GoldField` to `CharacterGoldField`
- settings.hbs: restructured currency section to CSS Grid with column headers
  ("Quantity Name" / "Starting Amount") instead of per-field inline labels
- settings.less: added `.currency-rows` grid styles
- en.json: added `quantityName` and `initialAmount` localisation keys
- 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)
@TrezzeIohan TrezzeIohan force-pushed the feat/homebrew-settings-gold-734 branch from 7c84de6 to 83b25f4 Compare June 6, 2026 02:30
@TrezzeIohan
Copy link
Copy Markdown
Author

@CarlosFdez Thank you so much for your feedback!

I've addressed all the points you raised. Please feel free to leave any further comments.
Also, if this PR gets accepted, do you have any other issues you'd recommend I work on?

[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)

Comment thread module/data/fields/actorField.mjs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants