This commit is contained in:
2024-03-29 14:11:26 +01:00
7 changed files with 85 additions and 3 deletions
+30
View File
@@ -193,6 +193,36 @@ export default class M5CharacterSheet extends ActorSheet {
});
});
html.find(".pp-increase").on("click", async (event) => {
let target = event.target.closest("[data-pp-name]") as HTMLElement;
let ppName = target ? target.dataset.ppName : null;
const context = this.actor as any;
const item = context.items.find((x) => x.type === "class" && x.system.equipped);
item.update({
system: {
lernKostenZauber: {
[ppName]: { pp: context.system.lernKostenZauber[ppName].pp + 1 },
},
},
});
this.render();
});
html.find(".pp-decrease").on("click", async (event) => {
let target = event.target.closest("[data-pp-name]") as HTMLElement;
let ppName = target ? target.dataset.ppName : null;
const context = this.actor as any;
const item = context.items.find((x) => x.type === "class" && x.system.equipped);
item.update({
system: {
lernKostenZauber: {
[ppName]: { pp: context.system.lernKostenZauber[ppName].pp - 1 },
},
},
});
this.render();
});
html.find(".fw-increase").on("click", async (event) => {
let target = event.target.closest("[data-item-id]") as HTMLElement;
let itemId = target ? target.dataset.itemId : null;