Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wallpaper_icon = paintutils.loadImage("twalpi")
- max = 12
- min = 1
- os.loadAPI("advPrint")
- startSetting = 3
- settings = {}
- local function tde_settings_color()
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setCursorPos(1, 1)
- term.setBackgroundColor(colors.gray)
- i = 1
- while i <= 19 do
- print(" ")
- i = i + 1
- end
- if startSetting == 3 then
- term.setCursorPos(14, 3)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- write(" Wallpaper")
- term.setTextColor(colors.black)
- term.setCursorPos(15, 12)
- write(" Password Lock")
- term.setCursorPos(15, 14)
- term.setBackgroundColor(colors.lightGray)
- if not fs.exists(".tde-password") then
- write("Set password to lock")
- else
- write("Change password to lock")
- end
- term.setTextColor(colors.white)
- paintutils.drawImage(wallpaper_icon, 15, 5)
- else
- end
- end
- local function tde_setting_slot(setN, tTXT)
- settings[setN] = ">"..tTXT
- end
- local function tde_drawSetting(selectS)
- term.setCursorPos(1, selectS)
- if startSetting ~= selectS then
- term.setBackgroundColor(colors.gray)
- print(settings[selectS])
- elseif startSetting == selectS then
- term.setBackgroundColor(colors.lightGray)
- print(settings[selectS])
- end
- end
- while true do
- tde_settings_color()
- term.setBackgroundColor(colors.gray)
- advPrint.tout(1 , "TDE Settings")
- tde_setting_slot(3, "Customize")
- tde_drawSetting(3)
- tde_setting_slot(5, "CMD")
- tde_drawSetting(5)
- tde_setting_slot(7, "Exit")
- tde_drawSetting(7)
- --HERE:
- local event, button, X, Y = os.pullEventRaw()
- if event == "mouse_click" then
- if X >= min and Y >= 3 and X <= max and Y <= 3 then
- startSetting = 3
- elseif X >= 15 and X <= 23 and Y == 14 then
- shell.run("tde-password")
- elseif X >= min and Y >= 5 and X<= max and Y <= 5 then
- startSetting = 5
- tde_drawSetting(3)
- tde_drawSetting(5)
- tde_drawSetting(7)
- os.sleep(0.5)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.setCursorPos(1, 1)
- term.clear()
- shell.run("tde-terminal")
- elseif (X >= 15 and Y>= 5 and X<= 15 + 11 and Y <= 5 + 5) and (startSetting == 3) then
- shell.run("paint tde-wallpaper")
- elseif X >= min and Y >= 7 and X <= max and Y <= 7 then
- startSetting = 7
- tde_drawSetting(3)
- tde_drawSetting(5)
- tde_drawSetting(7)
- os.sleep(0.5)
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement