1
0
mirror of https://github.com/LDDestroier/CC/ synced 2024-09-20 19:29:45 +00:00

Fixed crash when pushing key on color picker

I can't believe it took Noodle for me to notice this issue
This commit is contained in:
LDDestroier 2019-10-18 02:51:39 -04:00 committed by GitHub
parent f7d040e6aa
commit a5e0d08f72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3057,6 +3057,7 @@ local getInput = function() --gotta catch them all
miceDown[button] = true miceDown[button] = true
if y <= scr_y-(plc.renderBlittle and 0 or doRenderBar) then if y <= scr_y-(plc.renderBlittle and 0 or doRenderBar) then
if (button == 3) then if (button == 3) then
renderBottomBar("Type text onto canvas:")
putDownText(x,y) putDownText(x,y)
miceDown = {} miceDown = {}
keysDown = {} keysDown = {}
@ -3310,6 +3311,7 @@ local getInput = function() --gotta catch them all
x = 2*x x = 2*x
y = 3*y y = 3*y
end end
renderBottomBar("Type text onto canvas:")
putDownText(x,y) putDownText(x,y)
miceDown = {} miceDown = {}
keysDown = {} keysDown = {}
@ -3342,10 +3344,14 @@ local getInput = function() --gotta catch them all
renderBottomBar("Pick color with cursor:") renderBottomBar("Pick color with cursor:")
paintEncoded = clearAllRedundant(paintEncoded) paintEncoded = clearAllRedundant(paintEncoded)
local mevt local mevt
repeat local keepPicking = true
while keepPicking do
mevt = {os.pullEvent()} mevt = {os.pullEvent()}
until (mevt[1] == "key" and mevt[2] == keys.x) or (mevt[2] == 1 and (mevt[4] or math.huge) <= scr_y) if mevt[1] == "mouse_click" then
if not (mevt[1] == "key" and mevt[2] == keys.x) then keepPicking = false
resetInputState()
if mevt[4] < scr_y then
local x, y = mevt[3]+paint.scrollX, mevt[4]+paint.scrollY local x, y = mevt[3]+paint.scrollX, mevt[4]+paint.scrollY
if plc.renderBlittle then if plc.renderBlittle then
x = 2*x x = 2*x
@ -3359,14 +3365,15 @@ local getInput = function() --gotta catch them all
paint.b = p.b or paint.b paint.b = p.b or paint.b
paint.c = p.c or paint.c paint.c = p.c or paint.c
paint.m = p.m or paint.m paint.m = p.m or paint.m
miceDown = {}
keysDown = {}
doRender = true
isDragging = false
break break
end end
end end
resetInputState() end
elseif mevt[1] == "key" then
if mevt[2] == keys.x or evt[2] == keys.q then
keepPicking = false
end
end
end end
doRender = true doRender = true
isDragging = false isDragging = false