Giving a system "Per World" options
I'd like to plan ahead for others using my system and want to offer:
☐ Imperial or ☑ Metric
... when starting up a new world. How would I set that up?
6 Replies
Best way is maybe registering a hidden world setting, wich you check on world startup, if the setting is not set you open a dialog prompting it
you should use a default value in case the dms close the dialog without configuring it
Put
scope: "world"
in the game.settings.register
call's options.
For example: https://github.com/Eranziel/foundryvtt-lancer/blob/master/src/module/settings.ts#L15GitHub
foundryvtt-lancer/src/module/settings.ts at master · Eranziel/found...
A Foundry VTT game system for LANCER RPG. . Contribute to Eranziel/foundryvtt-lancer development by creating an account on GitHub.
There's options to make it a hidden setting or visible in the settings menu too, so pick whichever you need.
And yeah, agreed with Magus. Make a dialog that pops up for GMs if the setting hasn't been set yet. You could make the default to be a third value so that you can tell if it hasn't been set yet.
Imperial, Metric & IDC-Metric, eh? 😉
Yeah, if you want to default metric
If you want to force the GM to actually pick one, you could use
undefined
or ""
as the default value and keep popping up the dialog until they pick one. 😆Could prevent closing the dialog too, until choice is made.