small changes \j
This commit is contained in:
@@ -541,6 +541,7 @@ function lib.setupENV(win)
|
||||
env.settings = settings
|
||||
env._ENV = env
|
||||
env._G = env
|
||||
env.http = http
|
||||
term.redirect(win)
|
||||
return env
|
||||
end
|
||||
@@ -617,6 +618,7 @@ local function runInRuntime(func, win, close_handled)
|
||||
end
|
||||
local data = table.pack(os.pullEvent())
|
||||
data[1] = data[1]:gsub(escape_lua_pattern "_" .. winid, "")
|
||||
event_data = { n = 0 }
|
||||
if data[1] == filter or filter == nil or data[1] == "terminated" then
|
||||
if data[1] == "char" then
|
||||
if data[#data] == winid then
|
||||
@@ -661,8 +663,6 @@ local function runInRuntime(func, win, close_handled)
|
||||
else
|
||||
event_data = data
|
||||
end
|
||||
else
|
||||
event_data = { n = 0 }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ end
|
||||
|
||||
local function clamp(v, lo, hi) return (v < lo) and lo or ((v > hi) and hi or v) end
|
||||
|
||||
function lib.create(name, w, h, x, y)
|
||||
function lib.create(name, w, h, x, y, do_not_add)
|
||||
local sx,sy = term.getSize()
|
||||
if not x then x = sx/2-w/2 end
|
||||
if not y then y = sy/2-h/2 end
|
||||
@@ -337,8 +337,10 @@ function lib.create(name, w, h, x, y)
|
||||
|
||||
-- initialize
|
||||
t.clear()
|
||||
add(_G.windows, t)
|
||||
lib.reorder()
|
||||
if not do_not_add then
|
||||
add(_G.windows, t)
|
||||
lib.reorder()
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user