Skip to content

Commit

Permalink
Support dnd5e 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkinabout committed Feb 1, 2024
1 parent bebaa6e commit 50042b0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
9 changes: 5 additions & 4 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.313"
"verified": "11.315"
},
"esmodules": [
"./scripts/token-action-hud-dnd5e.min.js"
Expand Down Expand Up @@ -89,8 +89,9 @@
"type": "system",
"compatibility": [
{
"minimum": "2.1.0",
"verified": "2.3.1"
"minimum": "3.0.0",
"maximum": "3",
"verified": "3.0.0"
}
]
}
Expand All @@ -103,7 +104,7 @@
{
"minimum": "1.5.0",
"maximum": "1.5",
"verified": "1.5.0"
"verified": "1.5.3"
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions scripts/action-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
inventoryMap.get('consumables').set(key, value)
}
if (isEquippedItem) {
if (type === 'backpack') {
if (type === 'container') {
if (!inventoryMap.has('containers')) inventoryMap.set('containers', new Map())
inventoryMap.get('containers').set(key, value)
}
Expand Down Expand Up @@ -1277,7 +1277,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @param {object} spell
*/
#getSpellInfo (spell) {
const components = spell.system.components
const components = spell.system.properties

const componentsArray = []
const info1 = {}
Expand Down Expand Up @@ -1481,8 +1481,8 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
const modifiers = entity?.modifiers ?? null
const properties = [
...entity.system?.chatProperties ?? [],
...entity.system?.equippableItemChatProperties ?? [],
...entity.system?.activatedEffectChatProperties ?? []
...entity.system?.equippableItemCardProperties ?? [],
...entity.system?.activatedEffectCardProperties ?? []
].filter(p => p)
const rarity = entity?.rarity ?? null
const traits = (entity?.type === 'weapon') ? this.#getWeaponProperties(entity?.system?.properties) : null
Expand Down
11 changes: 2 additions & 9 deletions scripts/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,8 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
name: coreModule.api.Utils.i18n('DND5E.Effects'),
groups: [
{ ...groups.temporaryEffects, nestId: 'effects_temporary-effects' },
{ ...groups.passiveEffects, nestId: 'effects_passive-effects' }
]
},
{
nestId: 'conditions',
id: 'conditions',
name: coreModule.api.Utils.i18n('tokenActionHud.dnd5e.conditions'),
groups: [
{ ...groups.conditions, nestId: 'conditions_conditions' }
{ ...groups.passiveEffects, nestId: 'effects_passive-effects' },
{ ...groups.conditions, nestId: 'effects_conditions' }
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions scripts/roll-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @param {string} encodedValue
*/
async handleActionClick (event, encodedValue) {
const [actionType, actionId ] = encodedValue.split('|')
const [actionType, actionId] = encodedValue.split('|')

if (!this.actor) {
for (const token of coreModule.api.Utils.getControlledTokens()) {
Expand Down Expand Up @@ -58,7 +58,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
case 'item':
case 'spell':
case 'weapon':
if (this.isRenderItem()) this.doRenderItem(actor, actionId)
if (this.isRenderItem()) this.renderItem(actor, actionId)
else this.#useItem(event, actor, actionId)
break
case 'magicItem':
Expand Down
2 changes: 1 addition & 1 deletion scripts/token-action-hud-dnd5e.min.js

Large diffs are not rendered by default.

0 comments on commit 50042b0

Please sign in to comment.