diff --git a/module/actors/actor-sheet.js b/module/actors/actor-sheet.js index ca55af7..a7667a3 100644 --- a/module/actors/actor-sheet.js +++ b/module/actors/actor-sheet.js @@ -243,23 +243,8 @@ export class ActorSheetKH extends ActorSheet { // Delete Inventory Item html.find(".item-delete").click((ev) => { - const li = $(ev.currentTarget).parents(".item"); - - this.actor.deleteOwnedItem(li.data("itemId")); - - li.slideUp(200, () => this.render(false)); - }); - - html.find(".item-attack-delete").click((ev) => { - const li = $(ev.currentTarget).parents(".item-attack"); - - this.actor.deleteOwnedItem(li.data("itemId")); - - li.slideUp(200, () => this.render(false)); - }); - - html.find(".item-weapon-delete").click((ev) => { - const li = $(ev.currentTarget).parents(".item-weapon"); + let parent = $(ev.currentTarget).data("parent") + const li = $(ev.currentTarget).parents(parent); this.actor.deleteOwnedItem(li.data("itemId")); @@ -268,43 +253,8 @@ export class ActorSheetKH extends ActorSheet { // Edit Inventory Item html.find(".item-edit").click(async (ev) => { - let li = $(ev.currentTarget).parents(".item"); - let itemId = li.data("itemId"); - let item = this.actor.getOwnedItem(itemId); - - if (!item) { - item = game.items.get(itemId); - - if (!item) { - console.log("IMPORT ERROR") - } - } - - if (item?.sheet) { - item.sheet.render(true); - } - }); - - html.find(".item-attack-edit").click(async (ev) => { - let li = $(ev.currentTarget).parents(".item-attack"); - let itemId = li.data("itemId"); - let item = this.actor.getOwnedItem(itemId); - - if (!item) { - item = game.items.get(itemId); - - if (!item) { - console.log("IMPORT ERROR") - } - } - - if (item?.sheet) { - item.sheet.render(true); - } - }); - - html.find(".item-weapon-edit").click(async (ev) => { - let li = $(ev.currentTarget).parents(".item-weapon"); + let parent = $(ev.currentTarget).data("parent") + let li = $(ev.currentTarget).parents(parent); let itemId = li.data("itemId"); let item = this.actor.getOwnedItem(itemId); @@ -457,6 +407,7 @@ export class ActorSheetKH extends ActorSheet { /* Toggle item equipped */ html.find(".items .item a.toggle-equipped").click(this._toggleEquippedItem.bind(this)); + html.find(".items .item-weapon a.toggle-equipped").click(this._toggleEquippedItem.bind(this)); /* Handle increase of items in inventory */ html.find(".item-quantity .quantity.increase").click(this._increaseQuantity.bind((this))); @@ -643,7 +594,7 @@ export class ActorSheetKH extends ActorSheet { const item = this.actor.getOwnedItem(li.data("itemId")); const actor = this.actor; - if (item) { + if(item) { if(item.type === "armor") { let initValue = -1 diff --git a/styles/items.css b/styles/items.css index a08d39f..6d46ffe 100644 --- a/styles/items.css +++ b/styles/items.css @@ -111,10 +111,12 @@ text-align: center; } -.items .items-list .item .toggle-equipped { +.items .items-list .item .toggle-equipped, +.items .items-list .item-weapon .toggle-equipped { color: #888; } -.items .items-list .item .toggle-equipped.active { +.items .items-list .item .toggle-equipped.active, +.items .items-list .item-weapon .toggle-equipped.active{ color: #191813; -} \ No newline at end of file +} diff --git a/templates/parts/actor/combat.html b/templates/parts/actor/combat.html index 404ca17..2ecaa7b 100644 --- a/templates/parts/actor/combat.html +++ b/templates/parts/actor/combat.html @@ -65,8 +65,8 @@
- - + +
{{/each}} diff --git a/templates/parts/actor/gear.html b/templates/parts/actor/gear.html index 44e2460..4128fc1 100644 --- a/templates/parts/actor/gear.html +++ b/templates/parts/actor/gear.html @@ -40,8 +40,8 @@
- - + +
{{/each}} @@ -79,8 +79,8 @@ {{/if}}
- - + +
{{/each}} @@ -105,8 +105,8 @@
- - + +
{{/each}} diff --git a/templates/parts/actor/ht-combat.html b/templates/parts/actor/ht-combat.html index 7c6ce32..3630dc5 100644 --- a/templates/parts/actor/ht-combat.html +++ b/templates/parts/actor/ht-combat.html @@ -57,8 +57,8 @@
- - + +
{{/each}} diff --git a/templates/parts/actor/talent.html b/templates/parts/actor/talent.html index 779c9b5..4f75767 100644 --- a/templates/parts/actor/talent.html +++ b/templates/parts/actor/talent.html @@ -9,8 +9,8 @@
  • {{talent.name}}
    - - + +
  • {{/each}} @@ -30,8 +30,8 @@
    {{spell.data.cost.value}}
    {{rollDifficulty spell.data.difficulty.value}}
    - - + +
    {{/each}}