diff --git a/system/scripts/actors/base-character-sheet.js b/system/scripts/actors/base-character-sheet.js index c7ba925..b622af9 100644 --- a/system/scripts/actors/base-character-sheet.js +++ b/system/scripts/actors/base-character-sheet.js @@ -268,6 +268,30 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e { return this.actor.createEmbeddedDocuments("Item", [itemData]); } + /** @inheritdoc */ + _onDragStart(event) { + // Patch Owned Items + const li = event.currentTarget; + if (li.dataset.itemParentId && li.dataset.itemId) { + const item = this.actor.items.get(li.dataset.itemParentId)?.items.get(li.dataset.itemId); + if (item) { + const dragData = { + actorId: this.actor.id, + sceneId: this.actor.isToken ? canvas.scene?.id : null, + tokenId: this.actor.isToken ? this.actor.token.id : null, + pack: this.actor.pack, + type: "Item", + data: foundry.utils.duplicate(item.data), + }; + dragData.data.data.parent_id = null; + event.dataTransfer.setData("text/plain", JSON.stringify(dragData)); + return; + } + } + // Else regular + super._onDragStart(event); + } + /** * Subscribe to events from the sheet. * @param {jQuery} html HTML content of the sheet. diff --git a/system/templates/items/technique/technique-entry.html b/system/templates/items/technique/technique-entry.html index 4128890..a67192e 100644 --- a/system/templates/items/technique/technique-entry.html +++ b/system/templates/items/technique/technique-entry.html @@ -1,4 +1,4 @@ -