From 64336f7cbccdf04b044e61bdece68979fd68763b Mon Sep 17 00:00:00 2001 From: "Squishy (C6H12O6+NaCl+H2O)" <106439598+SweetSea-ButImNotSweet@users.noreply.github.com> Date: Tue, 21 May 2024 23:29:11 +0700 Subject: [PATCH] TEST --- libs/simple-button.lua | 10 ++++------ scene/touch_config.lua | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libs/simple-button.lua b/libs/simple-button.lua index 8c10ab9..d16a2c1 100644 --- a/libs/simple-button.lua +++ b/libs/simple-button.lua @@ -237,18 +237,16 @@ end ---@param list table ---@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 ---@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 \ No newline at end of file diff --git a/scene/touch_config.lua b/scene/touch_config.lua index 0437e4c..ce17ecd 100644 --- a/scene/touch_config.lua +++ b/scene/touch_config.lua @@ -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