1
0
mirror of https://github.com/LDDestroier/CC/ synced 2024-06-25 22:53:18 +00:00

Moved instance spawning into main

This commit is contained in:
LDDestroier 2019-04-23 17:26:41 -04:00 committed by GitHub
parent 055fda579c
commit 8c0ca3c243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -656,14 +656,6 @@ local scrollWindows = function()
return changed
end
for y = 1, gridHeight do
for x = 1, gridWidth do
newInstance(x, y, defaultProgram, x == focus[1] and y == focus[2])
end
end
scrollWindows()
local swapInstances = function(xmod, ymod)
instances[focus[2]][focus[1]].co, instances[focus[2] + ymod][focus[1] + xmod].co = instances[focus[2] + ymod][focus[1] + xmod].co, instances[focus[2]][focus[1]].co
instances[focus[2]][focus[1]].window, instances[focus[2] + ymod][focus[1] + xmod].window = instances[focus[2] + ymod][focus[1] + xmod].window, instances[focus[2]][focus[1]].window
@ -685,6 +677,22 @@ local main = function()
local enteringCommand
local justStarted = true
local tID, wID
for y = 1, gridHeight do
for x = 1, gridWidth do
newInstance(x, y, defaultProgram, x == focus[1] and y == focus[2])
end
end
scrollWindows()
term.clear()
cwrite("Use CTRL+SHIFT+ARROW to switch workspace.", 0 + scr_y / 2)
cwrite("Terminate on an inactive workspace to exit.", 1 + scr_y / 2)
sleep(0.1)
os.pullEvent("key")
os.queueEvent("mouse_click", 0, 0, 0)
while isRunning do
local evt = {os.pullEventRaw()}
enteringCommand = false
@ -789,14 +797,6 @@ local main = function()
end
end
term.clear()
cwrite("Use CTRL+SHIFT+ARROW to switch workspace.", 0 + scr_y / 2)
cwrite("Terminate on an inactive workspace to exit.", 1 + scr_y / 2)
sleep(0.1)
os.pullEvent("key")
os.queueEvent("mouse_click", 0, 0, 0)
local result, message = pcall(main)
_G.currentlyRunningWorkspace = false