Händisches increse & decrease von Zauber PP

This commit is contained in:
2024-03-29 12:08:59 +01:00
parent 80bad6a678
commit 16b15fbd3e
3 changed files with 46 additions and 3 deletions
+30
View File
@@ -194,6 +194,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;
+9
View File
@@ -388,4 +388,13 @@
.closebtn:hover {
color: #000;
}
.pp-listing {
margin: 0 2rem;
flex: 1 0 16%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: baseline;
}
}