Compare commits
No commits in common. "master" and "v0.9" have entirely different histories.
|
@ -1,6 +1,4 @@
|
|||
# SmartPlay 3 has been terminated. Thank you to all fans of the SmartPlay line.
|
||||
|
||||
# SmartPlay 3
|
||||
# SmartPlay-3
|
||||
SmartPlay 3 is the next generation of Music Players.
|
||||
|
||||
GitHub is the new home of SmartPlay 3. All updates of SP3 will be made here.
|
||||
GitHub is the new home of SmartPlay 3. All updates of SP3 will be made here, and a public stable release will be released if we think we should do it.
|
||||
|
|
|
@ -2,30 +2,17 @@
|
|||
-- Original Idea by Gonow32
|
||||
-- Coded by CathrodeRayTube and Mr_Iron2
|
||||
|
||||
-- Initialise Color Changing
|
||||
if not fs.exists("/.taskcol") then
|
||||
f = fs.open("/.taskcol","w")
|
||||
f.writeLine(colours.grey)
|
||||
f.close()
|
||||
end
|
||||
if not fs.exists("/.vercol") then
|
||||
f = fs.open("/.vercol","w")
|
||||
f.writeLine(colours.black)
|
||||
f.close()
|
||||
end
|
||||
|
||||
f = fs.open("/.taskcol","r")
|
||||
taskcol = tonumber(f.readLine())
|
||||
f.close()
|
||||
f = fs.open("/.vercol","r")
|
||||
vercol = tonumber(f.readLine())
|
||||
f.close()
|
||||
|
||||
-- Functions
|
||||
|
||||
local w, h = term.getSize()
|
||||
|
||||
local function drawMenu()
|
||||
function center(y,string)
|
||||
local x = (w/2)-(#string/2)
|
||||
term.setCursorPos(x,y)
|
||||
print(string)
|
||||
end
|
||||
|
||||
function drawMenu()
|
||||
term.setBackgroundColour(colours.blue)
|
||||
term.setTextColour(colours.black)
|
||||
term.setCursorPos(1,h-1)
|
||||
|
@ -42,11 +29,11 @@ local function drawMenu()
|
|||
term.write(" Vinyl ")
|
||||
end
|
||||
|
||||
local function drawDesktop()
|
||||
function drawDesktop()
|
||||
term.setBackgroundColour(colours.white)
|
||||
term.clear()
|
||||
term.setCursorPos(1,19)
|
||||
term.setBackgroundColour(taskcol)
|
||||
term.setBackgroundColour(colours.grey)
|
||||
term.clearLine()
|
||||
term.setCursorPos(1,1)
|
||||
term.clearLine()
|
||||
|
@ -54,12 +41,12 @@ local function drawDesktop()
|
|||
center(1,"SmartPlay 3")
|
||||
term.setCursorPos(1,19)
|
||||
term.setBackgroundColour(colours.white)
|
||||
term.setTextColour(vercol)
|
||||
term.setTextColour(colours.black)
|
||||
line1 = "SmartPlay 3 v1"
|
||||
line2 = "v1.0"
|
||||
term.setCursorPos(w-#line1+1,17)
|
||||
line2 = "Insider Preview"
|
||||
term.setCursorPos(w-#line1,17)
|
||||
write(line1)
|
||||
term.setCursorPos(w-#line2+1,18)
|
||||
term.setCursorPos(w-#line2,18)
|
||||
write(line2)
|
||||
term.setCursorPos(1,19)
|
||||
term.setBackgroundColor(colors.green)
|
||||
|
@ -89,7 +76,6 @@ while true do
|
|||
elseif x >= 1 and x <= 8 and y == h - 4 and menu == 1 then
|
||||
shell.run("/SP3/note")
|
||||
menu = 0
|
||||
break
|
||||
elseif x >= 1 and x <= 8 and y == h - 5 and menu == 1 then
|
||||
shell.run("/SP3/Info")
|
||||
elseif x >= 1 and x <= 8 and y == h - 6 and menu == 1 then
|
|
@ -25,7 +25,7 @@ while true do local evt, button, x, y = os.pullEvent("mouse_click")
|
|||
elseif v == "disk" then
|
||||
elseif v == "moarp" then
|
||||
else
|
||||
fs.delete("/"..v) -- funride, did you just go full retard? that's basically rm *
|
||||
fs.delete("/"..v)
|
||||
end
|
||||
end
|
||||
shell.run("cp /disk/.flashUpdate/* /")
|
|
@ -0,0 +1,28 @@
|
|||
function center(y,string)
|
||||
local w,h = term.getSize()
|
||||
local x = (w/2)-(#string/2)
|
||||
term.setCursorPos(x,y)
|
||||
print(string)
|
||||
end
|
||||
|
||||
function render()
|
||||
term.setBackgroundColour(colours.blue)
|
||||
term.setTextColour(colours.white)
|
||||
term.clear()
|
||||
center(2,"System Settings")
|
||||
term.setBackgroundColour(colours.red)
|
||||
center(4," Customise Desktop ")
|
||||
center(6," Modify System Files ")
|
||||
center(8,"When in System Files, type 'exit' to")
|
||||
center(9,"return to Settings.")
|
||||
term.setBackgroundColour(colours.grey)
|
||||
center(14," Click here to quit ")
|
||||
end render()
|
||||
|
||||
while true do
|
||||
local evt, button, x, y = os.pullEvent("mouse_click")
|
||||
if y == 4 then shell.run("edit SP3/Desktop") render()
|
||||
elseif y == 6 then term.clear() term.setCursorPos(1,1) shell.run("shell") render()
|
||||
elseif y == 14 then shell.run("SP3/Desktop")
|
||||
else end
|
||||
end
|
|
@ -0,0 +1,69 @@
|
|||
function center(y,string)
|
||||
local w,h = term.getSize()
|
||||
local x = (w/2)-(#string/2)
|
||||
term.setCursorPos(x,y)
|
||||
print(string)
|
||||
end
|
||||
|
||||
term.setBackgroundColour(colours.grey)
|
||||
term.setTextColour(colours.white)
|
||||
term.clear()
|
||||
term.setBackgroundColour(colours.white)
|
||||
term.setTextColour(colours.blue)
|
||||
term.setCursorPos(1,1)
|
||||
term.clearLine()
|
||||
center(1,"SmartPlay 3")
|
||||
term.setBackgroundColour(colours.grey)
|
||||
term.setTextColour(colours.white)
|
||||
center(8,"Please insert disc.")
|
||||
center(17," Click here to Exit ")
|
||||
|
||||
while true do local evt, button, x, y = os.pullEvent("mouse_click")
|
||||
if y == 17 then shell.run("SP3/Desktop")
|
||||
else
|
||||
function loading() term.clear() end
|
||||
|
||||
while true do if disk.hasAudio("right") then loading()
|
||||
center(7,"Song Title:")
|
||||
disk.playAudio("right")
|
||||
center(9,disk.getAudioTitle("right"))
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
elseif disk.hasAudio("bottom") then term.clear()
|
||||
center(7,"Song Title:")
|
||||
center(8,disk.getAudioTitle("bottom"))
|
||||
disk.playAudio("bottom")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
elseif disk.hasAudio("left") then term.clear()
|
||||
center(7,"Song Title:")
|
||||
center(9,disk.getAudioTitle("left"))
|
||||
disk.playAudio("bottom")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
elseif disk.hasAudio("top") then term.clear()
|
||||
center(7,"Song Title:")
|
||||
term.setCursorPos(19,8)
|
||||
center(9,disk.getAudioTitle("left"))
|
||||
disk.playAudio("top")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
|
||||
function start()
|
||||
term.clear()
|
||||
center(7,"Song Title:")
|
||||
end
|
||||
elseif disk.hasAudio("back") then start()
|
||||
center(9,disk.getAudioTitle("back"))
|
||||
disk.playAudio("back")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
elseif disk.hasAudio("front") then start()
|
||||
center(9,disk.getAudioTitle("front"))
|
||||
disk.playAudio("front")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
else end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1 +0,0 @@
|
|||
print("Hello SmartPlay")
|
|
@ -1,61 +0,0 @@
|
|||
local function render()
|
||||
term.setBackgroundColour(colours.blue)
|
||||
term.setTextColour(colours.white)
|
||||
term.clear()
|
||||
center(2,"System Settings")
|
||||
term.setBackgroundColour(colours.red)
|
||||
center(4," Customise Desktop ")
|
||||
center(6," Modify System Files ")
|
||||
center(8,"When in System Files, type 'exit' to")
|
||||
center(9,"return to Settings.")
|
||||
term.setBackgroundColour(colours.grey)
|
||||
center(14," Click here to quit ")
|
||||
end
|
||||
render()
|
||||
|
||||
local function deskrender()
|
||||
term.setBackgroundColor(colors.blue)
|
||||
term.setTextColor(colors.white)
|
||||
term.clear()
|
||||
center(2,"Desktop Settings")
|
||||
term.setBackgroundColor(colors.red)
|
||||
center(4," Taskbar Colour ")
|
||||
center(6," Version Text Colour")
|
||||
term.setBackgroundColor(colors.gray)
|
||||
center(14," Click here to go back. ")
|
||||
end
|
||||
|
||||
while true do
|
||||
local evt, button, x, y = os.pullEvent("mouse_click")
|
||||
if y == 4 then
|
||||
deskrender()
|
||||
a = 1
|
||||
while a == 1 do
|
||||
ev = {os.pullEvent("mouse_click")}
|
||||
if ev[4] == 4 then
|
||||
term.clear()
|
||||
term.setCursorPos(1,1)
|
||||
write("New colour: ")
|
||||
color = read()
|
||||
--f = fs.open("/.taskcol","w")
|
||||
--a = "" BugFix #1: Oh no, I overwrote the while loop lock.
|
||||
local f = fs.open(".taskcol", "w")
|
||||
f.write(colours[color] or colors[color]) -- do not care
|
||||
f.close()
|
||||
elseif ev[4] == 6 then
|
||||
term.clear()
|
||||
term.setCursorPos(1,1)
|
||||
write("New colour: ")
|
||||
color = read()
|
||||
local f = fs.open(".vercol", "w")
|
||||
f.write(colours[color] or colors[color]) -- do not care
|
||||
f.close()
|
||||
elseif ev[4] == 14 then
|
||||
a = 0
|
||||
end
|
||||
end
|
||||
render()
|
||||
elseif y == 6 then term.clear() term.setCursorPos(1,1) shell.run("shell") render()
|
||||
elseif y == 14 then shell.run("SP3/Desktop")
|
||||
else end
|
||||
end
|
|
@ -1,76 +0,0 @@
|
|||
-- GUI
|
||||
|
||||
term.setBackgroundColour(colours.grey)
|
||||
term.setTextColour(colours.white)
|
||||
term.clear()
|
||||
term.setBackgroundColour(colours.white)
|
||||
term.setTextColour(colours.blue)
|
||||
term.setCursorPos(1,1)
|
||||
term.clearLine()
|
||||
center(1,"SmartPlay 3")
|
||||
term.setBackgroundColour(colours.grey)
|
||||
term.setTextColour(colours.white)
|
||||
center(8, "Please insert disc.")
|
||||
--center(9, "If nothing happens, click here.")
|
||||
center(17," Click here to Exit ")
|
||||
|
||||
while true do local evt, button, x, y = os.pullEvent("mouse_click")
|
||||
if y == 17 then shell.run("/SP3/Desktop")
|
||||
else
|
||||
|
||||
while true do
|
||||
|
||||
if disk.hasAudio("right") then
|
||||
term.clear()
|
||||
center(7,"Song Title:")
|
||||
disk.playAudio("right")
|
||||
center(9,disk.getAudioTitle("right"))
|
||||
sleep(360) -- todo: better way of working out running time?
|
||||
os.shutdown()
|
||||
|
||||
elseif disk.hasAudio("bottom") then -- todo: proper "if i, v in pairs" solution
|
||||
term.clear()
|
||||
center(7,"Song Title:")
|
||||
center(8,disk.getAudioTitle("bottom"))
|
||||
disk.playAudio("bottom")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
|
||||
elseif disk.hasAudio("left") then
|
||||
term.clear()
|
||||
center(7,"Song Title:")
|
||||
center(9,disk.getAudioTitle("left"))
|
||||
disk.playAudio("bottom")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
|
||||
elseif disk.hasAudio("top") then
|
||||
term.clear()
|
||||
center(7,"Song Title:")
|
||||
term.setCursorPos(19,8)
|
||||
center(9,disk.getAudioTitle("top"))
|
||||
disk.playAudio("top")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
|
||||
elseif disk.hasAudio("back") then
|
||||
term.clear()
|
||||
center(7,"Song Title:")
|
||||
center(9,disk.getAudioTitle("back"))
|
||||
disk.playAudio("back")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
|
||||
elseif disk.hasAudio("front") then
|
||||
term.clear()
|
||||
center(7,"Song Title:")
|
||||
center(9,disk.getAudioTitle("front"))
|
||||
disk.playAudio("front")
|
||||
sleep(360)
|
||||
os.shutdown()
|
||||
|
||||
else
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -6,18 +6,10 @@ function centerSlow(y,string)
|
|||
textutils.slowPrint(string,27)
|
||||
end
|
||||
|
||||
function center(y,string)
|
||||
local w,h = term.getSize()
|
||||
local x = (w/2)-(#string/2)
|
||||
term.setCursorPos(x,y)
|
||||
print(string)
|
||||
end
|
||||
|
||||
term.setBackgroundColour(colours.grey)
|
||||
term.setTextColour(colours.white)
|
||||
term.clear()
|
||||
centerSlow(3,"Welcome to SmartPlay 3.")
|
||||
sleep(0.25)
|
||||
centerSlow(4,"It's like music to your ears.")
|
||||
sleep(2)
|
||||
sleep(2.911)
|
||||
shell.run("SP3/Desktop")
|
Loading…
Reference in New Issue