Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --GUI
- slc = 0
- local function fixtext()
- term.setTextColor(colors.white)
- end
- local function desktop()
- --image fixer
- term.setBackgroundColor(colors.white)
- term.clear()
- --indicators
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1, 1)
- write("[ Menu ] 12:00")
- write(" ")
- --Desktop image
- image = paintutils.loadImage("wallpaper")
- paintutils.drawImage(image, 1, 2)
- term.setCursorPos(1, 1)
- end
- function tmenu()
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1,2)
- print("Applications")
- term.setCursorPos(1,3)
- print(" Shutdown ")
- term.setCursorPos(1,4)
- print(" Restart ")
- term.setCursorPos(1,5)
- print(" Settings ")
- term.setCursorPos(1,6)
- print(" LogOut ")
- end
- fixtext()
- desktop()
- while true do
- local event, button, X, Y = os.pullEventRaw()
- if slc == 0 then
- if event == "mouse_click" then
- if X >=2 and X <=12 and Y==1 and button ==1 then
- slc = 1
- tmenu()
- elseif X>=2 and X <=12 and Y==1 and button ==1 then
- slc = 2
- else
- desktop()
- end
- end
- elseif slc == 1 then
- if X>=1 and X<=12 and Y==2 and button ==1 then slc = 0
- shell.run("/tde/applications")
- elseif X >=1 and X <=12 and button == 1 and Y== 3 then slc = 0
- os.shutdown()
- elseif X>=1 and X<=12 and Y==4 and button ==1 then slc = 0
- os.reboot()
- elseif X>=1 and X<=12 and Y==6 and button ==1 then slc = 0
- shell.run("/tde/tdm")
- else
- slc = 0
- desktop()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement