fix button render (i'm an idiot)
This commit is contained in:
parent
8835535dba
commit
d17f78e679
|
@ -10,7 +10,7 @@ end
|
||||||
|
|
||||||
width, height = term.getSize()
|
width, height = term.getSize()
|
||||||
centerWidth = round(width / 2)
|
centerWidth = round(width / 2)
|
||||||
centerHeight = round(width / 2)
|
centerHeight = round(height / 2)
|
||||||
peripherals = peripheral.getNames()
|
peripherals = peripheral.getNames()
|
||||||
playing = false
|
playing = false
|
||||||
if #peripherals < 0 then
|
if #peripherals < 0 then
|
||||||
|
@ -38,8 +38,7 @@ noDiscInDriveStatus = "No disc in drive"
|
||||||
status = defaultStatus
|
status = defaultStatus
|
||||||
|
|
||||||
function playDisc()
|
function playDisc()
|
||||||
|
if disk.isPresent(drive) and disk.hasAudio(drive) then
|
||||||
if disk.isPresent(drive) and disk.hasAudio(drive) then
|
|
||||||
disk.playAudio(drive)
|
disk.playAudio(drive)
|
||||||
status = disk.getAudioTitle(drive)
|
status = disk.getAudioTitle(drive)
|
||||||
playing = true
|
playing = true
|
||||||
|
@ -65,10 +64,10 @@ function stopDisc()
|
||||||
end
|
end
|
||||||
|
|
||||||
function renderPlayButton()
|
function renderPlayButton()
|
||||||
paintutils.drawFilledBox(centerWidth - 3, centerHeight - 4, centerWidth + 2, centerHeight + 2, accentColor)
|
paintutils.drawFilledBox(centerWidth - 4, centerHeight - 4, centerWidth + 5, centerHeight + 3, accentColor)
|
||||||
-- paintutils.drawLine(centerWidth - 2, centerHeight - 3, centerWidth - 2, centerHeight + 1, buttonColor)
|
paintutils.drawFilledBox(centerWidth - 2, centerHeight - 3, centerWidth - 1, centerHeight + 1, buttonColor)
|
||||||
-- paintutils.drawLine(centerWidth - 1, centerHeight - 2, centerWidth - 1, centerHeight, buttonColor)
|
paintutils.drawFilledBox(centerWidth, centerHeight - 2, centerWidth + 1, centerHeight - 1, buttonColor)
|
||||||
-- paintutils.drawPixel(centerWidth + 1, centerHeight)
|
paintutils.drawPixel(centerWidth, centerHeight - 2, buttonColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
playDisc()
|
playDisc()
|
||||||
|
|
Loading…
Reference in a new issue