Skip to content

Commit

Permalink
Merge pull request #148 from Silvertower/main
Browse files Browse the repository at this point in the history
Foundry v12 support.
  • Loading branch information
Silvertower authored Jun 10, 2024
2 parents cc2e0b5 + b7583c5 commit 9d924a0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
15 changes: 9 additions & 6 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
},
{
"name": "^ and stick"
},
{
"name": "Silvertower"
}
],
"url": "This is auto replaced",
"flags": {},
"version": "This is auto replaced",
"compatibility": {
"minimum": "10",
"verified": "11.315"
"minimum": "12",
"verified": "12.327"
},
"esmodules": [
"./scripts/token-action-hud-pf2e.min.js"
Expand Down Expand Up @@ -94,8 +97,8 @@
"type": "system",
"compatibility": [
{
"minimum": "5.15.0",
"verified": "5.15.0"
"minimum": "6.0.0",
"verified": "6.0.1"
}
]
}
Expand All @@ -106,9 +109,9 @@
"type": "module",
"compatibility": [
{
"minimum": "1.5.0",
"minimum": "1.5.5",
"maximum": "1.5",
"verified": "1.5.4"
"verified": "1.5.5"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CORE_MODULE = {
/**
* Core module version required by the system module
*/
export const REQUIRED_CORE_MODULE_VERSION = '1.5'
export const REQUIRED_CORE_MODULE_VERSION = '1.5.5'

/**
* Damage type icons
Expand Down
5 changes: 4 additions & 1 deletion scripts/roll-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,19 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
let value = actor.system.resources[resource][valueName]

if (this.rightClick) {
console.log("rightClick")
if (value > 0) {
value--
}
} else {
console.log("other")
if (value < actor.system.resources[resource].max) {
value++
}
}

await Actor.updateDocuments([{ _id: actor.id, data: { resources: { [resource]: { [valueName]: value } } } }])
await actor.update({ "system.resources.heroPoints.value": value });
// await Actor.updateDocuments([{ _id: actor.id, data: { resources: { [resource]: { [valueName]: value } } } }])

Hooks.callAll('forceUpdateTokenActionHud')
}
Expand Down

0 comments on commit 9d924a0

Please sign in to comment.