Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------
- --AdmiOS-----Desktop----Raw---CODE--
- ------------------------------------
- --Proceed with caution
- -- (CHANGES TAKE EFFECT AFTER AN RESTART)
- a = 0
- renderTime = true
- time = tostring(textutils.formatTime(os.time(), false))
- desktopDrawn=0
- slc = 0
- tBarC = 8
- tBartC = 1
- backColor = colors.black
- term.setBackgroundColor(backColor)
- term.clear()
- ContextX = 0
- ContextY = 0
- function DisplayTime()
- local nTime = os.time()
- print (textutils.formatTime(nTime, false))
- TimeDisplay = os.startTimer(1)
- end
- function titleBar()
- term.setCursorPos(1,1)
- term.setBackgroundColor(tBarC)
- term.setTextColor(tBartC)
- term.clearLine()
- term.setCursorPos(1, 1)
- term.setBackgroundColor(colors.green)
- print("Baslat")
- term.setCursorPos(45,1)
- term.setBackgroundColor(tBarC)
- DisplayTime()
- end
- function drawDesktop()
- term.setBackgroundColor(backColor)
- term.clear()
- bground = paintutils.loadImage("pics/desktop_bg")
- paintutils.drawImage(bground,1,1)
- titleBar()
- end
- function drawMenu1()
- term.setTextColor(256)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,2)
- print(" ")
- term.setCursorPos(1,3)
- sleep(.1)
- print("Kapat ")
- term.setCursorPos(1,4)
- sleep(.1)
- print("Yeniden baslat")
- term.setCursorPos(1,5)
- sleep(.1)
- print("Kod duzenle ")
- term.setCursorPos(1,6)
- sleep(.1)
- print("Programlar > ")
- term.setCursorPos(1,7)
- sleep(.1)
- print("Konsol ")
- term.setCursorPos(1,8)
- sleep(.1)
- print(" ")
- end
- function drawMenu2()
- term.setTextColor(256)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(14,6)
- print(" ")
- term.setCursorPos(14,7)
- sleep(.1)
- print("Dosyalar ")
- term.setCursorPos(14,8)
- sleep(.1)
- print("Internet ")
- term.setCursorPos(14,9)
- sleep(.1)
- print("Boyama ")
- term.setCursorPos(14,10)
- sleep(.1)
- print("Kod duzenleme")
- term.setCursorPos(14,11)
- sleep(.1)
- print(" ")
- end
- drawDesktop()
- while true do
- local event, button, X, Y = os.pullEventRaw()
- if slc == 0 then
- if event == "mouse_click" then
- if X >=1 and X <=6 and Y==1 and button ==1 then
- drawMenu1()
- slc = 1
- else
- drawDesktop()
- end
- end
- elseif slc == 1 then
- if X >=1 and X <=14 and button == 1 and Y== 3 then slc = 0
- shell.run("goodbye -s")
- elseif X>=1 and X<=14 and Y==4 and button ==1 then slc = 0
- shell.run("goodbye -r")
- elseif X>=1 and X<=14 and Y==5 and button ==1 then slc = 0
- shell.run("luaide desktop")
- drawDesktop()
- elseif X>=1 and X<=14 and Y==6 and button ==1 then slc = 0
- slc = 2
- drawMenu2()
- elseif X>=1 and X<=14 and Y==7 and button ==1 then slc = 0
- shell.run("terminal_starter")
- else
- slc = 0
- drawDesktop()
- end
- elseif slc == 2 then
- if X >=10 and X <=20 and button == 1 and Y==7 then slc = 0
- shell.run("fman")
- drawDesktop()
- elseif X>=10 and X <=20 and button==1 and Y==8 then slc = 0
- shell.run("firewolf")
- drawDesktop()
- elseif X>=10 and X <=20 and button==1 and Y==9 then slc = 0
- shell.run("sketch")
- drawDesktop()
- elseif X>=10 and X <=20 and button==1 and Y==10 then slc = 0
- shell.run("luaide")
- else
- slc = 0
- drawDesktop()
- end
- elseif slc == 3 then
- if X >= ContextX and X <= ContextX+13 and Y == ContextY+2 and button == 1 then
- term.clear()
- term.setCursorPos(1,1)
- os.run({}, "rom/programs/shell")
- end
- end
- end
- function DisplayTime()
- local x, y = term.getCursorPos()
- local nTime = os.time()
- term.clear()
- term.setCursorPos(1, 45)
- print (textutils.formatTime(nTime, bTwentyFourHour))
- TimeDisplay = os.startTimer(1)
- term.setCursorPos(x,y)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement