Skip to content

Commit

Permalink
#63, Update verified versions
Browse files Browse the repository at this point in the history
- #63: Add modifiers to ability, check and saving throw actions.
  • Loading branch information
Larkinabout committed Aug 9, 2023
1 parent 140b69d commit 62f5d14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"version": "This is auto replaced",
"compatibility": {
"minimum": "10",
"verified": "11.306"
"verified": "11.307"
},
"esmodules": [
"./scripts/token-action-hud-dnd5e.min.js"
Expand Down Expand Up @@ -90,7 +90,7 @@
"compatibility": [
{
"minimum": "2.1.0",
"verified": "2.2.2"
"verified": "2.2.3"
}
]
}
Expand All @@ -103,7 +103,7 @@
{
"minimum": "1.4.8",
"maximum": "1.4",
"verified": "1.4.16"
"verified": "1.4.18"
}
]
}
Expand Down
10 changes: 7 additions & 3 deletions scripts/action-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,8 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
// Get actions
const actions = Object.entries(abilities)
.filter((ability) => abilities[ability[0]].value !== 0)
.map((ability) => {
const abilityId = ability[0]
const id = `${actionType}-${ability[0]}`
.map(([abilityId, ability]) => {
const id = `${actionType}-${abilityId}`
const abbreviatedName = abilityId.charAt(0).toUpperCase() + abilityId.slice(1)
const label = this.systemVersion >= '2.2' ? game.dnd5e.config.abilities[abilityId].label : game.dnd5e.config.abilities[abilityId]
const name = this.abbreviateSkills ? abbreviatedName : label
Expand All @@ -228,11 +227,16 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
const listName = `${actionTypeName}${label}`
const encodedValue = [actionType, abilityId].join(this.delimiter)
const icon1 = (groupId !== 'checks') ? this.#getProficiencyIcon(abilities[abilityId].proficient) : ''
const mod = (groupId !== 'saves') ? ability?.mod : ((groupId === 'saves') ? ability?.save : '')
const info1 = (this.actor) ? { text: coreModule.api.Utils.getModifier(mod) } : null
const info2 = (this.actor && groupId === 'abilities') ? { text: `(${coreModule.api.Utils.getModifier(ability?.save)})` } : null
return {
id,
name,
encodedValue,
icon1,
info1,
info2,
listName
}
})
Expand Down

0 comments on commit 62f5d14

Please sign in to comment.