statusbar

This commit is contained in:
Casey 2023-10-17 16:28:20 +03:00
parent 62891da708
commit 58e4631df8
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,7 @@ local screen_w, screen_h = term.getSize()
parallel.waitForAll( parallel.waitForAll(
function() function()
while running do while running do
for i = 1, math.min(screen_h, 48) do for i = 1, math.min(screen_h - 1, 48) do
term.setCursorPos(1, i) term.setCursorPos(1, i)
term.clearLine() term.clearLine()
local song = table_of_contents[i] local song = table_of_contents[i]
@ -37,6 +37,8 @@ function()
term.write(string.format("#%2d %9s %s", i, bytes2time(song.length), song.title)) term.write(string.format("#%2d %9s %s", i, bytes2time(song.length), song.title))
end end
end end
term.setCursorPos(1, screen_h)
term.write(string.format("%s - %d", drive.getState(), drive.getPosition()))
os.sleep(0.1) os.sleep(0.1)
end end
end, end,