fixed stupid mistake x5
This commit is contained in:
12
startup.lua
12
startup.lua
@ -77,6 +77,7 @@ local selx, sely = 0, 0
|
|||||||
local y = 0
|
local y = 0
|
||||||
local lastReceivedMessage = nil
|
local lastReceivedMessage = nil
|
||||||
local remoteHasComputer = false
|
local remoteHasComputer = false
|
||||||
|
local enteringPassword = false
|
||||||
|
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
-- EVENT HANDLERS
|
-- EVENT HANDLERS
|
||||||
@ -98,6 +99,11 @@ local function ParaDisconnect()
|
|||||||
local dx, dy = 0, 0
|
local dx, dy = 0, 0
|
||||||
_, _, dx, dy = os.pullEvent("monitor_touch")
|
_, _, dx, dy = os.pullEvent("monitor_touch")
|
||||||
|
|
||||||
|
-- Ignore clicks during password entry
|
||||||
|
if enteringPassword then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
-- Only disconnect if clicking the disconnect button (bottom-right corner)
|
-- Only disconnect if clicking the disconnect button (bottom-right corner)
|
||||||
if dy >= 17 and dy <= 19 and dx >= 20 and dx <= 28 then
|
if dy >= 17 and dy <= 19 and dx >= 20 and dx <= 28 then
|
||||||
gate.disconnectStargate()
|
gate.disconnectStargate()
|
||||||
@ -144,9 +150,9 @@ local function HandlePasswordEntry()
|
|||||||
display.showPasswordPrompt()
|
display.showPasswordPrompt()
|
||||||
|
|
||||||
local password = ""
|
local password = ""
|
||||||
local entering = true
|
enteringPassword = true
|
||||||
|
|
||||||
while entering do
|
while enteringPassword do
|
||||||
-- Use os.pullEvent directly to avoid conflicts with ParaDisconnect
|
-- Use os.pullEvent directly to avoid conflicts with ParaDisconnect
|
||||||
local _, _, x, y = os.pullEvent("monitor_touch")
|
local _, _, x, y = os.pullEvent("monitor_touch")
|
||||||
|
|
||||||
@ -176,7 +182,7 @@ local function HandlePasswordEntry()
|
|||||||
display.updatePasswordDisplay(password)
|
display.updatePasswordDisplay(password)
|
||||||
elseif x >= 18 and x <= 21 then
|
elseif x >= 18 and x <= 21 then
|
||||||
-- OK button - submit password
|
-- OK button - submit password
|
||||||
entering = false
|
enteringPassword = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user