Skip to content

Commit

Permalink
fix hud for npcs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcomac committed May 31, 2024
1 parent ed5e7b5 commit 00fb96f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
*.lock
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"type": "module",
"scripts": {
"build": "rollup -c",
"dev": "rollup -wcm"
"build": "rollup -c",
"dev": "rollup -wcm"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.3",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.3",
"@yaireo/dragsort": "^1.3.1",
"@yaireo/tagify": "^4.17.8",
"eslint": "^8.25.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.3.0",
"eslint-plugin-promise": "^6.1.0",
"rollup": "^3.26.3"
"@rollup/plugin-commonjs": "^25.0.3",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.3",
"@yaireo/dragsort": "^1.3.1",
"@yaireo/tagify": "^4.17.8",
"eslint": "^8.25.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.3.0",
"eslint-plugin-promise": "^6.1.0",
"rollup": "^3.29.4"
}
}
}
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default [
plugins: [
terser({ keep_classnames: true, keep_fnames: true })
],
sourcemap: true
sourcemap: true
}
}
]
5 changes: 4 additions & 1 deletion scripts/action-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
this.actors = (!this.actor) ? this.#getActors() : [this.actor]
this.tokens = (!this.token) ? this.#getTokens() : [this.token]
this.actorType = this.actor?.type

this.#buildCharacterActions()
}
/**
Expand All @@ -21,7 +22,9 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @returns {object}
*/
async #buildCharacterActions() {
this.#buildAttributes('attribute', 'attributes')
if (this.actorType === 'character') {
this.#buildAttributes('attribute', 'attributes')
}
this.#buildSaves('save', 'saves')
this.#buildAbilities('ability', 'abilities')
this.#buildSpells()
Expand Down

0 comments on commit 00fb96f

Please sign in to comment.