Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function default()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- end
- -- this is test version of tde-menu configuration
- local function searchApps()
- if fs.exists("tde-programs-cfg") then
- file = fs.open("tde-programs-cfg", "r")
- a = file.readLine()
- if a == "1" then
- a = 1
- elseif a == "2" then
- a = 2
- elseif a == "3" then
- a = 3
- elseif a == "4" then
- a = 4
- elseif a == "5" then
- a = 5
- else
- a = 0
- end
- i = 0
- progg = {}
- while i <= a do
- i = i + 1
- if a ~= 0 then
- progg[i] = file.readLine()
- end
- if (i == a) or (a == 0) then
- break
- end
- end
- os.loadAPI("advPrint")
- while true do
- default()
- term.clear()
- advPrint.tout(1, "X [Menu]")
- default()
- i = 0
- while --[[progg[i] ~= nil not good thing]] true do
- i = i + 1
- if i == 1 then
- advPrint.tout(i + 2, " "..progg[i])
- elseif i == a + 1 then
- break
- elseif i ~= 1 then
- print(" "..progg[i])
- elseif i == a then
- break
- end
- end
- i = 1
- local event, button, X, Y = os.pullEventRaw()
- if event == "mouse_click" then
- if a == 1 then
- if X >= 3 and X <= 13 and Y == 1 + 2 then
- term.clear()
- term.setCursorPos(1, 1)
- shell.run(progg[i])
- elseif X == 1 and Y == 1 then
- break
- end
- elseif a == 2 then
- if X >= 3 and X <= 13 and Y == 1 + 2 then
- term.clear()
- term.setCursorPos(1, 1)
- shell.run(progg[1])
- elseif X >= 3 and X <= 13 and Y == 2+2 then
- term.clear()
- term.setCursorPos(1, 1)
- shell.run(progg[2])
- elseif X == 1 and Y == 1 then
- break
- end
- end
- i = i + 1
- end
- end
- end
- end
- if not fs.exists("tde-programs-cfg") then
- default()
- term.clear()
- icon1 = paintutils.loadImage("tde-redstone-icon")
- icon2 = paintutils.loadImage("tde-photospace-icon")
- os.loadAPI("advPrint")
- while true do
- default()
- term.clear()
- advPrint.tout(1, "X [Menu]")
- paintutils.drawImage(icon1, 3, 3)
- default()
- paintutils.drawImage(icon2, 15, 3)
- term.setCursorPos(15, 10)
- term.setBackgroundColor(colors.white)
- write("tde photos")
- advPrint.tout(10, " Redstone")
- local event, button, X, Y = os.pullEventRaw()
- if event == "mouse_click" then
- if X == 1 and Y == 1 then
- break
- elseif X >= 3 and Y >= 3 and X <= 3 + 8 and Y <= 3 + 5 then
- shell.run("tde-redstone")
- elseif X >= 15 and X <= 15 + 8 and Y >= 3 and Y <= 10 then
- shell.run("tde-photospace")
- end
- end
- end
- else
- searchApps()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement