documenting stuff
This commit is contained in:
parent
145f629963
commit
50e93193a8
23
README.md
23
README.md
|
@ -1,7 +1,24 @@
|
|||
# Rhythmblock
|
||||
|
||||
a graphical music player for ComputerCraft
|
||||
![Rhythmblock playing Cat by C418](screenshot.png)
|
||||
a graphical, customizable music player for ComputerCraft
|
||||
|
||||
## WIP
|
||||
## Features
|
||||
|
||||
as of now this is not finished, but fast progress is being made!
|
||||
- easily customizable
|
||||
- compatible with all placeable computers and all monitors
|
||||
- keyboard support
|
||||
- eject discs directly from the player
|
||||
- status bar
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
space - play/stop
|
||||
e - eject
|
||||
q - quit
|
||||
|
||||
## Install
|
||||
|
||||
run the following on the desired CC computer
|
||||
|
||||
`wget https://fem.mint.lgbt/m/Rhythmblock/raw/branch/master/rhythmblock.lua Rhythmblock`
|
||||
|
|
|
@ -142,25 +142,25 @@ buttonRender(false)
|
|||
status = defaultStatus -- Setting the value to the default
|
||||
|
||||
while true do
|
||||
statusRender(status)
|
||||
statusRender(status) -- Renders the status
|
||||
local eventData = {os.pullEvent()}
|
||||
local event = eventData[1]
|
||||
|
||||
if event == "mouse_up" then
|
||||
if eventData[2] == 1 and eventData[3] >= centerWidth - 4 and eventData[4] >= centerHeight - 4 and eventData[3] <= centerWidth + 4 and eventData[4] <= centerHeight + 2 then
|
||||
if event == "mouse_up" then -- If the event triggered is the mouse clicking it'll do what's next
|
||||
if eventData[2] == 1 and eventData[3] >= centerWidth - 4 and eventData[4] >= centerHeight - 4 and eventData[3] <= centerWidth + 4 and eventData[4] <= centerHeight + 2 then -- If the user clicks on the play/stop button it'll begin playing the disc
|
||||
if playing == true then
|
||||
stopDisc()
|
||||
else
|
||||
playDisc()
|
||||
end
|
||||
elseif eventData[2] == 1 and eventData[3] >= centerWidth - 2 and eventData[4] >= centerHeight + 4 and eventData[3] <= centerWidth + 2 and eventData[4] <= centerHeight + 4 then
|
||||
elseif eventData[2] == 1 and eventData[3] >= centerWidth - 2 and eventData[4] >= centerHeight + 4 and eventData[3] <= centerWidth + 2 and eventData[4] <= centerHeight + 4 then -- If the user clicks on the eject button it'll eject the disc
|
||||
ejectDisc()
|
||||
elseif eventData[2] == 1 and eventData[3] == width and eventData[4] == 1 then
|
||||
elseif eventData[2] == 1 and eventData[3] == width and eventData[4] == 1 then -- If the user presses the X it'll quit
|
||||
term.clear()
|
||||
term.setCursorPos(1, 1)
|
||||
return true
|
||||
end
|
||||
elseif event == "key_up" then
|
||||
elseif event == "key_up" then -- Same order but now with keys
|
||||
local name = keys.getName(eventData[2]) or "unknown key"
|
||||
if name == "space" then
|
||||
if playing == true then
|
||||
|
|
BIN
screenshot.png
Normal file
BIN
screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 188 KiB |
Loading…
Reference in a new issue