diff --git a/source/module/sheets/M5CharacterSheet.ts b/source/module/sheets/M5CharacterSheet.ts index 8690943..2990225 100644 --- a/source/module/sheets/M5CharacterSheet.ts +++ b/source/module/sheets/M5CharacterSheet.ts @@ -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", diff --git a/source/style/Character-sheet.less b/source/style/Character-sheet.less index 273651d..00f2432 100644 --- a/source/style/Character-sheet.less +++ b/source/style/Character-sheet.less @@ -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 { diff --git a/templates/sheets/character/gear.hbs b/templates/sheets/character/gear.hbs index 349913f..a0b38d2 100644 --- a/templates/sheets/character/gear.hbs +++ b/templates/sheets/character/gear.hbs @@ -34,7 +34,7 @@
{{localize "midgard5.gear"}} - (alle ) + (alle )
@@ -42,7 +42,7 @@ - + @@ -66,13 +66,15 @@ {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} {{/unless}} - - - + + {{/if}} {{/each}} @@ -107,13 +109,15 @@ {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} {{/unless}} - - - + + {{/each}} @@ -152,13 +156,15 @@ {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} {{/unless}} - - - + + {{/if}} {{/each}}
{{localize "TYPES.Item.item"}} {{localize "midgard5.item-quantity"}} {{localize "midgard5.item-value"}}  
+ {{#if item.equipped}} - + + {{else}} + {{/if}} {{#if item.rollExist}}{{/if}}{{#if item.rollExist}}{{/if}}
+ {{#if item.equipped}} - + + {{else}} + {{/if}} {{#if item.rollExist}}{{/if}}{{#if item.rollExist}}{{/if}}
+ {{#if item.equipped}} - + + {{else}} + {{/if}} {{#if item.rollExist}}{{/if}}{{#if item.rollExist}}{{/if}}