From 76c5dc2404d30be1b839c7230bcd1578e582c4cf Mon Sep 17 00:00:00 2001 From: psitacus Date: Wed, 9 Jul 2025 00:31:18 -0600 Subject: [PATCH] remove superfluous comments --- module/applications/sheets/items/armor.mjs | 8 -------- module/applications/sheets/items/weapon.mjs | 8 -------- 2 files changed, 16 deletions(-) diff --git a/module/applications/sheets/items/armor.mjs b/module/applications/sheets/items/armor.mjs index ca3d4c72..48ebfd9a 100644 --- a/module/applications/sheets/items/armor.mjs +++ b/module/applications/sheets/items/armor.mjs @@ -56,7 +56,6 @@ export default class ArmorSheet extends DHBaseItemSheet { context.features = this.document.system.features.map(x => x.value); break; case 'attachments': - // Prepare attached items for display const attachedUUIDs = this.document.system.attached || []; context.attachedItems = await Promise.all( attachedUUIDs.map(async uuid => { @@ -89,23 +88,18 @@ export default class ArmorSheet extends DHBaseItemSheet { async _onDrop(event) { const data = TextEditor.getDragEventData(event); - // Check if dropped on attachments section const attachmentsSection = event.target.closest('.attachments-section'); if (!attachmentsSection) return super._onDrop(event); - // Prevent event bubbling event.preventDefault(); event.stopPropagation(); - // Get the item being dropped const item = await Item.implementation.fromDropData(data); if (!item) return; - // Get current attached UUIDs const currentAttached = this.document.system.attached || []; const newUUID = item.uuid; - // Don't attach if already attached if (currentAttached.includes(newUUID)) { ui.notifications.warn(`${item.name} is already attached to this armor.`); return; @@ -155,12 +149,10 @@ export default class ArmorSheet extends DHBaseItemSheet { const uuid = target.dataset.uuid; const currentAttached = this.document.system.attached || []; - // Remove the attachment from the armor await this.document.update({ 'system.attached': currentAttached.filter(attachedUuid => attachedUuid !== uuid) }); - // Remove any effects on the actor that came from this attached item const actor = this.document.parent; if (actor) { const effectsToRemove = actor.effects.filter(effect => { diff --git a/module/applications/sheets/items/weapon.mjs b/module/applications/sheets/items/weapon.mjs index ece1d5f2..e7347f30 100644 --- a/module/applications/sheets/items/weapon.mjs +++ b/module/applications/sheets/items/weapon.mjs @@ -57,7 +57,6 @@ export default class WeaponSheet extends DHBaseItemSheet { context.systemFields.attack.fields = this.document.system.attack.schema.fields; break; case 'attachments': - // Prepare attached items for display const attachedUUIDs = this.document.system.attached || []; context.attachedItems = await Promise.all( attachedUUIDs.map(async uuid => { @@ -89,23 +88,18 @@ export default class WeaponSheet extends DHBaseItemSheet { async _onDrop(event) { const data = TextEditor.getDragEventData(event); - // Check if dropped on attachments section const attachmentsSection = event.target.closest('.attachments-section'); if (!attachmentsSection) return super._onDrop(event); - // Prevent event bubbling event.preventDefault(); event.stopPropagation(); - // Get the item being dropped const item = await Item.implementation.fromDropData(data); if (!item) return; - // Get current attached UUIDs const currentAttached = this.document.system.attached || []; const newUUID = item.uuid; - // Don't attach if already attached if (currentAttached.includes(newUUID)) { ui.notifications.warn(`${item.name} is already attached to this weapon.`); return; @@ -139,12 +133,10 @@ export default class WeaponSheet extends DHBaseItemSheet { const uuid = target.dataset.uuid; const currentAttached = this.document.system.attached || []; - // Remove the attachment from the weapon await this.document.update({ 'system.attached': currentAttached.filter(attachedUuid => attachedUuid !== uuid) }); - // Remove any effects on the actor that came from this attached item await removeAttachmentEffectsFromActor({ parentItem: this.document, attachedUuid: uuid,