Skip to content

Commit

Permalink
Use system.json to set default token attributes
Browse files Browse the repository at this point in the history
Closes #64.
  • Loading branch information
kmoschcau committed Nov 27, 2021
1 parent 091ff1f commit 3e3a5d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 0 additions & 9 deletions src/typescript/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit 3e3a5d2

Please sign in to comment.