- Changed equipped icons and made them clickable

This commit is contained in:
Ender
2024-01-08 20:42:11 +01:00
parent 2a36b8eaa1
commit 5be10276ca
3 changed files with 50 additions and 17 deletions
+22
View File
@@ -246,6 +246,28 @@ export default class M5CharacterSheet extends ActorSheet {
const roll = M5Roll.resistanceBody(this.actor);
await roll.toMessage();
});
html.find(".change-equipped").on("click", async (event) => {
let row = event.target.parentElement;
let itemId = row.dataset["item"];
while (!itemId) {
row = row.parentElement;
if (!row) return;
itemId = row.dataset["item"];
}
const context = this.actor as any;
const item = context.items.get(itemId);
if (item.system.equipped === true) {
item.system.equipped = false;
}
else {
item.system.equipped = true;
}
this.render();
});
// Drag & Drop
const dragDrop = new DragDrop({
dragSelector: ".items-list .item",
+8 -3
View File
@@ -188,6 +188,11 @@
width: 5rem;
}
input.checkbox {
width: 1rem;
height: 1rem;
}
.new-skill {
font-style: italic;
background: rgba(0, 0, 0, 0.3);
@@ -200,10 +205,10 @@
button.roll-button {
background: url(/icons/svg/d20-black.svg) no-repeat;
background-size: 24px 24px;
background-size: 1rem 1rem;
border: #000000 solid 0px;
width: 26px;
height: 26px;
width: 1rem;
height: 1rem;
}
span.spell-process {