builder improvements

This commit is contained in:
kepler155c@gmail.com
2017-06-23 02:04:56 -04:00
parent 3f66a9397c
commit 7f99c0c69a
20 changed files with 2827 additions and 675 deletions

View File

@@ -139,17 +139,25 @@ function Event.addThread(fn)
end
function Event.pullEvents(...)
Process:addThread(_pullEvents)
local routines = { ... }
if #routines > 0 then
Process:addThread(_pullEvents)
for _, routine in ipairs(routines) do
Process:addThread(routine)
end
end
while true do
local e = Process:pullEvent()
if exitPullEvents or e == 'terminate' then
break
end
end
else
while true do
local e = Process:pullEvent()
if exitPullEvents or e == 'terminate' then
break
local e = { os.pullEvent() }
Event.processEvent(e)
if exitPullEvents or e == 'terminate' then
break
end
end
end
end