Adds status bars to character sheet

This commit is contained in:
mstein
2022-07-24 13:30:37 +02:00
parent b3e2771e91
commit 53216fbbb7
4 changed files with 103 additions and 8 deletions
+24
View File
@@ -45,6 +45,30 @@ export default class M5CharacterSheet extends ActorSheet {
override activateListeners(html: JQuery) {
super.activateListeners(html)
html.find(".update-lp").on("click", async (event) => {
const valueStr = event.target.dataset["value"]
const value = parseInt(valueStr)
this.actor.update({
data: {
lp: {
value: value + 1
}
}
})
})
html.find(".update-ap").on("click", async (event) => {
const valueStr = event.target.dataset["value"]
const value = parseInt(valueStr)
this.actor.update({
data: {
ap: {
value: value + 1
}
}
})
})
html.find(".roll-attribute-button").on("click", async (event) => {
const attributeStr = event.target.dataset["attribute"]
const roll = M5Roll.fromAttribute(this.actor, attributeStr)