mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
.
This commit is contained in:
@@ -117,13 +117,7 @@ end
|
||||
local touches={}
|
||||
local global_toggle=false
|
||||
VCTRL={}
|
||||
-- VCTRL.focus=nil -- Focusing buttons
|
||||
|
||||
---@param toggle boolean|false
|
||||
---Enabling virtual control or not
|
||||
function VCTRL.toggle(toggle)
|
||||
global_toggle=toggle
|
||||
end
|
||||
VCTRL.focus=nil -- Focusing buttons
|
||||
|
||||
---@param ... table
|
||||
---@class data
|
||||
@@ -144,6 +138,19 @@ function VCTRL.new(...)
|
||||
end
|
||||
end
|
||||
|
||||
---@param toggle boolean|false
|
||||
---Enabling virtual control or not
|
||||
function VCTRL.toggle(toggle)
|
||||
if not toggle then
|
||||
-- Release all buttons to prevent ghost keys
|
||||
for id, b in pairs(touches) do
|
||||
b:release(id)
|
||||
touches[id]=nil
|
||||
end
|
||||
end
|
||||
global_toggle=toggle
|
||||
end
|
||||
|
||||
function VCTRL.press(x,y,id)
|
||||
if not global_toggle then return end
|
||||
local obj,closestDist=false,1e99
|
||||
|
||||
Reference in New Issue
Block a user