Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions wocchat/wocchat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ local function saveScreen()
end

local function restoreScreen()
term.setCursor(1,screen.height)
gpu.setBackground(table.unpack(screen.bg))
gpu.setForeground(table.unpack(screen.fg))
print("Restoring screen ...")
for i = 0,15 do
gpu.setPaletteColor(i,screen.palette[i])
end
term.setCursor(1,screen.height)
gpu.setBackground(table.unpack(screen.bg))
gpu.setForeground(table.unpack(screen.fg))
end

local function loadConfig()
Expand Down Expand Up @@ -439,13 +439,7 @@ local function drawTextbar(x,y,width,text)
end

local customGPU={}
if newterm then
-- New term does not handle palette colors properly yet, hack around this.
customGPU.gpu = {
setForeground = function(color) gpu.setForeground(color, true) end,
setBackground = function(color) gpu.setBackground(color, true) end,
}
else
if not newterm then
customGPU.gpu = {
set = function(x,y,s,v) return gpu.set(x+customGPU.x-1,y+customGPU.y-1,s,v ~= nil and v) end,
get = function(x,y) return gpu.get(x+customGPU.x-1,y+customGPU.y-1) end,
Expand Down Expand Up @@ -1476,7 +1470,7 @@ local function main()
helper.joinServer(k)
end
end
local history = {}
local history = {nowrap=true}
while true do
if dirty.blocks or dirty.title or dirty.window or dirty.nicks then
redraw()
Expand Down Expand Up @@ -1553,8 +1547,7 @@ if newterm then
end

local window = term.internal.open()
-- TODO: window will eventually be moved to the end in later updates.
term.bind(window, customGPU.gpu, term.screen(), term.keyboard())
term.bind(customGPU.gpu, term.screen(), term.keyboard(), window)
process.info().data.window = window
customGPU.window = window
else
Expand Down