From 89d427b7114a2e25bfc97651d7ad354b24902e1d Mon Sep 17 00:00:00 2001 From: macniel Date: Mon, 20 Oct 2025 19:43:43 +0200 Subject: [PATCH] fixes kinks in equipping weapons --- src/module/sheets/character/equipment.mjs | 9 +++++---- src/module/sheets/characterSheet.mjs | 8 ++++---- src/style/organisms/character-tabs/_inventory.scss | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/module/sheets/character/equipment.mjs b/src/module/sheets/character/equipment.mjs index 9e474974..8ae6d0db 100644 --- a/src/module/sheets/character/equipment.mjs +++ b/src/module/sheets/character/equipment.mjs @@ -174,13 +174,14 @@ export default { const {itemId} = target.dataset const item = thisObject.document.items.get(itemId) console.log(item.system.category) - return !thisObject.document.isWorn(itemId) + return !thisObject.document.isWorn(itemId) && item.system.category.indexOf("Munition") != -1 } }, { name: "Ausrüsten", callback: (target) => { - //thisObject.deleteEmbeddedDocuments('Item', [event.dataset.id]) + const updateObject = thisObject.document.getEquipmentSetUpdateObject() + }, condition: (target) => { const {itemId} = target.dataset @@ -231,11 +232,11 @@ export default { name: "Aus dem Inventar entfernen", icon: '', callback: (target) => { - thisObject.deleteEmbeddedDocuments('Item', [target.dataset.id]) + thisObject.document.deleteEmbeddedDocuments('Item', [target.dataset.itemId]) }, condition: (target) => { const {itemId} = target.dataset - !thisObject.document.isWorn(itemId) + return !thisObject.document.isWorn(itemId) } } ], {jQuery: false}); diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index d39318cc..1075b200 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -248,9 +248,9 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { name: obj.name, using: links.name, atroll: `1d20cs<${this.document.system.at.links.aktuell + obj.system.at + links.system.attackModifier}`, // TODO consider adding W/M - at: `${object.system.at.links.aktuell + obj.system.at + links.system.attackModifier}`, + at: `${this.document.system.at.links.aktuell + obj.system.at + links.system.attackModifier}`, paroll: `1d20cs<${this.document.system.pa.links.aktuell + obj.system.pa + links.system.parryModifier}`, // TODO consider adding W/M - pa: `${object.system.pa.links.aktuell + obj.system.pa + links.system.parryModifier}`, + pa: `${this.document.system.pa.links.aktuell + obj.system.pa + links.system.parryModifier}`, tproll: `${links.system.meleeAttackDamage}`, // TODO consider adding TP/KK mod tp: `${links.system.meleeAttackDamage}`, iniroll: `(${context.inidice})d6 + ${context.inivalue + links.system.iniModifier ?? 0}`, @@ -272,9 +272,9 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { name: obj.name, using: rechts.name, atroll: `1d20cs<${this.document.system.at.rechts.aktuell + obj.system.at + rechts.system.attackModifier}`, // TODO consider adding W/M - at: `${object.system.at.rechts.aktuell + obj.system.at + rechts.system.attackModifier}`, + at: `${this.document.system.at.rechts.aktuell + obj.system.at + rechts.system.attackModifier}`, paroll: `1d20cs<${this.document.system.pa.rechts.aktuell + obj.system.pa + rechts.system.parryModifier}`, // TODO consider adding W/M - pa: `${object.system.pa.rechts.aktuell + obj.system.pa + rechts.system.parryModifier}`, + pa: `${this.document.system.pa.rechts.aktuell + obj.system.pa + rechts.system.parryModifier}`, tproll: `${rechts.system.meleeAttackDamage}`, // TODO consider adding TP/KK mod tp: `${rechts.system.meleeAttackDamage}`, iniroll: `(${context.inidice})d6 + ${context.inivalue + rechts.system.iniModifier ?? 0}`, diff --git a/src/style/organisms/character-tabs/_inventory.scss b/src/style/organisms/character-tabs/_inventory.scss index de57c16e..62d8f8c2 100644 --- a/src/style/organisms/character-tabs/_inventory.scss +++ b/src/style/organisms/character-tabs/_inventory.scss @@ -34,6 +34,20 @@ .inventory { grid-area: inventory; + display: flex; + flex-direction: column; + + h3 { + flex: 0; + } + + .inventory-table { + flex: 1; + + .equipment { + height: 32px; + } + } .equipment:hover { .item-name {