mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Add buttons to prevent soft-lock in keybind conf.
This commit is contained in:
@@ -151,13 +151,13 @@ function button:press(x, y, touchID)
|
||||
end
|
||||
---Trigger release action, don't need ``self._hovering`` to ``true``
|
||||
function button:release(x, y, touchID)
|
||||
local valid = true
|
||||
local valid
|
||||
if touchID then
|
||||
valid = touchID == self._touchID
|
||||
else
|
||||
valid = true
|
||||
end
|
||||
|
||||
|
||||
if valid then
|
||||
self._pressed = false
|
||||
self._touchID = false
|
||||
@@ -187,7 +187,7 @@ function BUTTON.checkDataValidation(D, safe)
|
||||
elseif type(D.text) ~= 'string' then
|
||||
error("[text] must be a string or a function returns string, got "..type(D.text))
|
||||
end
|
||||
|
||||
|
||||
assert(type(D.x) == "number" , "[x] must be a integer")
|
||||
assert(type(D.y) == "number" , "[y] must be a integer")
|
||||
assert(type(D.w) == "number" and D.w > 0, "[w] must be a positive integer")
|
||||
|
||||
Reference in New Issue
Block a user