mirror of
				https://fem.mint.lgbt/m/Rhythmblock.git
				synced 2024-08-14 20:27:11 +00:00 
			
		
		
		
	documenting stuff
This commit is contained in:
		
							parent
							
								
									145f629963
								
							
						
					
					
						commit
						50e93193a8
					
				
					 3 changed files with 26 additions and 9 deletions
				
			
		
							
								
								
									
										23
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										23
									
								
								README.md
									
										
									
									
									
								
							| 
						 | 
					@ -1,7 +1,24 @@
 | 
				
			||||||
# Rhythmblock
 | 
					# Rhythmblock
 | 
				
			||||||
 | 
					
 | 
				
			||||||
a graphical music player for ComputerCraft
 | 
					
 | 
				
			||||||
 | 
					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
 | 
					status = defaultStatus -- Setting the value to the default
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while true do
 | 
					while true do
 | 
				
			||||||
    statusRender(status) 
 | 
					    statusRender(status) -- Renders the status
 | 
				
			||||||
    local eventData = {os.pullEvent()}
 | 
					    local eventData = {os.pullEvent()}
 | 
				
			||||||
    local event = eventData[1]
 | 
					    local event = eventData[1]
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
    if event == "mouse_up" 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 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
 | 
					                if playing == true then
 | 
				
			||||||
                        stopDisc()
 | 
					                        stopDisc()
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                        playDisc()
 | 
					                        playDisc()
 | 
				
			||||||
                end
 | 
					                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()
 | 
					                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.clear()
 | 
				
			||||||
                term.setCursorPos(1, 1)
 | 
					                term.setCursorPos(1, 1)
 | 
				
			||||||
                return true	
 | 
					                return true	
 | 
				
			||||||
	end
 | 
						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"
 | 
						local name = keys.getName(eventData[2]) or "unknown key"
 | 
				
			||||||
    	if name == "space" then
 | 
					    	if name == "space" then
 | 
				
			||||||
                if playing == true 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…
	
	Add table
		Add a link
		
	
		Reference in a new issue