Skip to content

Commit

Permalink
Improved Core Functionality setting, removed unwanted console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
Aioros committed Jan 10, 2025
1 parent 6de9e61 commit 475e2dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/logic/WindowAppAdapter.js
Original file line number Diff line number Diff line change
@@ -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 = `
Expand Down Expand Up @@ -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)")

Expand Down
9 changes: 5 additions & 4 deletions src/touch-vtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit 475e2dc

Please sign in to comment.