View difference between Paste ID: Svvc5hv7 and pckLq8kq
SHOW: | | - or go back to the newest paste.
1
--GUI
2
slc = 0
3
4
local function fixtext()
5
term.setTextColor(colors.white)
6
end
7
8
local function desktop()
9
--image fixer
10
term.setBackgroundColor(colors.white)
11
term.clear()
12
--indicators
13
term.setBackgroundColor(colors.black)
14
term.setCursorPos(1, 1)
15
write("[   Menu   ]                               12:00")
16
write("                                                   ")
17
--Desktop image
18
image = paintutils.loadImage("wallpaper")
19
paintutils.drawImage(image, 1, 2)
20
term.setCursorPos(1, 1)
21
end
22
23
24
function tmenu()
25
term.setBackgroundColor(colors.black)
26
term.setCursorPos(1,2)
27
print("Applications")
28
term.setCursorPos(1,3)
29
print("  Shutdown  ")
30
term.setCursorPos(1,4)
31
print("  Restart   ")
32
term.setCursorPos(1,5)
33
print("  Settings  ")
34
term.setCursorPos(1,6)
35
print("   LogOut   ")
36
end
37
38
fixtext()
39
desktop()
40
while true do
41
local event, button, X, Y = os.pullEventRaw()
42
  if slc == 0 then
43
    if event == "mouse_click" then
44
      if X >=2 and X <=12 and Y==1 and button ==1 then
45
      slc = 1
46
      tmenu()
47
        elseif X>=2 and X <=12 and Y==1 and button ==1 then
48
        slc = 2
49
        else
50
        desktop()
51
      end
52
     end
53
   elseif slc == 1 then
54
     if X>=1 and X<=12 and Y==2 and button ==1 then slc = 0
55
       shell.run("/tde/applications")
56
       elseif X >=1 and X <=12 and button == 1 and Y== 3 then slc = 0
57
       os.shutdown()
58
       elseif X>=1 and X<=12 and Y==4 and button ==1 then slc = 0
59
       os.reboot()
60
       elseif X>=1 and X<=12 and Y==6 and button ==1 then slc = 0
61
       shell.run("/tde/tdm")
62
       else
63
       slc = 0
64
       desktop()
65
       end
66
67
        end
68
     end