mirror of
https://github.com/LDDestroier/CC/
synced 2025-05-07 01:04:05 +00:00
Moved instance spawning into main
This commit is contained in:
parent
055fda579c
commit
8c0ca3c243
@ -656,14 +656,6 @@ local scrollWindows = function()
|
|||||||
return changed
|
return changed
|
||||||
end
|
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)
|
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]].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
|
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 enteringCommand
|
||||||
local justStarted = true
|
local justStarted = true
|
||||||
local tID, wID
|
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
|
while isRunning do
|
||||||
local evt = {os.pullEventRaw()}
|
local evt = {os.pullEventRaw()}
|
||||||
enteringCommand = false
|
enteringCommand = false
|
||||||
@ -789,14 +797,6 @@ local main = function()
|
|||||||
end
|
end
|
||||||
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)
|
local result, message = pcall(main)
|
||||||
|
|
||||||
_G.currentlyRunningWorkspace = false
|
_G.currentlyRunningWorkspace = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user