Skip to content

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

Merged
WBHarry merged 3 commits into
Foundryborne:mainfrom
TrezzeIohan:feat/homebrew-settings-gold-734
Jun 7, 2026
Merged

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

Conversation

@TrezzeIohan

@TrezzeIohan TrezzeIohan commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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
Contributor 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
@cptn-cosmo

Copy link
Copy Markdown
Contributor

@TrezzeIohan It is a bit difficult recommending issues currently. If you haven't already, we'd recommend joining the projects discord server to discuss open issues and how to best approach them. If you have already feel free to ping me (same username) so you can get access to the dev channels.

@CarlosFdez

Copy link
Copy Markdown
Contributor

Code looks fine to me but I'm too busy to test rn.

@WBHarry WBHarry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and checked. Is all good. Bringing in 👍

@WBHarry WBHarry merged commit a148aa3 into Foundryborne:main Jun 7, 2026
@TrezzeIohan TrezzeIohan deleted the feat/homebrew-settings-gold-734 branch June 10, 2026 02:16
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.

4 participants