mirror of
https://fem.mint.lgbt/m/Rhythmblock.git
synced 2024-08-14 20:27:11 +00:00
rebranding and new stuff!
This commit is contained in:
parent
0595761566
commit
196833527c
2 changed files with 64 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
# neodj
|
# Rhythmblock
|
||||||
|
|
||||||
a GUI version of the dj command in ComputerCraft
|
a GUI version of the dj command in ComputerCraft
|
||||||
|
|
||||||
|
## WIP
|
||||||
|
|
||||||
|
as of now this is not finished, but fast progress is being made!
|
||||||
|
|
58
rhythmblock.lua
Normal file
58
rhythmblock.lua
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
accentColor = colors.gray
|
||||||
|
buttonColor = colors.lightGray
|
||||||
|
backgroundColor = colors.black
|
||||||
|
|
||||||
|
width, height = term.getSize()
|
||||||
|
centerWidth = math.round(width / 2)
|
||||||
|
centerHeight = math.round(width / 2)
|
||||||
|
peripherals = peripheral.getNames()
|
||||||
|
playing = false
|
||||||
|
if #peripherals < 0 then
|
||||||
|
print "No drive"
|
||||||
|
else
|
||||||
|
driveCount = 0
|
||||||
|
for n = 1, #peripherals do
|
||||||
|
local driveCheck = peripherals[n]
|
||||||
|
if peripheral.getType(driveCheck) == "drive" then
|
||||||
|
drive = driveCheck
|
||||||
|
driveCount = driveCount + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if driveCount > 1 then
|
||||||
|
print("Too many disk drives. Specify where the disk drive is with the argument -d")
|
||||||
|
os.exit()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
status = ""
|
||||||
|
|
||||||
|
function playDisc()
|
||||||
|
|
||||||
|
if disk.isPresent(drive) and disk.hasAudio(drive) then
|
||||||
|
disk.playAudio(drive)
|
||||||
|
status = disk.getAudioTitle(drive)
|
||||||
|
playing = true
|
||||||
|
elseif disk.isPresent(drive) then
|
||||||
|
print "Not a music disc"
|
||||||
|
else
|
||||||
|
print "No disc"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ejectDisc()
|
||||||
|
disk.eject()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function stopDisc()
|
||||||
|
if playing == true then
|
||||||
|
disk.stopAudio()
|
||||||
|
status = "Rhythmblock 0.0.1a"
|
||||||
|
else
|
||||||
|
status = "No disc is playing"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function renderPlayButton()
|
||||||
|
paintutils.drawFilledBox(centerWidth - 5, centerHeight - 5, centerWidth + 5, centerHeight + 5 accentColor)
|
||||||
|
end
|
Loading…
Reference in a new issue