Add data validation and a world setting for enabling the Global API

This commit is contained in:
Oliver-Akins 2025-05-25 02:00:13 -06:00
parent c3d632274a
commit 354b22da57
7 changed files with 180 additions and 56 deletions

View file

@ -1,18 +1,26 @@
/*
World Settings:
- Track rolls automatically
- Track inactive rolls (e.g. the "lower" in a "kh" roll)
- Track self rolls (defaulta false)
*/
export function registerWorldSettings() {
game.settings.register(__ID__, `autoTrackRolls`, {
name: `Roll Auto-Tracking`,
hint: `Whether or not the module should automatically add rolls made in the chat to the database. This is useful if the system you're using has implemented an integration with the module, or if you only want macros to handle the database additions.`,
name: `STAT_TRACKER.settings.autoTrackRolls.name`,
hint: `STAT_TRACKER.settings.autoTrackRolls.hint`,
scope: `world`,
type: Boolean,
config: true,
default: true,
requiresReload: true,
});
game.settings.register(__ID__, `globalAPI`, {
name: `STAT_TRACKER.settings.globalAPI.name`,
hint: `STAT_TRACKER.settings.globalAPI.hint`,
scope: `world`,
type: Boolean,
config: true,
default: import.meta.env.DEV,
requiresReload: true,
});
};