Improve upon Setting document cast and onChange behavior to ensure that each Setting document is cast to its configured data type as part of the initialization workflow. This allows the cast value to be always past to onChange handler instead of the raw string. #8908
Labels
Milestone
What happened?
I have a 3-choice setting that logically is handled as a Number, but uses the
choices
value instead of a range to make it easier on the user to see what choice entails.Example:
When the value is changed, the
value
is sent as a String, but when callinggame.settings.get("MyModuleName", "settingName")
, it returns a Number as expected.Due to this, if it is set to 0, the variable is set to "0" instead and breaks logic like
if (game.MyModuleName.settingName)
.game.MyModuleName.settingName is setup to avoid making multiple
game.settings.get
calls during play for a setting that won't be changed often.What ways of accessing Foundry can you encounter this issue in?
Reproduction Steps
game.MyModuleName.settingName
.What core version are you reporting this for?
V11P1
Relevant log output
No response
Bug Checklist
The text was updated successfully, but these errors were encountered: