From 896f317c6d03b9740cca0b7e88fbd191b8e599d9 Mon Sep 17 00:00:00 2001 From: psitacus Date: Thu, 10 Jul 2025 22:35:12 -0600 Subject: [PATCH] remove attachment only logic in favor of just transfer --- lang/en.json | 3 ++- .../sheets-configs/activeEffectConfig.mjs | 7 +++++++ module/documents/activeEffect.mjs | 14 -------------- templates/sheets/activeEffect/details.hbs | 9 +-------- 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/lang/en.json b/lang/en.json index dc70f625..1cf2150a 100755 --- a/lang/en.json +++ b/lang/en.json @@ -952,7 +952,8 @@ } }, "Attachments": { - "attachHint": "Drop items here to attach them" + "attachHint": "Drop items here to attach them", + "transferHint": "If checked, this effect will be applied to any actor that owns this Effect's parent Item. The effect is always applied if this Item is attached to another one." } }, "GENERAL": { diff --git a/module/applications/sheets-configs/activeEffectConfig.mjs b/module/applications/sheets-configs/activeEffectConfig.mjs index 6a629583..3f638b37 100644 --- a/module/applications/sheets-configs/activeEffectConfig.mjs +++ b/module/applications/sheets-configs/activeEffectConfig.mjs @@ -30,6 +30,13 @@ export default class DhActiveEffectConfig extends foundry.applications.sheets.Ac async _preparePartContext(partId, context) { const partContext = await super._preparePartContext(partId, context); switch (partId) { + case 'details': + // Add your custom checkbox field here + partContext.fields.yourCustomField = new foundry.data.fields.BooleanField({ + label: "DAGGERHEART.EFFECTS.YourCustomField.label", + hint: "DAGGERHEART.EFFECTS.YourCustomField.hint" + }); + break; case 'changes': const fieldPaths = []; const validFieldPath = fieldPath => this.validFieldPath(fieldPath, this.#unapplicablePaths); diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index 54bf6de6..09f831b8 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -6,12 +6,6 @@ export default class DhActiveEffect extends ActiveEffect { return false; } - // First check for attachment-only effects - these should ALWAYS be suppressed on the original item - // They only work through copied versions when attached - if (this.isAttachmentOnly) { - return true; - } - // Then apply the standard suppression rules if (['weapon', 'armor'].includes(this.parent?.type)) { return !this.parent.system.equipped; @@ -24,14 +18,6 @@ export default class DhActiveEffect extends ActiveEffect { return super.isSuppressed; } - /** - * Check if this effect is marked as attachment-only - * @returns {boolean} - */ - get isAttachmentOnly() { - return this.flags?.daggerheart?.attachmentOnly === true; - } - /** * Check if the parent item is currently attached to another item * @returns {boolean} diff --git a/templates/sheets/activeEffect/details.hbs b/templates/sheets/activeEffect/details.hbs index 0912302a..8a862c53 100644 --- a/templates/sheets/activeEffect/details.hbs +++ b/templates/sheets/activeEffect/details.hbs @@ -7,14 +7,7 @@ {{formGroup fields.origin value=source.origin rootId=rootId disabled=true}} {{/if}} {{#if isItemEffect}} - {{formGroup fields.transfer value=source.transfer rootId=rootId label=legacyTransfer.label hint=legacyTransfer.hint}} - - {{!-- Attachment-only flag for item effects TODO figure out how to do this with formGroups--}} -
- - -

{{localize "DAGGERHEART.Effect.AttachmentOnly.Hint"}}

-
+ {{formGroup fields.transfer value=source.transfer rootId=rootId label=legacyTransfer.label hint=(localize "DAGGERHEART.EFFECTS.Attachments.transferHint")}} {{/if}} {{formGroup fields.statuses value=source.statuses options=statuses rootId=rootId classes="statuses"}}