Update of touch configuration scene

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-24 23:23:36 +07:00
parent 48ce04507e
commit 84df78a528
5 changed files with 180 additions and 79 deletions

View File

@@ -175,27 +175,27 @@ function Grid:update()
end
function Grid:draw(greyscale, timer)
love.graphics.setColor(0,0,0,1)
love.graphics.rectangle("fill", 256, 31, 80, 45, 0, 0)
love.graphics.setColor(0.3, 0.3, 0.3, 1)
love.graphics.line(256,31,256,31+45)
love.graphics.line(256,31,256+80,31)
love.graphics.line(256+80,31,256+80,31+45)
love.graphics.line(256,31+45,256+80,31+45)
love.graphics.setColor(0,0,0,1)
love.graphics.rectangle("fill", 256, 31, 80, 45, 0, 0)
love.graphics.setColor(0.3, 0.3, 0.3, 1)
love.graphics.line(256,31,256,31+45)
love.graphics.line(256,31,256+80,31)
love.graphics.line(256+80,31,256+80,31+45)
love.graphics.line(256,31+45,256+80,31+45)
for y = 1, self.height do
for x = 1, self.width do
if BLOCKS[self.grid[y][x].skin] and
BLOCKS[self.grid[y][x].skin][self.grid[y][x].colour] then
if self.grid[y][x].flash ~= nil then
if self.grid[y][x].flash > 0 then
love.graphics.setColor(0.4+(self.grid[y][x].flash*0.1), 0.4+(self.grid[y][x].flash*0.1), 0.4+(self.grid[y][x].flash*0.1), 1)
love.graphics.draw(BLOCKS[self.grid[y][x].skin]['W'], 200+x*16, 64+y*16)
self.grid[y][x].flash = self.grid[y][x].flash - 1
else
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(BLOCKS[self.grid[y][x].skin][self.grid[y][x].colour..'_d'], 200+x*16, 64+y*16)
end
end
if self.grid[y][x].flash ~= nil then
if self.grid[y][x].flash > 0 then
love.graphics.setColor(0.4+(self.grid[y][x].flash*0.1), 0.4+(self.grid[y][x].flash*0.1), 0.4+(self.grid[y][x].flash*0.1), 1)
love.graphics.draw(BLOCKS[self.grid[y][x].skin]['W'], 200+x*16, 64+y*16)
self.grid[y][x].flash = self.grid[y][x].flash - 1
else
love.graphics.setColor(1, 1, 1, 1)
love.graphics.draw(BLOCKS[self.grid[y][x].skin][self.grid[y][x].colour..'_d'], 200+x*16, 64+y*16)
end
end
if greyscale then
if timer > 1 then timer = 1 end
love.graphics.setColor(0.7, 0.7, 0.7, 0+timer)

View File

@@ -177,7 +177,7 @@ end
---@param force? boolean Forcing click on hidden widgets?
function VCTRL.press(x,y,id,force)
if not global_toggle then return end
if not (global_toggle and id) then return end
local obj,closestDist=false,1e99
for _, w in ipairs(VCTRL) do
if w.show or force then
@@ -196,7 +196,7 @@ function VCTRL.press(x,y,id,force)
end
function VCTRL.release(id)
if not global_toggle then return end
if not (global_toggle and id) then return end
if touches[id] then
touches[id]:release()
touches[id]=nil