diff --git a/src/logic/WindowAppAdapter.js b/src/logic/WindowAppAdapter.js index 1297c64..a647be1 100644 --- a/src/logic/WindowAppAdapter.js +++ b/src/logic/WindowAppAdapter.js @@ -1,12 +1,9 @@ import {dispatchModifiedEvent} from './FakeTouchEvent.js' import {wrapMethod} from '../utils/Injection' -import {MODULE_NAME} from '../config/ModuleConstants' +import {MODULE_NAME, MODULE_DISPLAY_NAME} from '../config/ModuleConstants' import Vectors from './Vectors.js' import AppTouchPointerEventsManager from './AppTouchPointerEventsManager.js' -// Drag and Drop polyfill for touch events (https://github.com/Bernardo-Castilho/dragdroptouch) -import '../utils/DragDropTouch.js' - const STYLE_ID = `${MODULE_NAME}-draggable_apps_styles` const appStyle = ` @@ -64,6 +61,10 @@ function createStyleElement() { class WindowAppAdapter { constructor() { + // Drag and Drop polyfill for touch events (https://github.com/Bernardo-Castilho/dragdroptouch) + import('../utils/DragDropTouch.js') // This is an async import + .then(() => { console.log(MODULE_DISPLAY_NAME + ": Loaded Drag and Drop polyfill") }) + this.lastClickInfo = {target: null, time: 0, touch: false} this.touchManager = AppTouchPointerEventsManager.init(".app:not(#touch-vtt-gesture-calibration-form), .application:not(#touch-vtt-gesture-calibration-form)") diff --git a/src/touch-vtt.js b/src/touch-vtt.js index 7e3f382..b19d28b 100644 --- a/src/touch-vtt.js +++ b/src/touch-vtt.js @@ -127,8 +127,7 @@ Hooks.once('init', () => { if (["touch", "pen"].includes(args[0].pointerType) || args[0].nativeEvent?.touchvttTrusted) { if (args[0].pointerType == "touch" || args[0].nativeEvent.touchvttTrusted) { - - console.log(event, args[0]) + if (event === "clickLeft2" && getSetting(DISABLE_DBLCLICK)) { return } @@ -201,8 +200,10 @@ Hooks.once('init', () => { }) Hooks.on("canvasReady", function() { - // This (together with the hud init in the ready hook) gives the user a touch-friendly UI for pre-made templates (like from an automatic "Place Measured Template" chat button, or MidiQOL) - canvas.templates.preview.on("childAdded", measuredTemplateManager.onTemplatePreviewCreated.bind(measuredTemplateManager)) + if (getSetting(CORE_FUNCTIONALITY) || false) { + // This (together with the hud init in the ready hook) gives the user a touch-friendly UI for pre-made templates (like from an automatic "Place Measured Template" chat button, or MidiQOL) + canvas.templates.preview.on("childAdded", measuredTemplateManager.onTemplatePreviewCreated.bind(measuredTemplateManager)) + } }) Hooks.on('ready', function () {