Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Vars
- build = 3
- --Functions
- function drawMenu()
- os.sleep(0.1)
- while true do
- term.setBackgroundColor(colors.white)
- term.clear()
- drawBackgroundDesktop(1, 3)
- paintutils.drawLine(1, 1, screenX, 1, colors.blue)
- term.setTextColor(colors.black)
- term.setCursorPos(1, 1)
- print("[Programs]")
- local event, button, x ,y = os.pullEvent("mouse_click")
- if event == "mouse_click" then
- if x >= 1 and x <= 9 then
- if y == 1 then
- paintutils.drawLine(1, 1, 6, 1, colors.lightBlue)
- paintutils.drawLine(1, 2, 8, 2, colors.lightBlue)
- paintutils.drawLine(1, 3, 8, 3, colors.lightBlue)
- paintutils.drawLine(1, 4, 8, 4, colors.lightBlue)
- paintutils.drawLine(1, 5, 8, 4, colors.lightBlue)
- term.setCursorPos(1, 1)
- print("[Programs]")
- print("File Browser")
- print("Taco")
- print("Paint")
- print("[Home]")
- b = false
- local event, button, x, y = os.pullEvent("mouse_click")
- if event == "mouse_click" then
- if x >= 1 and x <= 8 then
- term.setBackgroundColor(colors.white)
- term.clear()
- paintutils.drawLine(1, 1, screenX, 1, colors.blue)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- if y == 2 then
- shell.run("gliese/gfb")
- elseif y == 3 then
- shell.run("gliese/taco")
- elseif y == 4 then
- print("You Must enter a Filename Before you can start Painting.")
- write("Filename: ")
- cmd =read()
- shell.run("paint", cmd)
- elseif y == 5 then
- break
- end
- end
- end
- end
- end
- end
- end
- end
- function drawCloseMenu()
- os.sleep(0.1)
- while true do
- paintutils.drawLine(1, 1, screenX, 1, colors.blue)
- term.setCursorPos(1, 7)
- term.setTextColor(colors.black)
- print("[Close]")
- _, but, x, y = os.pullEvent("mouse_click")
- if x >= 1 and x <=7 then
- if y == 1 then
- break
- end
- end
- end
- end
- function closeMenu()
- term.clear()
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x >= 12 and x <= 7 then
- if y == 1 then
- break
- end
- end
- end
- end
- function drawBackgroundDesktop(x, y)
- drawBackground = paintutils.loadImage("/gliese/sysfiles/background")
- paintutils.drawImage(drawBackground, x, y)
- end
- screenX, screenY = term.getSize()
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setCursorPos(1, 1)
- os.sleep(0.1)
- while true do
- term.setBackgroundColor(colors.white)
- term.clear()
- drawBackgroundDesktop(1, 3)
- paintutils.drawLine(1, 1, screenX, 1, colors.blue)
- term.setTextColor(colors.black)
- term.setCursorPos(1, 1)
- print("[Menu]")
- local event, button, x, y = os.pullEvent("mouse_click")
- if event == "mouse_click" then
- if x >= 1 and x <= 6 then
- if y == 1 then
- paintutils.drawLine(1, 1, 6, 1, colors.lightBlue)
- paintutils.drawLine(1, 2, 8, 2, colors.lightBlue)
- paintutils.drawLine(1, 3, 8, 4, colors.lightBlue)
- paintutils.drawLine(1, 4, 8, 4, colors.lightBlue)
- paintutils.drawLine(1, 5, 8, 5, colors.lightBlue)
- paintutils.drawLine(1, 6, 8, 6, colors.lightBlue)
- paintutils.drawLine(1, 7, 8, 7, colors.lightBlue)
- term.setCursorPos(1, 1)
- print("[Menu]")
- print("Run")
- print("Shell")
- print("Shutdown")
- print("Restart")
- print("Settings")
- print("[Programs]")
- b = false
- local event, button, x, y = os.pullEvent("mouse_click")
- if event == "mouse_click" then
- if x >= 1 and x <= 8 then
- term.setBackgroundColor(colors.white)
- term.clear()
- paintutils.drawLine(1, 1, screenX, 1, colors.blue)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- if y == 2 then -- run
- term.setCursorPos(1, 3)
- print("Run")
- cmd = read()
- shell.run(cmd)
- elseif y == 3 then
- term.setCursorPos(1, 4)
- print("Shell")
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setTextColor(colors.white)
- term.setCursorPos(1, 1)
- print("Gliese OS Beta 2")
- print("Type help for help.")
- while true do
- write(">")
- sr = read()
- if sr == "exit" then
- break
- elseif sr == "help" then
- print("Help -- Print this help list.")
- print("Exit -- exit the shell.")
- print("clrs -- Clears the screen")
- print("edit -- edits a file..")
- print("cd -- changes the directory/folder")
- print("mkdir -- makes a directory/folder")
- print("delete -- deletes a file or a folder/directory")
- print("cp -- Copies a file or folder")
- print("move -- moves a folder.")
- elseif sr == "clrs" then
- term.clear()
- term.setCursorPos(1, 1)
- print("Gliese OS Dev2")
- print("Type help for help.")
- else
- shell.run(sr)
- end
- end
- elseif y == 4 then
- term.setCursorPos(1, 6)
- print("Shutdown")
- while true do
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.setCursorPos(1, 1)
- print("Shutting Down the computer..")
- os.sleep(2)
- os.shutdown()
- end
- elseif y == 5 then
- term.setCursorPos(1, 7)
- print("Restart")
- os.reboot()
- elseif y == 6 then
- term.setTextColor(colors.black)
- term.setCursorPos(4, 3)
- print("Coming Soon!")
- drawCloseMenu()
- elseif y == 7 then
- term.setTextColor(colors.black)
- drawMenu()
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement