fix button render (i'm an idiot)

This commit is contained in:
Lux Aliaga 2021-05-07 00:48:14 -04:00
parent 8835535dba
commit d17f78e679

View file

@ -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,7 +38,6 @@ 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)
@ -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()