Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bar1 = paintutils.loadImage(".bar1")
- logo = paintutils.loadImage(".logo")
- icon = paintutils.loadImage(".icon")
- scrollbar = paintutils.loadImage(".scrollbar")
- scrollpoint1 = paintutils.loadImage(".scrollpoint1")
- scrollpoint2 = paintutils.loadImage(".scrollpoint2")
- tBarC = 8
- tBartC = 1
- backColor = 1
- scroll = 0
- --Desktop
- term.setBackgroundColor(backColor)
- term.clear()
- slc = 0
- function titleBar()
- term.setCursorPos(1,1)
- term.setBackgroundColor(tBarC)
- term.setTextColor(tBartC)
- term.clearLine()
- term.setCursorPos(3,1)
- print("[Begin]")
- end
- function drawDesktop()
- term.setBackgroundColor(backColor)
- term.clear()
- paintutils.drawImage(logo,1,1)
- paintutils.drawImage(icon,2,3)
- titleBar()
- end
- function drawMenu1()
- term.setTextColor(256)
- term.setBackgroundColor(128)
- term.setCursorPos(1,2)
- print(" ")
- term.setCursorPos(1,3)
- print(" Shop ")
- term.setCursorPos(1,4)
- print(" Reboot ")
- term.setCursorPos(1,5)
- print(" Desktop ")
- term.setCursorPos(1,6)
- print(" ")
- end
- function shop()
- slc = 2
- term.setCursorPos(1,1)
- term.setBackgroundColor(tBarC)
- term.setTextColor(tBartC)
- term.clearLine()
- term.setCursorPos(3,1)
- print("[List]")
- end
- function shoplist()
- slc = 3
- term.clear()
- term.setCursorPos(1,1)
- print("Item1")
- term.setCursorPos(1,2)
- print("Item2")
- end
- drawDesktop()
- while true do
- local event, button, X, Y = os.pullEventRaw()
- if slc == 0 then
- if event == "mouse_click" then
- if X >= 2 and X <= 8 and Y == 1 and button == 1 then
- drawMenu1()
- slc = 1
- elseif X >= 2 and X <= 5 and Y >= 3 and Y <= 9 and button == 1 then
- shell.run("file")
- elseif X >= 1 and Y >= 2 and button == 2 then slc = 2
- else
- drawDesktop()
- end
- end
- elseif slc == 1 then
- if X >= 1 and X <= 11 and button == 1 and Y == 3 then slc = 0
- shop()
- elseif X >= 1 and X <= 11 and Y == 4 and button == 1 then slc = 0
- os.reboot()
- elseif X >= 1 and X <= 11 and Y == 5 and button == 1 then slc = 0
- drawDesktop()
- else slc = 0
- drawDesktop()
- end
- elseif slc == 2 then
- if X >= 1 and X <= 11 and Y == 1 and button == 1 then slc = 1
- shoplist()
- else slc = 0
- drawDesktop()
- end
- elseif slc == 3 then
- if X >= 1 and X <= 15 and Y == 1 and button == 1 then slc = 3
- rednet.send(13, "1")
- elseif X >= 48 and X <= 49 and Y == 18 and button == 1 then slc = 3
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement