mirror of
https://github.com/LDDestroier/CC/
synced 2025-01-07 07:50:26 +00:00
Update pain.lua
This commit is contained in:
parent
1d2e012401
commit
b943cd2785
18
pain.lua
18
pain.lua
@ -803,18 +803,9 @@ local renderPainyThings = function(xscroll,yscroll,doGrid)
|
||||
local dotBuffChar, dotBuffBack = "", "" --only used if gridBleedThrough is true
|
||||
local doot
|
||||
if doGrid then
|
||||
if gridBleedThrough then
|
||||
doot = tableFormatPE(paintEncoded[frame])
|
||||
end
|
||||
for y = 1, scr_y - yadjust do
|
||||
term.setCursorPos(1,y)
|
||||
if gridBleedThrough then
|
||||
for x = 1, scr_x do
|
||||
dotBuffChar = dotBuffChar .. grid[ro(y+(yscroll+2),#grid)+1]:sub(ro(x+paint.scrollX,#grid[1]))
|
||||
dotBuffBack = dotBuffBack .. (CTB(doot[y+paint.scrollY][x+paint.scrollX].b or colors.white) or " ")
|
||||
end
|
||||
term.blit(dotBuffChar, CTB(rendback.t):rep(scr_x), dotBuffBack)
|
||||
else
|
||||
if not gridBleedThrough then
|
||||
-- the single most convoluted line I've ever written that works, and I love it
|
||||
term.write(stringShift(grid[ro(y+(yscroll+2),#grid)+1],xscroll+1):rep(math.ceil(scr_x/#grid[ro(y+(yscroll+2),#grid)+1])):sub(1,scr_x))
|
||||
end
|
||||
@ -1389,11 +1380,16 @@ renderPAIN = function(dots,xscroll,yscroll,doPain,dontRenderBar)
|
||||
end
|
||||
if d then
|
||||
term.setCursorPos(d.x-(xscroll or 0),d.y-(yscroll or 0))
|
||||
term.setTextColor( (paint.doGray and grayOut(d.t) or d.t) or rendback.t)
|
||||
term.setBackgroundColor((paint.doGray and grayOut(d.b) or d.b) or rendback.b)
|
||||
if gridBleedThrough then
|
||||
term.setTextColor(rendback.t)
|
||||
term.write(grid[ ro( y+(yscroll+2), #grid )+1 ]:sub(1+(paint.scrollX % #grid[1])))
|
||||
else
|
||||
term.setTextColor( (paint.doGray and grayOut(d.t) or d.t) or rendback.t)
|
||||
term.write(d.c or " ")
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
term.setBackgroundColor(beforeBG or rendback.b)
|
||||
term.setTextColor(beforeTX or rendback.t)
|
||||
|
Loading…
Reference in New Issue
Block a user