mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Fix lỗi giữa đêm
This commit is contained in:
@@ -24,12 +24,12 @@ buttonList = {
|
||||
showToggle = BUTTON.new{
|
||||
text = function()
|
||||
if focusingButton then
|
||||
return string.format("Show / Hide\n[%s]", focusingButton.show and "Show" or "Hide")
|
||||
return focusingButton.show and "[SHOW]\nHide" or "Show\n[HIDE]"
|
||||
else
|
||||
return "Show / Hide\n[----]"
|
||||
return "Show\nHide"
|
||||
end
|
||||
end,
|
||||
x = 240, y = 5, w = 90, h = 50,
|
||||
x = 275, y = 5, w = 50, h = 75,
|
||||
codeWhenReleased = function ()
|
||||
if focusingButton then
|
||||
focusingButton.show = not focusingButton.show
|
||||
@@ -40,7 +40,7 @@ buttonList = {
|
||||
},
|
||||
previewToggle = BUTTON.new{
|
||||
text = "Preview\nON",
|
||||
x = 520, y = 5, w = 60, h = 50,
|
||||
x = 570, y = 35, w = 60, h = 40,
|
||||
codeWhenReleased = function()
|
||||
VCTRL.release()
|
||||
BUTTON.release(buttonList)
|
||||
@@ -49,7 +49,7 @@ buttonList = {
|
||||
},
|
||||
menuScreen = BUTTON.new{
|
||||
text = "MENU",
|
||||
x = 585, y = 5, w = 50, h = 50,
|
||||
x = 570, y = 5, w = 60, h = 25,
|
||||
codeWhenReleased = function()
|
||||
if hasChanged then
|
||||
local selection = love.window.showMessageBox(
|
||||
@@ -77,7 +77,7 @@ buttonList = {
|
||||
}
|
||||
sliderList = {}
|
||||
sliderList.opacity = newSlider(
|
||||
135, 20+2.5, 100, 100, 0, 100,
|
||||
155, 20+5, 120, 100, 0, 100,
|
||||
function()
|
||||
local v
|
||||
if focusingButton then
|
||||
@@ -89,10 +89,10 @@ sliderList.opacity = newSlider(
|
||||
sliderList.opacity.value = v
|
||||
end
|
||||
end,
|
||||
{width = 20}
|
||||
{width = 30}
|
||||
)
|
||||
sliderList.size = newSlider(
|
||||
135, 50+2.5, 100, 45, 0, 120,
|
||||
155, 60+2.5, 120, 45, 0, 120,
|
||||
function(v)
|
||||
if focusingButton then
|
||||
local v = math.roundUnit(v, 5)
|
||||
@@ -103,17 +103,17 @@ sliderList.size = newSlider(
|
||||
sliderList.size.value = v / 120
|
||||
end
|
||||
end,
|
||||
{width = 20}
|
||||
{width = 30}
|
||||
)
|
||||
local gridSizeTable = {1, 2, 5, 10, 20, 50, 100}
|
||||
sliderList.gridSize = newSlider(
|
||||
400, 40-1, 100, 1, 1, #gridSizeTable - 1,
|
||||
405, 50, 100, 1, 1, #gridSizeTable - 1,
|
||||
function()
|
||||
local v = math.roundUnit(sliderList.gridSize.value, 1 / 6)
|
||||
sliderList.gridSize.value = v
|
||||
gridSize = gridSizeTable[math.roundUnit(v * (#gridSizeTable - 1) + 1, 1)]
|
||||
end,
|
||||
{width = 20}
|
||||
{width = 30}
|
||||
); sliderList.gridSize.forceLight = true
|
||||
|
||||
local function sliderList_draw()
|
||||
@@ -179,18 +179,18 @@ function TouchConfigScene:render()
|
||||
|
||||
love.graphics.setColor(0, 0, 0, 0.7)
|
||||
-- Opacity and Size
|
||||
love.graphics.rectangle("fill", 10, 5, 227, 58)
|
||||
love.graphics.rectangle("fill", 10, 5, 263, 75)
|
||||
-- Snap to grid
|
||||
love.graphics.rectangle("fill", 335, 5, 130, 50)
|
||||
love.graphics.rectangle("fill", 330, 5, 150, 75)
|
||||
|
||||
-- Opacity
|
||||
drawText("Opacity", 20, 10, 100, "left")
|
||||
drawText(string.format("%3.1d%%", focusingButton and focusingButton.alpha * 100 or 0), 190, 10, 40, "left")
|
||||
drawText("Opacity", 20, 15, 100, "left")
|
||||
drawText(string.format("%3.1d%%", focusingButton and focusingButton.alpha * 100 or 0), 225, 15, 40, "left")
|
||||
-- Size
|
||||
drawText("Size", 20, 40, 100, "left")
|
||||
drawText(string.format("%3.1dpx", focusingButton and focusingButton.r or 0), 190, 40, 40, "left")
|
||||
drawText("Size", 20, 55, 100, "left")
|
||||
drawText(string.format("%3.1dpx", focusingButton and focusingButton.r or 0), 225, 55, 40, "left")
|
||||
-- Snap to grid
|
||||
drawText(string.format("Snap to grid: %3s", gridSize), 340, 10, 140, "left")
|
||||
drawText(string.format("Snap to grid: %3s", gridSize), 345, 15, 140, "left")
|
||||
|
||||
for _, v in ipairs(VCTRL) do
|
||||
if v ~= focusingButton then
|
||||
@@ -217,10 +217,8 @@ end
|
||||
|
||||
---@param e SCENE_onInput
|
||||
function TouchConfigScene:onInputMove(e)
|
||||
if e.type == "mouse" or e.type == "touch" then
|
||||
if love.mouse.isDown(1) then
|
||||
if VCTRL.drag(e.dx, e.dy, e.id or 1) then hasChanged = true end
|
||||
end
|
||||
if (e.type == "mouse" and love.mouse.isDown(1)) or e.type == "touch" then
|
||||
if VCTRL.drag(e.dx, e.dy, e.id or 1) then hasChanged = true end
|
||||
end
|
||||
|
||||
if e.type == "mouse" then
|
||||
@@ -233,7 +231,7 @@ function TouchConfigScene:onInputPress(e)
|
||||
if not (
|
||||
VCTRL.press(e.x, e.y, e.id and e.id or 1, true) or
|
||||
BUTTON.press(buttonList, e.x, e.y, e.id) or
|
||||
(e.x >= 75 and e.x <= 195 and e.y >= 12 and e.y <= 63)
|
||||
(e.x >= 80 and e.x <= 230 and e.y >= 10 and e.y <= 77)
|
||||
) then
|
||||
VCTRL.focus = nil
|
||||
focusingButton = nil
|
||||
|
||||
@@ -8,7 +8,7 @@ local buttonList
|
||||
buttonList = {
|
||||
previewToggle = BUTTON.new{
|
||||
text = "Preview\nOFF",
|
||||
x = 520, y = 5, w = 60, h = 50,
|
||||
x = 570, y = 35, w = 60, h = 40,
|
||||
codeWhenReleased = function()
|
||||
VCTRL.release()
|
||||
BUTTON.release(buttonList)
|
||||
|
||||
Reference in New Issue
Block a user