Compare commits

...

21 Commits
v0.9 ... master

Author SHA1 Message Date
TheMrIron2 c6762927f4
Bugfix: "No such program" when returning to menu 2018-09-23 15:06:44 +01:00
TheMrIron2 cf3a09bb86
Bugfix: note player incorrectly exiting 2018-09-23 15:03:50 +01:00
TheMrIron2 47bbcb7c4d
Cleanup 2018-09-23 15:01:24 +01:00
TheMrIron2 27f69a0dcd
Cleanup, localized functions 2018-09-23 14:55:06 +01:00
TheMrIron2 4db07f804d
Cleanup, bug fixes 2018-09-23 14:53:46 +01:00
TheMrIron2 7164459985
Cleanup 2018-09-23 14:47:21 +01:00
TheMrIron2 9c1c46f9e3 Moved file to src/ 2018-01-19 20:30:20 +00:00
TheMrIron2 0d4f4e49f4
Create .test.lua 2018-01-19 20:28:51 +00:00
TheMrIron2 84086d8412 Tidying up
Don't get excited
2017-08-20 19:41:41 +01:00
TheMrIron2 2e09ab776a Update README.md 2016-06-01 13:39:52 +01:00
TheMrIron2 72c4517cda Merge pull request #5 from MultHub/patch-1
close security asshole
2016-05-14 19:42:18 +01:00
byte-chan™ 218e439092 close security hole 2016-05-12 15:33:39 +02:00
Funey 1fd3d4bd8f Update Settings 2016-04-10 00:40:21 +01:00
Funey d7dd3d0c8b Fixing a few bugs.
Fixed the line 49 bug where I didn't define a PROPER string for it to make a function, therefore causing the program to fail. Also done some cosmetic changes. All colours on the colour select screen MUST BE IN UK ENGLISH, to make things easier for ironei.
2016-04-10 00:36:25 +01:00
Funey ab2f0702c2 Update Desktop 2016-04-10 00:31:34 +01:00
Funey 99f92bf052 Compatibility with Settings
Added a way for the desktop to be able to read the settings applied by the end user, and also gave the program the right to be able to make a configuration if it cannot find a proper colour configuration.
2016-04-10 00:30:07 +01:00
Funey e3a1633f6e adding bugfixes 2016-04-09 20:45:19 +01:00
Funey 8d66e421a2 Commit for adding SECURITY
added a backend for the modifying desktop screen.
2016-04-09 20:39:09 +01:00
Funey 882db4a962 Commit #1
Adding this directly to the master branch because Mr_Iron2 requested it and I was bored. Here you go! I've not finished it yet / it's not functional but we'll finish it soon ._.
2016-04-08 23:56:00 +01:00
TheMrIron2 62c3cc7ebb Update Import 2015-11-07 10:36:02 +00:00
TheMrIron2 2f58a68f30 Update README.md 2015-11-07 10:21:30 +00:00
11 changed files with 179 additions and 114 deletions

View File

@ -1,4 +1,6 @@
# SmartPlay-3
# SmartPlay 3 has been terminated. Thank you to all fans of the SmartPlay line.
# 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, and a public stable release will be released if we think we should do it.
GitHub is the new home of SmartPlay 3. All updates of SP3 will be made here.

View File

@ -1,28 +0,0 @@
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

View File

@ -1,69 +0,0 @@
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
src/.test.lua Normal file
View File

@ -0,0 +1 @@
print("Hello SmartPlay")

View File

@ -2,17 +2,30 @@
-- 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()
function center(y,string)
local x = (w/2)-(#string/2)
term.setCursorPos(x,y)
print(string)
end
function drawMenu()
local function drawMenu()
term.setBackgroundColour(colours.blue)
term.setTextColour(colours.black)
term.setCursorPos(1,h-1)
@ -29,11 +42,11 @@ function drawMenu()
term.write(" Vinyl ")
end
function drawDesktop()
local function drawDesktop()
term.setBackgroundColour(colours.white)
term.clear()
term.setCursorPos(1,19)
term.setBackgroundColour(colours.grey)
term.setBackgroundColour(taskcol)
term.clearLine()
term.setCursorPos(1,1)
term.clearLine()
@ -41,12 +54,12 @@ function drawDesktop()
center(1,"SmartPlay 3")
term.setCursorPos(1,19)
term.setBackgroundColour(colours.white)
term.setTextColour(colours.black)
term.setTextColour(vercol)
line1 = "SmartPlay 3 v1"
line2 = "Insider Preview"
term.setCursorPos(w-#line1,17)
line2 = "v1.0"
term.setCursorPos(w-#line1+1,17)
write(line1)
term.setCursorPos(w-#line2,18)
term.setCursorPos(w-#line2+1,18)
write(line2)
term.setCursorPos(1,19)
term.setBackgroundColor(colors.green)
@ -76,6 +89,7 @@ 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

View File

@ -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)
fs.delete("/"..v) -- funride, did you just go full retard? that's basically rm *
end
end
shell.run("cp /disk/.flashUpdate/* /")

61
src/SP3/Settings Normal file
View File

@ -0,0 +1,61 @@
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

76
src/SP3/Vinyl.lua Normal file
View File

@ -0,0 +1,76 @@
-- 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

View File

@ -6,10 +6,18 @@ 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.911)
sleep(2)
shell.run("SP3/Desktop")