From 3e3a5d22796eeb06ecd0a5bed9fa40f27bef9f00 Mon Sep 17 00:00:00 2001 From: Kai Moschcau Date: Sat, 27 Nov 2021 15:12:49 +0100 Subject: [PATCH] Use system.json to set default token attributes Closes #64. --- src/system.json | 2 ++ src/typescript/config.ts | 9 --------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/system.json b/src/system.json index 39bdab47..e4a56285 100644 --- a/src/system.json +++ b/src/system.json @@ -43,6 +43,8 @@ ], "socket": false, "initiative": "1d10 + (@specials.perception)", + "primaryTokenAttribute": "vitals.hitPoints", + "secondaryTokenAttribute": "vitals.actionPoints", "gridDistance": 2, "gridUnits": "m", "url": "https://github.com/Wasteland-Ventures-Group/WV-VTT-module", diff --git a/src/typescript/config.ts b/src/typescript/config.ts index 92664c9b..771b022f 100644 --- a/src/typescript/config.ts +++ b/src/typescript/config.ts @@ -60,18 +60,9 @@ function configureDefaultResources(): void { const settings = getGame().settings; if (!settings.get(CONSTANTS.systemId, initializedSettingName)) { configureCombatResource(); - configureDefaultTokenBars(); } } -/** Configure the default prototype token resource bars. */ -function configureDefaultTokenBars(): void { - const setting = getGame().settings.get("core", "defaultToken"); - setting.bar1 = { attribute: "vitals.hitPoints" }; - setting.bar2 = { attribute: "vitals.actionPoints" }; - getGame().settings.set("core", "defaultToken", setting); -} - /** Configure the default combat resource setting. */ function configureCombatResource(): void { getGame().settings.set("core", Combat.CONFIG_SETTING, {