mirror of
https://fem.mint.lgbt/m/Rhythmblock.git
synced 2024-08-14 20:27:11 +00:00
changed status stuff to variables and beginning to work on GUI
This commit is contained in:
parent
80b58e4648
commit
d85c57d3ea
1 changed files with 18 additions and 8 deletions
|
@ -19,12 +19,17 @@ else
|
|||
end
|
||||
end
|
||||
if driveCount > 1 then
|
||||
print("Too many disk drives. Specify where the disk drive is with the argument -d")
|
||||
print("Too many disk drives. Specify where the disk drive is by running Rhythmblock with the argument")
|
||||
os.exit()
|
||||
end
|
||||
end
|
||||
|
||||
status = ""
|
||||
defaultStatus = "Rhythmblock 0.0.1a"
|
||||
invalidFormatStatus = "Not a music disc"
|
||||
noDiscStatus = "No disc"
|
||||
notPlayingStatus ="No disc playing"
|
||||
noDiscInDriveStatus = "No disc in drive"
|
||||
status = defaultStatus
|
||||
|
||||
function playDisc()
|
||||
|
||||
|
@ -33,26 +38,31 @@ function playDisc()
|
|||
status = disk.getAudioTitle(drive)
|
||||
playing = true
|
||||
elseif disk.isPresent(drive) then
|
||||
print "Not a music disc"
|
||||
status = "Not a music disc"
|
||||
else
|
||||
print "No disc"
|
||||
print("No disc")
|
||||
end
|
||||
end
|
||||
|
||||
function ejectDisc()
|
||||
disk.eject()
|
||||
|
||||
end
|
||||
|
||||
function stopDisc()
|
||||
if playing == true then
|
||||
disk.stopAudio()
|
||||
status = "Rhythmblock 0.0.1a"
|
||||
playing = 0
|
||||
status = defaultStatus
|
||||
else
|
||||
status = "No disc is playing"
|
||||
end
|
||||
end
|
||||
|
||||
function renderPlayButton()
|
||||
paintutils.drawFilledBox(centerWidth - 5, centerHeight - 5, centerWidth + 5, centerHeight + 5 accentColor)
|
||||
end
|
||||
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)
|
||||
end
|
||||
|
||||
renderPlayButton()
|
||||
|
|
Loading…
Reference in a new issue