Händisches increse & decrease von Zauber PP
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user