forked from hkc/cc-stuff
Finally playing some stuff?
This commit is contained in:
parent
adcae533d0
commit
62891da708
|
@ -31,6 +31,7 @@ function()
|
||||||
while running do
|
while running do
|
||||||
for i = 1, math.min(screen_h, 48) do
|
for i = 1, math.min(screen_h, 48) do
|
||||||
term.setCursorPos(1, i)
|
term.setCursorPos(1, i)
|
||||||
|
term.clearLine()
|
||||||
local song = table_of_contents[i]
|
local song = table_of_contents[i]
|
||||||
if song then
|
if song then
|
||||||
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))
|
||||||
|
@ -46,6 +47,11 @@ function()
|
||||||
|
|
||||||
if ev == "mouse_click" then
|
if ev == "mouse_click" then
|
||||||
local x, y = table.unpack(evd, 1)
|
local x, y = table.unpack(evd, 1)
|
||||||
|
if drive.isReady() and y <= #table_of_contents then
|
||||||
|
drive.seek(-drive.getSize())
|
||||||
|
drive.seek(table_of_contents[i].offset)
|
||||||
|
drive.play()
|
||||||
|
end
|
||||||
elseif ev == "term_resize" then
|
elseif ev == "term_resize" then
|
||||||
screen_w, screen_h = term.getSize()
|
screen_w, screen_h = term.getSize()
|
||||||
elseif ev == "tape_present" then
|
elseif ev == "tape_present" then
|
||||||
|
|
Loading…
Reference in New Issue