Advertisement
tima_gt

tde-settings 3.2

Dec 26th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.90 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.white)
  23. paintutils.drawImage(wallpaper_icon, 15, 5)
  24. else
  25.  
  26. end
  27. end
  28. local function tde_setting_slot(setN, tTXT)
  29. settings[setN] = ">"..tTXT
  30. end
  31.  
  32. local function tde_drawSetting(selectS)
  33. term.setCursorPos(1, selectS)
  34. if startSetting ~= selectS then
  35. term.setBackgroundColor(colors.gray)
  36. print(settings[selectS])
  37. elseif startSetting == selectS then
  38. term.setBackgroundColor(colors.lightGray)
  39. print(settings[selectS])
  40. end
  41. end
  42. while true do
  43. tde_settings_color()
  44. term.setBackgroundColor(colors.gray)
  45. advPrint.tout(1 , "TDE Settings")
  46. tde_setting_slot(3, "Customize")
  47.  
  48. tde_drawSetting(3)
  49. tde_setting_slot(5, "CMD")
  50. tde_drawSetting(5)
  51. tde_setting_slot(7, "Exit")
  52. tde_drawSetting(7)
  53. --HERE:
  54. local event, button, X, Y = os.pullEventRaw()
  55.   if event == "mouse_click" then
  56. if X >= min and Y >= 3 and X <= max and Y <= 3 then
  57. startSetting = 3
  58. elseif X >= min and Y >= 5 and X<= max and Y <= 5 then
  59. startSetting = 5
  60. tde_drawSetting(3)
  61. tde_drawSetting(5)
  62. tde_drawSetting(7)
  63. os.sleep(0.5)
  64. term.setBackgroundColor(colors.black)
  65. term.setTextColor(colors.white)
  66. term.setCursorPos(1, 1)
  67. term.clear()
  68. shell.run("shell")
  69. elseif (X >= 15 and Y>= 5 and X<= 15 + 11 and Y <= 5 + 5) and (startSetting == 3) then
  70. shell.run("paint tde-wallpaper")
  71. elseif X >= min and Y >= 7 and X <= max and Y <= 7 then
  72. startSetting = 7
  73. tde_drawSetting(3)
  74. tde_drawSetting(5)
  75. tde_drawSetting(7)
  76. os.sleep(0.5)
  77. break
  78. end
  79. end
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement