fix: iterate in reverse
This commit is contained in:
@@ -279,7 +279,7 @@ function drawLogs(x0, y0, x1, y1)
|
|||||||
messageFG = prevColourFg
|
messageFG = prevColourFg
|
||||||
end
|
end
|
||||||
|
|
||||||
for lineIdx, line in ipairs(wrappedMessage) do
|
for lineIdx=#wrappedMessage,1, -1 do
|
||||||
if drawnLines > h then break end
|
if drawnLines > h then break end
|
||||||
|
|
||||||
term.setCursorPos(1, y1 - drawnLines)
|
term.setCursorPos(1, y1 - drawnLines)
|
||||||
@@ -295,7 +295,7 @@ function drawLogs(x0, y0, x1, y1)
|
|||||||
|
|
||||||
term.setBackgroundColor(messageBG)
|
term.setBackgroundColor(messageBG)
|
||||||
term.setTextColor(messageFG)
|
term.setTextColor(messageFG)
|
||||||
term.write(line)
|
term.write(wrappedMessage[lineIdx])
|
||||||
|
|
||||||
local remaining = w - (prefixLength + #line)
|
local remaining = w - (prefixLength + #line)
|
||||||
if remaining > 0 then
|
if remaining > 0 then
|
||||||
|
|||||||
Reference in New Issue
Block a user