From 47dee4c5541fbf48d988fa3ca10e40b6bfa27917 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Wed, 14 Dec 2022 14:12:43 +0100 Subject: [PATCH] Split touch controls into separate flags --- Sources/arm/App.hx | 6 +++--- Sources/arm/ui/BoxPreferences.hx | 2 +- khafile.js | 5 ----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Sources/arm/App.hx b/Sources/arm/App.hx index 0c11a27e..a788ec2b 100644 --- a/Sources/arm/App.hx +++ b/Sources/arm/App.hx @@ -380,10 +380,10 @@ class App { else dragStart = 0; hasDrag = false; } - var moved = Math.abs(mouse.movementX) > 1 && Math.abs(mouse.movementY) > 1; if (mouse.released()) { dragStart = 0; } + var moved = Math.abs(mouse.movementX) > 1 && Math.abs(mouse.movementY) > 1; if ((mouse.released() || moved) && !hasDrag) { dragAsset = null; dragMaterial = null; @@ -394,7 +394,7 @@ class App { isDragging = false; } // Disable touch scrolling while dragging is active - Zui.touchControls = !isDragging; + Zui.touchScroll = !isDragging; } if (hasDrag && (mouse.movementX != 0 || mouse.movementY != 0)) { @@ -798,7 +798,7 @@ class App { raw.layer_res = Res2048; raw.dilate = DilateInstant; raw.dilate_radius = 2; - #if arm_touchui + #if (krom_android || krom_ios) raw.touch_ui = true; #else raw.touch_ui = false; diff --git a/Sources/arm/ui/BoxPreferences.hx b/Sources/arm/ui/BoxPreferences.hx index 0c7b492d..21832844 100644 --- a/Sources/arm/ui/BoxPreferences.hx +++ b/Sources/arm/ui/BoxPreferences.hx @@ -94,7 +94,7 @@ class BoxPreferences { ui.changed = false; Config.raw.touch_ui = ui.check(Id.handle({ selected: Config.raw.touch_ui }), tr("Touch UI")); if (ui.changed) { - Zui.touchControls = Config.raw.touch_ui; + Zui.touchScroll = Zui.touchHold = Zui.touchTooltip = Config.raw.touch_ui; Config.loadTheme(Config.raw.theme); UISidebar.inst.tagUIRedraw(); } diff --git a/khafile.js b/khafile.js index 9c341dd0..de2a7e71 100644 --- a/khafile.js +++ b/khafile.js @@ -85,11 +85,6 @@ else if (process.platform === "darwin") { project.addDefine("kha_darwin"); } -if (android || ios) { - project.addDefine("arm_touchui"); // Use touch friendly UI - project.addDefine("zui_touchui"); -} - if (debug) { project.addDefine("arm_debug"); project.addParameter("--times");