Advertisement
tima_gt

tde-settings 3.3

Mar 30th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.25 KB | None | 0 0
  1. wallpaper_icon = paintutils.loadImage("twalpi")
  2. max = 12
  3. min = 1
  4. os.loadAPI("advPrint")
  5. startSetting = 3
  6. settings = {}
  7. local function tde_settings_color()
  8. term.setBackgroundColor(colors.white)
  9. term.clear()
  10. term.setCursorPos(1, 1)
  11. term.setBackgroundColor(colors.gray)
  12. i = 1
  13. while i <= 19 do
  14. print("            ")
  15. i = i + 1
  16. end
  17. if startSetting == 3 then
  18. term.setCursorPos(14, 3)
  19. term.setBackgroundColor(colors.white)
  20. term.setTextColor(colors.black)
  21. write("      Wallpaper")
  22. term.setTextColor(colors.black)
  23. term.setCursorPos(15, 12)
  24. write("    Password Lock")
  25. term.setCursorPos(15, 14)
  26. term.setBackgroundColor(colors.lightGray)
  27. if not fs.exists(".tde-password") then
  28. write("Set password to lock")
  29. else
  30. write("Change password to lock")
  31. end
  32. term.setTextColor(colors.white)
  33. paintutils.drawImage(wallpaper_icon, 15, 5)
  34.  
  35. else
  36.  
  37. end
  38. end
  39. local function tde_setting_slot(setN, tTXT)
  40. settings[setN] = ">"..tTXT
  41. end
  42.  
  43. local function tde_drawSetting(selectS)
  44. term.setCursorPos(1, selectS)
  45. if startSetting ~= selectS then
  46. term.setBackgroundColor(colors.gray)
  47. print(settings[selectS])
  48. elseif startSetting == selectS then
  49. term.setBackgroundColor(colors.lightGray)
  50. print(settings[selectS])
  51. end
  52. end
  53. while true do
  54. tde_settings_color()
  55. term.setBackgroundColor(colors.gray)
  56. advPrint.tout(1 , "TDE Settings")
  57. tde_setting_slot(3, "Customize")
  58.  
  59. tde_drawSetting(3)
  60. tde_setting_slot(5, "CMD")
  61. tde_drawSetting(5)
  62. tde_setting_slot(7, "Exit")
  63. tde_drawSetting(7)
  64. --HERE:
  65. local event, button, X, Y = os.pullEventRaw()
  66.   if event == "mouse_click" then
  67. if X >= min and Y >= 3 and X <= max and Y <= 3 then
  68. startSetting = 3
  69. elseif X >= 15 and X <= 23 and Y == 14 then
  70. shell.run("tde-password")
  71. elseif X >= min and Y >= 5 and X<= max and Y <= 5 then
  72. startSetting = 5
  73. tde_drawSetting(3)
  74. tde_drawSetting(5)
  75. tde_drawSetting(7)
  76. os.sleep(0.5)
  77. term.setBackgroundColor(colors.black)
  78. term.setTextColor(colors.white)
  79. term.setCursorPos(1, 1)
  80. term.clear()
  81. shell.run("tde-terminal")
  82. elseif (X >= 15 and Y>= 5 and X<= 15 + 11 and Y <= 5 + 5) and (startSetting == 3) then
  83. shell.run("paint tde-wallpaper")
  84. elseif X >= min and Y >= 7 and X <= max and Y <= 7 then
  85. startSetting = 7
  86. tde_drawSetting(3)
  87. tde_drawSetting(5)
  88. tde_drawSetting(7)
  89. os.sleep(0.5)
  90. break
  91. end
  92. end
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement