This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-21 23:29:11 +07:00
parent 0aab8c8d74
commit 64336f7cbc
2 changed files with 6 additions and 8 deletions

View File

@@ -237,18 +237,16 @@ end
---@param list table<BUTTON.button>
---@param x number # Mouse position
---@param y number # Mouse position
---@param isMouse? boolean # Is mouse just released a button?
function BUTTON.press(list, x, y, isMouse)
for _, v in pairs(list) do v:press(x, y, isMouse) end
function BUTTON.press(list, x, y)
for _, v in pairs(list) do v:press(x, y) end
end
---Trigger the release action
---@param list table<BUTTON.button>
---@param x number # Mouse position
---@param y number # Mouse position
---@param isMouse? boolean # Is mouse just released a button?
function BUTTON.release(list, x, y, isMouse)
for _, v in pairs(list) do v:release(x, y, isMouse) end
function BUTTON.release(list, x, y)
for _, v in pairs(list) do v:release(x, y) end
end
return BUTTON

View File

@@ -77,13 +77,13 @@ end
function TouchConfigScene:onInputPress(e)
if e.input == 'menu_back' then SCENE = InputConfigScene() end
if e.type == "mouse" or e.type == "touch" then
BUTTON.press(buttonList, e.x, e.y, e.type == "touch")
BUTTON.press(buttonList, e.x, e.y)
end
end
---@param e SCENE_onInput
function TouchConfigScene:onInputRelease(e)
if e.type == "mouse" or e.type == "touch" then
BUTTON.release(buttonList, e.x, e.y, e.type == "touch")
BUTTON.release(buttonList, e.x, e.y)
end
end