From 2e301f1bb98433979f43ea6be2a8e43f3eada5d4 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Tue, 12 Aug 2025 20:42:15 +0200 Subject: [PATCH] Hid item attachments for now (#876) --- .../sheets/api/item-attachment-sheet.mjs | 2 +- module/data/item/weapon.mjs | 21 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/module/applications/sheets/api/item-attachment-sheet.mjs b/module/applications/sheets/api/item-attachment-sheet.mjs index e9c3994c..73c39923 100644 --- a/module/applications/sheets/api/item-attachment-sheet.mjs +++ b/module/applications/sheets/api/item-attachment-sheet.mjs @@ -24,7 +24,7 @@ export default function ItemAttachmentSheet(Base) { ...super.TABS, primary: { ...super.TABS?.primary, - tabs: [...(super.TABS?.primary?.tabs || []), { id: 'attachments' }], + tabs: [...(super.TABS?.primary?.tabs || []) /*{ id: 'attachments' }*/], // Disabled until fixed initial: super.TABS?.primary?.initial || 'description', labelPrefix: super.TABS?.primary?.labelPrefix || 'DAGGERHEART.GENERAL.Tabs' } diff --git a/module/data/item/weapon.mjs b/module/data/item/weapon.mjs index 0cba35b8..66025cc5 100644 --- a/module/data/item/weapon.mjs +++ b/module/data/item/weapon.mjs @@ -1,5 +1,5 @@ import AttachableItem from './attachableItem.mjs'; -import { ActionsField, ActionField } from '../fields/actionField.mjs'; +import { ActionField } from '../fields/actionField.mjs'; export default class DHWeapon extends AttachableItem { /** @inheritDoc */ @@ -18,12 +18,23 @@ export default class DHWeapon extends AttachableItem { const fields = foundry.data.fields; return { ...super.defineSchema(), - tier: new fields.NumberField({ required: true, integer: true, initial: 1, min: 1, label: "DAGGERHEART.GENERAL.Tiers.singular" }), + tier: new fields.NumberField({ + required: true, + integer: true, + initial: 1, + min: 1, + label: 'DAGGERHEART.GENERAL.Tiers.singular' + }), equipped: new fields.BooleanField({ initial: false }), //SETTINGS - secondary: new fields.BooleanField({ initial: false, label: "DAGGERHEART.ITEMS.Weapon.secondaryWeapon" }), - burden: new fields.StringField({ required: true, choices: CONFIG.DH.GENERAL.burden, initial: 'oneHanded', label: "DAGGERHEART.GENERAL.burden" }), + secondary: new fields.BooleanField({ initial: false, label: 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon' }), + burden: new fields.StringField({ + required: true, + choices: CONFIG.DH.GENERAL.burden, + initial: 'oneHanded', + label: 'DAGGERHEART.GENERAL.burden' + }), weaponFeatures: new fields.ArrayField( new fields.SchemaField({ value: new fields.StringField({ @@ -212,7 +223,7 @@ export default class DHWeapon extends AttachableItem { const labels = []; const { roll, range, damage } = this.attack; - if (roll.trait) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Traits.${roll.trait}.short`)) + if (roll.trait) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Traits.${roll.trait}.short`)); if (range) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Range.${range}.short`)); for (const { value, type } of damage.parts) {