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()
|
||||
centerWidth = round(width / 2)
|
||||
centerHeight = round(width / 2)
|
||||
centerHeight = round(height / 2)
|
||||
peripherals = peripheral.getNames()
|
||||
playing = false
|
||||
if #peripherals < 0 then
|
||||
|
@ -38,8 +38,7 @@ noDiscInDriveStatus = "No disc in drive"
|
|||
status = defaultStatus
|
||||
|
||||
function playDisc()
|
||||
|
||||
if disk.isPresent(drive) and disk.hasAudio(drive) then
|
||||
if disk.isPresent(drive) and disk.hasAudio(drive) then
|
||||
disk.playAudio(drive)
|
||||
status = disk.getAudioTitle(drive)
|
||||
playing = true
|
||||
|
@ -65,10 +64,10 @@ function stopDisc()
|
|||
end
|
||||
|
||||
function renderPlayButton()
|
||||
paintutils.drawFilledBox(centerWidth - 3, centerHeight - 4, centerWidth + 2, centerHeight + 2, accentColor)
|
||||
-- paintutils.drawLine(centerWidth - 2, centerHeight - 3, centerWidth - 2, centerHeight + 1, buttonColor)
|
||||
-- paintutils.drawLine(centerWidth - 1, centerHeight - 2, centerWidth - 1, centerHeight, buttonColor)
|
||||
-- paintutils.drawPixel(centerWidth + 1, centerHeight)
|
||||
paintutils.drawFilledBox(centerWidth - 4, centerHeight - 4, centerWidth + 5, centerHeight + 3, accentColor)
|
||||
paintutils.drawFilledBox(centerWidth - 2, centerHeight - 3, centerWidth - 1, centerHeight + 1, buttonColor)
|
||||
paintutils.drawFilledBox(centerWidth, centerHeight - 2, centerWidth + 1, centerHeight - 1, buttonColor)
|
||||
paintutils.drawPixel(centerWidth, centerHeight - 2, buttonColor)
|
||||
end
|
||||
|
||||
playDisc()
|
||||
|
|
Loading…
Reference in a new issue