entirely rework event handling take 4
This commit is contained in:
13
startup.lua
13
startup.lua
@ -85,7 +85,6 @@ end
|
||||
|
||||
local function GetClick()
|
||||
mon.setTextScale(1)
|
||||
handlers.setupConnectionHandlers()
|
||||
local result, eventType, eventData = events.pullEvent("monitor_touch")
|
||||
|
||||
-- eventData is {eventType, side, x, y}
|
||||
@ -100,14 +99,12 @@ local function GetClick()
|
||||
end
|
||||
|
||||
local function GetActivation()
|
||||
handlers.setupConnectionHandlers()
|
||||
local result = events.pullEvent("stargate_incoming_wormhole")
|
||||
return 1
|
||||
end
|
||||
|
||||
local function ParaDisconnect()
|
||||
-- Now handled by event system with priority
|
||||
handlers.setupConnectionHandlers()
|
||||
while true do
|
||||
local result = events.pullEvent("monitor_touch")
|
||||
if result == "disconnect" then
|
||||
@ -118,13 +115,11 @@ end
|
||||
|
||||
local function EntityRead()
|
||||
sleep(0.1)
|
||||
handlers.setupConnectionHandlers()
|
||||
local result = events.pullEvent("stargate_reconstructing_entity")
|
||||
return 1
|
||||
end
|
||||
|
||||
local function DisconnectCheck()
|
||||
handlers.setupConnectionHandlers()
|
||||
local result = events.pullEvent("stargate_disconnected")
|
||||
return 2
|
||||
end
|
||||
@ -135,7 +130,6 @@ local function Paratimeout()
|
||||
end
|
||||
|
||||
local function GetMessage()
|
||||
handlers.setupConnectionHandlers()
|
||||
local result = events.pullEvent("stargate_message_received")
|
||||
return 1
|
||||
end
|
||||
@ -252,6 +246,9 @@ end
|
||||
local function handleIncomingWormhole()
|
||||
local state = getState()
|
||||
|
||||
-- Setup event handlers for this connection
|
||||
handlers.setupConnectionHandlers()
|
||||
|
||||
mon.setBackgroundColor(colors.black)
|
||||
mon.clear()
|
||||
mon.setBackgroundColor(colors.red)
|
||||
@ -498,6 +495,10 @@ end
|
||||
|
||||
local function handleOutgoingDial()
|
||||
local state = getState()
|
||||
|
||||
-- Setup event handlers for this connection
|
||||
handlers.setupConnectionHandlers()
|
||||
|
||||
totalstate = true
|
||||
local PDO = 0
|
||||
PDO = parallel.waitForAny(selectCategory, Paratimeout)
|
||||
|
||||
Reference in New Issue
Block a user