Händisches increse & decrease von Zauber PP
This commit is contained in:
parent
80bad6a678
commit
16b15fbd3e
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
<th class="title">{{localize "midgard5.spell-effectDuration-short"}}</th>
|
||||
<th class="title">{{localize "midgard5.ew"}}</th>
|
||||
<th class="title"><img src="/systems/midgard5/assets/icons/icon/battle-gear.svg" class="table-icon"></th>
|
||||
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"><img src="/icons/svg/d20.svg" class="table-icon"></th></th>
|
||||
<th class="title"><img src="/icons/svg/d20.svg" class="table-icon"></th>
|
||||
<td><a class="title add-spell"><i class="fa-regular fa-plus"></i></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -87,9 +87,13 @@
|
|||
<div class="flexrow">
|
||||
|
||||
{{#each data.lernKostenZauber as |group name|}}
|
||||
<span style="margin: 0 2rem; flex: 1 0 16%; display: flex; flex-direction: row; justify-content: space-between; align-items: baseline;">
|
||||
<span data-pp-name="{{name}}" class="pp-listing">
|
||||
<label for="data.lernKostenZauber.{{name}}">{{localize (m5concat "midgard5.spell-process-" name)}}</label>
|
||||
<input style="width:15px" disabled="true" type="number" value={{group.pp}} data-dtype="Number" />
|
||||
<span >
|
||||
<i class="fa fa-minus-circle pp-decrease" style="cursor: pointer"></i>
|
||||
<input style="width:15px" type="number" value={{group.pp}} data-dtype="Number" />
|
||||
<i class="fa fa-plus-circle pp-increase" style="cursor: pointer"></i>
|
||||
</span>
|
||||
</span>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue