From 221d9b8ea915115279ec1ce40ec0fc63b4679da7 Mon Sep 17 00:00:00 2001 From: Derek Fredrickson Date: Fri, 26 May 2023 14:10:47 -0400 Subject: [PATCH] Add compatibility for v11 --- module.json | 6 +++--- scripts/droppable.js | 6 ++++-- scripts/main.js | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/module.json b/module.json index 8a11b18..1863ae5 100644 --- a/module.json +++ b/module.json @@ -18,9 +18,9 @@ "flags": {}, "version": "1.2.5", "compatibility": { - "minimum": 10, - "verified": "10.291", - "maximum": 10 + "minimum": 11, + "verified": "11.299", + "maximum": 11 }, "scripts": [], "esmodules": ["./scripts/main.js"], diff --git a/scripts/droppable.js b/scripts/droppable.js index 5b10ef2..d6abeaa 100644 --- a/scripts/droppable.js +++ b/scripts/droppable.js @@ -46,9 +46,11 @@ export default class Droppable { return; } - if (data.documentName === 'Actor') { + const folder = fromUuidSync(data.uuid); + + if (folder.type === 'Actor') { this._handleActorFolder(data, event); - } else if (data.documentName === 'JournalEntry') { + } else if (folder.type === 'JournalEntry') { this._handleJournalFolder(data, event); } else { errorCallback(); diff --git a/scripts/main.js b/scripts/main.js index f044534..91f599d 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -24,6 +24,7 @@ Hooks.once('setup', () => { ); }); +// TODO need to double check this works in v11 when it's updated Hooks.on('3DCanvasConfig', (config) => { config.INTERACTIONS.dropFunctions.Folder = async function (event, data) { canvas.tokens.activate();