mirror of
https://github.com/LDDestroier/CC/
synced 2025-01-08 08:20:27 +00:00
Added redraw for new window if alwaysRender
This commit is contained in:
parent
5cf8037599
commit
00833d33f2
20
windont.lua
20
windont.lua
@ -22,7 +22,7 @@ local windont = {
|
|||||||
config = {
|
config = {
|
||||||
defaultTextColor = "0", -- default text color (what " " corresponds to in term.blit's second argument)
|
defaultTextColor = "0", -- default text color (what " " corresponds to in term.blit's second argument)
|
||||||
defaultBackColor = "f", -- default background color (what " " corresponds to in term.blit's third argument)
|
defaultBackColor = "f", -- default background color (what " " corresponds to in term.blit's third argument)
|
||||||
clearScreen = true, -- if true, will clear the screen during render
|
clearScreen = false, -- if true, will clear the screen during render
|
||||||
},
|
},
|
||||||
info = {
|
info = {
|
||||||
BLIT_CALLS = 0, -- amount of term.blit calls during the last render
|
BLIT_CALLS = 0, -- amount of term.blit calls during the last render
|
||||||
@ -71,11 +71,10 @@ windont.render = function(...)
|
|||||||
baseTerms[windows[i].meta.baseTerm][i] = true
|
baseTerms[windows[i].meta.baseTerm][i] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if bT == output then
|
|
||||||
bT = output.meta.baseTerm
|
|
||||||
end
|
|
||||||
|
|
||||||
for bT, bT_list in pairs(baseTerms) do
|
for bT, bT_list in pairs(baseTerms) do
|
||||||
|
if bT == output then
|
||||||
|
bT = output.meta.baseTerm
|
||||||
|
end
|
||||||
scr_x, scr_y = bT.getSize()
|
scr_x, scr_y = bT.getSize()
|
||||||
for y = 1, scr_y do
|
for y = 1, scr_y do
|
||||||
screenBuffer[1][y] = {}
|
screenBuffer[1][y] = {}
|
||||||
@ -84,6 +83,7 @@ windont.render = function(...)
|
|||||||
blitList = {}
|
blitList = {}
|
||||||
c = 1
|
c = 1
|
||||||
for x = 1, scr_x do
|
for x = 1, scr_x do
|
||||||
|
isWindowHere = false
|
||||||
for i = #windows, 1, -1 do
|
for i = #windows, 1, -1 do
|
||||||
if bT_list[i] then
|
if bT_list[i] then
|
||||||
newChar, newText, newBack = nil
|
newChar, newText, newBack = nil
|
||||||
@ -214,9 +214,9 @@ windont.newWindow = function( x, y, width, height, misc )
|
|||||||
output[2][y] = output[2][y] or {}
|
output[2][y] = output[2][y] or {}
|
||||||
output[3][y] = output[3][y] or {}
|
output[3][y] = output[3][y] or {}
|
||||||
for x = 1, width do
|
for x = 1, width do
|
||||||
output[1][y][x] = output[1][y][x] or char or " "
|
output[1][y][x] = output[1][y][x] or (char or " ")
|
||||||
output[2][y][x] = output[2][y][x] or text or "0"
|
output[2][y][x] = output[2][y][x] or (text or "0")
|
||||||
output[3][y][x] = output[3][y][x] or back or "f"
|
output[3][y][x] = output[3][y][x] or (back or "f")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return output
|
return output
|
||||||
@ -427,6 +427,10 @@ windont.newWindow = function( x, y, width, height, misc )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if meta.alwaysRender then
|
||||||
|
output.redraw()
|
||||||
|
end
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user