diff --git a/libs/simple-button.lua b/libs/simple-button.lua index 06ffb79..45a0c1d 100644 --- a/libs/simple-button.lua +++ b/libs/simple-button.lua @@ -120,7 +120,6 @@ function button:press(x, y) end ---Trigger release action, don't need ``self._hovering`` to ``true`` function button:release(x, y) - error(self._pressed and "okay") if self:isHovering(x, y) and self._pressed then self._pressed = false self.codeWhenReleased() diff --git a/scene/name_entry.lua b/scene/name_entry.lua index 3a5af51..156017f 100644 --- a/scene/name_entry.lua +++ b/scene/name_entry.lua @@ -129,7 +129,7 @@ end function NameEntryScene:onInputPress(e) 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) elseif e.input == "menu_decide" or e.input == "rotate_left" or e.scancode == "return" then self.delete_confirm = false self.delete_input_count = 0 @@ -199,7 +199,7 @@ end function NameEntryScene: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) elseif e.input == "left" or e.scancode == "left" or e.input == "right" or e.scancode == "right" then self.direction = nil self.repeat_counter = self.repeat_limit-1 diff --git a/scene/touch_config.lua b/scene/touch_config.lua index ce17ecd..9b22b4a 100644 --- a/scene/touch_config.lua +++ b/scene/touch_config.lua @@ -13,34 +13,34 @@ local buttonList = { x = 10, y = 10, w = 120, h = 110 }, - BUTTON.new{ + zoom_negat = BUTTON.new{ text = "[—]\nSmaller", x = 145, y = 10, w = 100, h = 50, }, - BUTTON.new{ + zoom_reset = BUTTON.new{ text = "Size: 50\nTap to reset", x = 255, y = 10, w = 100, h = 50, }, - BUTTON.new{ + zoom_posit = BUTTON.new{ text = "[+]\nBigger", x = 365, y = 10, w = 100, h = 50, }, - BUTTON.new{ + opact_negat = BUTTON.new{ text = "[—]\nCan't see", x = 145, y = 70, w = 100, h = 50, }, - BUTTON.new{ + opact_reset = BUTTON.new{ text = "Opacity: 50%\nTap to reset", x = 255, y = 70, w = 100, h = 50, codeWhenReleased = function() PlaySE("autopromote") end }, - BUTTON.new{ + opact_posit = BUTTON.new{ text = "[+]\nTotally see", x = 365, y = 70, w = 100, h = 50, }, - BUTTON.new{ + menu_back = BUTTON.new{ text = "SAVE and\nback to MENU", x = 480, y = 10, w = 150, h = 50, codeWhenReleased = function() SCENE = TitleScene() end @@ -65,6 +65,7 @@ end function TouchConfigScene:render() MainBackground() BUTTON.draw(buttonList) + drawBigText(buttonList.opact_reset._pressed and "okay" or "not", 400, 400, 100, "left") end ---@param e SCENE_onInput