From 3704b2ae96761417978da7488defaf0eb4fb569d Mon Sep 17 00:00:00 2001 From: p4535992 Date: Fri, 25 Nov 2022 21:14:53 +0100 Subject: [PATCH] version 0.6.15 --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/module.json | 6 +++--- src/scripts/lib/lib.ts | 2 +- src/scripts/module.ts | 13 ++++++------- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8c1099..073ce2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 0.6.15 + +- Bug fix reorder items on inventory + ### 0.6.14 - Bug fix: https://github.com/p4535992/foundryvtt-inventory-plus/issues/20 diff --git a/package-lock.json b/package-lock.json index c4db1a2..3d3816c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "inventory-plus", - "version": "0.6.7", + "version": "0.6.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "inventory-plus", - "version": "0.6.7", + "version": "0.6.14", "license": "SEE LICENSE IN LICENSE", "dependencies": { "build": "^0.1.4", diff --git a/package.json b/package.json index 52fe2e6..0a4bc38 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "inventory-plus", "title": "Inventory+", "description": "Enhances the default dnd5e sheets inventory to allow for reorganization", - "version": "0.6.14", + "version": "0.6.15", "main": "main.js", "scripts": { "publish": "gulp publish --update", diff --git a/src/module.json b/src/module.json index dff69f1..fbcf865 100644 --- a/src/module.json +++ b/src/module.json @@ -2,7 +2,7 @@ "id": "inventory-plus", "title": "Inventory+", "description": "Enhances the default dnd5e sheets inventory to allow for reorganization", - "version": "0.6.14", + "version": "0.6.15", "authors": [ { "name": "Felix#6196" @@ -82,8 +82,8 @@ "url": "https://github.com/p4535992/foundryvtt-inventory-plus", "manifest": "https://github.com/p4535992/foundryvtt-inventory-plus/releases/latest/download/module.json", "download": "https://github.com/p4535992/foundryvtt-inventory-plus/releases/latest/download/module.zip", - "readme": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.14/README.md", - "changelog": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.14/CHANGELOG.md", + "readme": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.15/README.md", + "changelog": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.15/CHANGELOG.md", "bugs": "https://github.com/p4535992/foundryvtt-inventory-plus/issues", "allowBugReporter": true, "relationships": { diff --git a/src/scripts/lib/lib.ts b/src/scripts/lib/lib.ts index 007d374..06c42c9 100644 --- a/src/scripts/lib/lib.ts +++ b/src/scripts/lib/lib.ts @@ -980,7 +980,7 @@ function _calcItemWeight(item: Item) { * @returns {Promise} * @private */ -export async function _isFromSameActor(actor, data) { +export async function _isFromSameActor(actor:Actor, data:Item) { //@ts-ignore const item = await Item.implementation.fromDropData(data); return actor.id === item.parent?.uuid || actor.uuid === item.parent?.uuid; diff --git a/src/scripts/module.ts b/src/scripts/module.ts index 7375491..4fc5ecf 100644 --- a/src/scripts/module.ts +++ b/src/scripts/module.ts @@ -112,7 +112,7 @@ export const readyHooks = async (): Promise => { const dragAndDropFromActorSource = itemCurrent.actorId ? true : false; */ const dragAndDropFromCompendium = itemCurrent?.uuid.includes("Compendium"); - const itemDropped = await retrieveItemFromData( + const itemDropped:Item = await retrieveItemFromData( actor, itemCurrent.uuid, itemCurrent.id, @@ -122,10 +122,11 @@ export const readyHooks = async (): Promise => { ); // const dragAndDropFromActorSource = itemDropped?.actorId === actor.id ? true : false; const dragAndDropFromActorSource = !(await _isFromSameActor(actor, itemDropped)); - const itemId = itemCurrent.id; + const itemId = itemDropped.id; let itemData: Item | null = null; - if (!itemCurrent) { + if (!itemDropped) { // Start Patch Party Inventory + //@ts-ignore if (itemDropped && itemDropped.type && itemDropped.id) { itemData = itemDropped; //@ts-ignore @@ -144,7 +145,7 @@ export const readyHooks = async (): Promise => { return; } } else { - itemData = itemCurrent; + itemData = itemDropped; } if (!itemData) { warn(i18n(`${CONSTANTS.MODULE_NAME}.dialogs.warn.itemdata`)); @@ -167,9 +168,7 @@ export const readyHooks = async (): Promise => { : //@ts-ignore undefined; - const sourceActor = sourceActorId - ? game.actors?.get(sourceActorId) - : undefined; + const sourceActor = sourceActorId ? game.actors?.get(sourceActorId) : undefined; let createdItem: Item | undefined = undefined;