AquaJD

[AOS] ControlPanel

Jan 29th, 2014
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 26.33 KB | None | 0 0
  1. --[[
  2.  
  3.   AquaOS v1.51 - by AutoLocK and SSS
  4.   Copyright 2013
  5.  
  6.   This is the Control Screen!
  7.  
  8.   REQUIREMENTS:
  9.   - HTTP API needs to be enabled
  10.   - Computer Width = 51
  11.   - Computer Height = 19
  12.  
  13. --]]
  14.  
  15. themeWater = { 2048,8,512,1 }
  16. themeFire = { 16384,16,2,32768 }
  17. themeCarbon = { 32768,32,1,32 }
  18. themeGreyScale = { 32768,1,256,1 }
  19.  
  20. os.loadAPI("/AquaOS/Resources/APIs/QuickTils")
  21. os.loadAPI("/AquaOS/Resources/APIs/Settings")
  22. slc = 0
  23. slcTheme = 0
  24. slcUsers = 0
  25. slcAppearance = 0
  26. mFilePath = "/AquaOS/.Boot/Main"
  27. cFilePath = "/AquaOS/Resources/.control"
  28. bootPath = "/AquaOS/.Boot/"
  29. configPath = "/AquaOS/.cfg"
  30.  
  31. configFile = Settings.openSettingsFile(configPath)
  32. bGPic = configFile.getSectionedValue("Appearance","bGPic")
  33. iCon1Text = configFile.getSectionedValue("Appearance","iCon1Text")
  34. iCon1Pic = configFile.getSectionedValue("Appearance","iCon1Pic")
  35. iCon1Link= configFile.getSectionedValue("Appearance","iCon1Link")
  36. iCon2Text = configFile.getSectionedValue("Appearance","iCon2Text")
  37. iCon2Pic = configFile.getSectionedValue("Appearance","iCon2Pic")
  38. iCon2Link = configFile.getSectionedValue("Appearance","iCon2Link")
  39. tBarCol = configFile.getSectionedValue("Appearance","tBarCol")
  40. tBarTextCol = configFile.getSectionedValue("Appearance","tBarTextCol")
  41. backColor = configFile.getSectionedValue("Appearance","backColor")
  42. textColor = configFile.getSectionedValue("Appearance","textColor")
  43. adminUser = configFile.getSectionedValue("Accounts","adminUser")
  44. adminPass = configFile.getSectionedValue("Accounts","adminPass")
  45. basicUser1 = configFile.getSectionedValue("Accounts","basicUser1")
  46. basicPass1 = configFile.getSectionedValue("Accounts","basicPass1")
  47. basicUser2 = configFile.getSectionedValue("Accounts","basicUser2")
  48. basicPass2 = configFile.getSectionedValue("Accounts","basicPass2")
  49. basicUser3 = configFile.getSectionedValue("Accounts","basicUser3")
  50. basicPass3 = configFile.getSectionedValue("Accounts","basicPass3")
  51. loginPass = configFile.getSectionedValue("Other","loginPass")
  52. showIcons = configFile.getSectionedValue("Other","showIcons")
  53. currentTheme = configFile.getSectionedValue("Other","currentTheme")
  54. currentUser = configFile.getSectionedValue("Other","currentUser")
  55. tBarCol = tonumber(tBarCol)
  56. tBarTextCol = tonumber(tBarTextCol)
  57. backColor = tonumber(backColor)
  58. textColor = tonumber(textColor)
  59. loginPass = tonumber(loginPass)
  60.  
  61. function titleBar()
  62.   QuickTils.cursor(1,1)
  63.   QuickTils.bColor(tBarCol)
  64.   QuickTils.color(tBarTextCol)
  65.   term.clearLine()
  66.   QuickTils.cursor(3,1)
  67.   print("[BACK]")
  68. end
  69.  
  70. function drawThemeMenu()
  71.   QuickTils.bColor(tBarCol)
  72.   QuickTils.color(tBarTextCol)
  73.   QuickTils.cursor(12,5)
  74.   print("       [CHANGE THEME]       ")
  75.   QuickTils.bColor(colors.gray)
  76.   QuickTils.color(textColor)
  77.   lY = 6
  78.   for i=1,8 do
  79.     QuickTils.cursor(12,lY)
  80.     print("                            ")
  81.     lY = lY+1
  82.   end  
  83.   QuickTils.bColor(colors.gray)
  84.   QuickTils.cursor(19,7)
  85.   QuickTils.color(textColor)
  86.   print("Choose a theme!")
  87.   QuickTils.cursor(14,9)
  88.   QuickTils.bColor(colors.blue)
  89.   QuickTils.color(colors.cyan)
  90.   print(" WATER ")
  91.   QuickTils.bColor(colors.orange)
  92.   QuickTils.color(colors.red)
  93.   QuickTils.cursor(28,9)
  94.   print(" FIRE ")
  95.   QuickTils.bColor(colors.black)
  96.   QuickTils.cursor(14,11)
  97.   QuickTils.color(colors.lime)
  98.   print(" CARBON ")
  99.   QuickTils.bColor(colors.black)
  100.   QuickTils.cursor(28,11)
  101.   QuickTils.color(colors.white)
  102.   print(" GREYSCALE ")
  103. end
  104.  
  105. function drawCPallet(x,y)
  106.   QuickTils.cursor(x-1,y-1)
  107.   QuickTils.bColor(backColor)
  108.   print("          ")
  109.   QuickTils.cursor(x-1,y)
  110.   QuickTils.bColor(backColor)
  111.   print("          ")
  112.   QuickTils.cursor(x-1,y+1)
  113.   QuickTils.bColor(backColor)
  114.   print("          ")
  115.   QuickTils.cursor(x-1,y+2)
  116.   QuickTils.bColor(backColor)
  117.   print("          ")
  118.   QuickTils.cursor(x-1,y+3)
  119.   QuickTils.bColor(backColor)
  120.   print("          ")
  121.   QuickTils.cursor(x-1,y+4)
  122.   QuickTils.bColor(backColor)
  123.   print("          ")
  124.   QuickTils.cursor(x,y)
  125.   QuickTils.bColor(1)
  126.   print("  ")
  127.   QuickTils.cursor(x+2,y)
  128.   QuickTils.bColor(2)
  129.   print("  ")
  130.   QuickTils.cursor(x+4,y)
  131.   QuickTils.bColor(4)
  132.   print("  ")
  133.   QuickTils.cursor(x+6,y)
  134.   QuickTils.bColor(8)
  135.   print("  ")
  136.   QuickTils.cursor(x,y+1)
  137.   QuickTils.bColor(16)
  138.   print("  ")
  139.   QuickTils.cursor(x+2,y+1)
  140.   QuickTils.bColor(32)
  141.   print("  ")
  142.   QuickTils.cursor(x+4,y+1)
  143.   QuickTils.bColor(64)
  144.   print("  ")
  145.   QuickTils.cursor(x+6,y+1)
  146.   QuickTils.bColor(128)
  147.   print("  ")
  148.   QuickTils.cursor(x,y+2)
  149.   QuickTils.bColor(256)
  150.   print("  ")
  151.   QuickTils.cursor(x+2,y+2)
  152.   QuickTils.bColor(512)
  153.   print("  ")
  154.   QuickTils.cursor(x+4,y+2)
  155.   QuickTils.bColor(1024)
  156.   print("  ")
  157.   QuickTils.cursor(x+6,y+2)
  158.   QuickTils.bColor(2048)
  159.   print("  ")
  160.   QuickTils.cursor(x,y+3)
  161.   QuickTils.bColor(4096)
  162.   print("  ")
  163.   QuickTils.cursor(x+2,y+3)
  164.   QuickTils.bColor(8192)
  165.   print("  ")
  166.   QuickTils.cursor(x+4,y+3)
  167.   QuickTils.bColor(16384)
  168.   print("  ")
  169.   QuickTils.cursor(x+6,y+3)
  170.   QuickTils.bColor(32768)
  171.   print("  ")
  172. end
  173.  
  174. function drawCP()
  175.     QuickTils.bColor(backColor)
  176.     QuickTils.color(textColor)
  177.     QuickTils.clean(1,1)
  178.     print("                                                   ")
  179.     print("                                                   ")
  180.     print("                      AquaOS                       ")
  181.     print("               System Control Panel                ")
  182.     print("                                                   ")
  183.     print("                                                   ")
  184.     print("                                                   ")
  185.     print("  Desktop       >                                  ")
  186.     print("  User Accounts >                                  ")
  187.     print("  Appearance    >                                  ")
  188.     print("                                                   ")
  189.     print("                                                   ")
  190.     print("                                                   ")
  191.     print("                                                   ")
  192.     print("                                                   ")
  193.     print("                                                   ")
  194.     print("                                                   ")
  195.     print("                                                   ")
  196.     QuickTils.color(textColor)
  197.     QuickTils.bColor(backColor)
  198.     titleBar()
  199. end
  200.  
  201. function drawBarDesktop()
  202.     QuickTils.bColor(backColor)
  203.     QuickTils.color(textColor)
  204.     QuickTils.clean(1,1)
  205.     print("                                                   ")
  206.     print("                                                   ")
  207.     print("                      AquaOS                       ")
  208.     print("               System Control Panel                ")
  209.     print("                                                   ")
  210.     print("                                                   ")
  211.     print("                                                   ")
  212.     print("  Desktop       >                                  ")
  213.     print("  User Accounts >        Show Icons:          <    ")
  214.     print("  Appearance    >                                  ")
  215.     print("                         Theme:               <    ")
  216.     print("                                                   ")
  217.     print("                                                   ")
  218.     print("                                                   ")
  219.     print("                                                   ")
  220.     print("                                                   ")
  221.     print("                                                   ")
  222.     print("                                                   ")
  223.     QuickTils.cursor(2,8)
  224.     QuickTils.bColor(tBarCol)
  225.     QuickTils.color(tBarTextCol)
  226.     print(" Desktop       > ")
  227.     QuickTils.color(textColor)
  228.     QuickTils.bColor(backColor)
  229.     QuickTils.cursor(35,11)
  230.     print(currentTheme)
  231.     QuickTils.cursor(40,9)
  232.     print(showIcons)
  233.     titleBar()
  234. end
  235.  
  236. function drawBarUsers()
  237.     QuickTils.bColor(backColor)
  238.     QuickTils.color(textColor)
  239.     QuickTils.clean(1,1)
  240.     print("                                                   ")
  241.     print("                                                   ")
  242.     print("                      AquaOS                       ")
  243.     print("               System Control Panel                ")
  244.     print("                                                   ")
  245.     print("                      Admin                        ")
  246.     print("                           Username:              <")
  247.     print("  Desktop       >          Password:              <")
  248.     print("  User Accounts >     User 1                       ")
  249.     print("  Appearance    >          Username:              <")
  250.     print("                           Password:              <")
  251.     print("                      User 2                       ")
  252.     print("                           Username:              <")
  253.     print("                           Password:              <")
  254.     print("                      User 3                       ")
  255.     print("                           Username:              <")
  256.     print("                           Password:              <")
  257.     print("                                                   ")
  258.     QuickTils.cursor(2,9)
  259.     QuickTils.bColor(tBarCol)
  260.     QuickTils.color(tBarTextCol)
  261.     print(" User Accounts > ")
  262.     QuickTils.color(textColor)
  263.     QuickTils.bColor(backColor)
  264.     if currentUser == "admin" then
  265.         QuickTils.cursor(40,7)
  266.         print(adminUser)
  267.         QuickTils.cursor(40,8)
  268.         print(adminPass)
  269.         QuickTils.cursor(40,10)
  270.         print(basicUser1)
  271.         QuickTils.cursor(40,11)
  272.         print(basicPass1)
  273.         QuickTils.cursor(40,13)
  274.         print(basicUser2)
  275.         QuickTils.cursor(40,14)
  276.         print(basicPass2)
  277.         QuickTils.cursor(40,16)
  278.         print(basicUser3)
  279.         QuickTils.cursor(40,17)
  280.         print(basicPass3)
  281.     end
  282.     if currentUser == "user1" then
  283.         QuickTils.cursor(40,7)
  284.         print(adminUser)
  285.         QuickTils.cursor(40,8)
  286.         print(string.rep("*",#adminPass))
  287.         QuickTils.cursor(40,10)
  288.         print(basicUser1)
  289.         QuickTils.cursor(40,11)
  290.         print(basicPass1)
  291.         QuickTils.cursor(40,13)
  292.         print(basicUser2)
  293.         QuickTils.cursor(40,14)
  294.         print(string.rep("*",#basicPass2))
  295.         QuickTils.cursor(40,16)
  296.         print(basicUser3)
  297.         QuickTils.cursor(40,17)
  298.         print(string.rep("*",#basicPass3))
  299.     elseif currentUser == "user2" then
  300.         QuickTils.cursor(40,7)
  301.         print(adminUser)
  302.         QuickTils.cursor(40,8)
  303.         print(string.rep("*",#adminPass))
  304.         QuickTils.cursor(40,10)
  305.         print(basicUser1)
  306.         QuickTils.cursor(40,11)
  307.         print(string.rep("*",#basicPass1))
  308.         QuickTils.cursor(40,13)
  309.         print(basicUser2)
  310.         QuickTils.cursor(40,14)
  311.         print(basicPass2)
  312.         QuickTils.cursor(40,16)
  313.         print(basicUser3)
  314.         QuickTils.cursor(40,17)
  315.         print(string.rep("*",#basicPass3))
  316.     elseif currentUser == "user3" then
  317.         QuickTils.cursor(40,7)
  318.         print(adminUser)
  319.         QuickTils.cursor(40,8)
  320.         print(string.rep("*",#adminPass))
  321.         QuickTils.cursor(40,10)
  322.         print(basicUser1)
  323.         QuickTils.cursor(40,11)
  324.         print(string.rep("*",#basicPass1))
  325.         QuickTils.cursor(40,13)
  326.         print(basicUser2)
  327.         QuickTils.cursor(40,14)
  328.         print(string.rep("*",#basicPass2))
  329.         QuickTils.cursor(40,16)
  330.         print(basicUser3)
  331.         QuickTils.cursor(40,17)
  332.         print(basicPass3)
  333.     end
  334.     titleBar()
  335. end
  336.  
  337. function drawBarAppearance()
  338.     QuickTils.bColor(backColor)
  339.     QuickTils.color(textColor)
  340.     QuickTils.clean(1,1)
  341.     print("                                                   ")
  342.     print("                                                   ")
  343.     print("                      AquaOS                       ")
  344.     print("               System Control Panel                ")
  345.     print("                                                   ")
  346.     print("                                                   ")
  347.     print("                         Background Image          ")
  348.     print("  Desktop       >                                  ")
  349.     print("  User Accounts >                             <    ")
  350.     print("  Appearance    >                                  ")
  351.     print("                         Background Color          ")
  352.     print("                                                   ")
  353.     print("                                                   ")
  354.     print("                                                   ")
  355.     print("                                                   ")
  356.     print("                                                   ")
  357.     print("                                                   ")
  358.     print("                                                   ")
  359.     QuickTils.cursor(2,10)
  360.     QuickTils.bColor(tBarCol)
  361.     QuickTils.color(tBarTextCol)
  362.     print(" Appearance    > ")
  363.     QuickTils.color(textColor)
  364.     QuickTils.bColor(backColor)
  365.     QuickTils.cursor(33,9)
  366.     print(bGPic)
  367.     drawCPallet(33,14)
  368.     titleBar()
  369. end
  370.  
  371. drawCP()
  372. while true do
  373.     local event,button,X,Y = os.pullEvent()
  374.     if event == "mouse_click" then
  375.         if slc == 0 then
  376.             if X>=3 and X<=8 and Y==1 and button==1 then
  377.                 return
  378.                 shell.run(mFilePath)
  379.             elseif X==17 and Y==8 and button==1 then slc = 1
  380.                 drawBarDesktop()
  381.             elseif X==17 and Y==9 and button==1 then slc = 2
  382.                 drawBarUsers()
  383.             elseif X==17 and Y==10 and button==1 then slc = 3
  384.                 drawBarAppearance()
  385.             end
  386.         elseif slc == 1 then
  387.             if slcTheme == 0 then
  388.                 if event == "mouse_click" then
  389.                     if X==47 and Y==9 then
  390.                         QuickTils.bColor(backColor)
  391.                         QuickTils.color(textColor)
  392.                         QuickTils.cursor(39,9)
  393.                         print("        ")
  394.                         QuickTils.cursor(39,9)
  395.                         local icoVisible = read()
  396.                         if icoVisible == "true" then
  397.                             configFile.setSectionedValue("Other","showIcons","true")
  398.                             configFile.save(configPath)
  399.                             slc = 0
  400.                             shell.run(cFilePath)
  401.                         elseif icoVisible == "false" then
  402.                             configFile.setSectionedValue("Other","showIcons","false")
  403.                             configFile.save(configPath)
  404.                             slc = 0
  405.                             shell.run(cFilePath)
  406.                         end
  407.                     elseif X==17 and Y==10 and button==1 then slc = 3
  408.                         drawBarAppearance()
  409.                     elseif X==17 and Y==9 and button==1 then slc = 2
  410.                         drawBarUsers()
  411.                     elseif X==47 and Y==11 and button==1 then
  412.                         drawThemeMenu()
  413.                         slcTheme = 1
  414.                     elseif X>=3 and X<=8 and Y==1 and button==1 then
  415.                         return
  416.                         shell.run(mFilePath)
  417.                     end
  418.                 end
  419.             elseif slcTheme == 1 then
  420.                 if event == "mouse_click" then
  421.                     if X>=14 and X<=23 and Y==9 and button == 1 then
  422.                         configFile.setSectionedValue("Appearance","tBarCol",themeWater[1])
  423.                         configFile.setSectionedValue("Appearance","tBarTextCol",themeWater[2])
  424.                         configFile.setSectionedValue("Appearance","backColor",themeWater[3])
  425.                         configFile.setSectionedValue("Appearance","textColor",themeWater[4])
  426.                         configFile.setSectionedValue("Other","currentTheme","Water")
  427.                         configFile.save(configPath)
  428.                         slc = 0
  429.                         slcTheme = 0
  430.                         shell.run(cFilePath)
  431.                     elseif X>=28 and X<=33 and Y==9 and button == 1 then
  432.                         configFile.setSectionedValue("Appearance","tBarCol",themeFire[1])
  433.                         configFile.setSectionedValue("Appearance","tBarTextCol",themeFire[2])
  434.                         configFile.setSectionedValue("Appearance","backColor",themeFire[3])
  435.                         configFile.setSectionedValue("Appearance","textColor",themeFire[4])
  436.                         configFile.setSectionedValue("Other","currentTheme","Fire")
  437.                         configFile.save(configPath)
  438.                         slc = 0
  439.                         slcTheme = 0
  440.                         shell.run(cFilePath)
  441.                      elseif X>=14 and X<=21 and Y==11 and button == 1 then
  442.                         configFile.setSectionedValue("Appearance","tBarCol",themeCarbon[1])  
  443.                         configFile.setSectionedValue("Appearance","tBarTextCol",themeCarbon[2])
  444.                         configFile.setSectionedValue("Appearance","backColor",themeCarbon[3])
  445.                         configFile.setSectionedValue("Appearance","textColor",themeCarbon[4])
  446.                         configFile.setSectionedValue("Other","currentTheme","Carbon")
  447.                         configFile.save(configPath)
  448.                         slc = 0
  449.                         slcTheme = 0
  450.                         shell.run(cFilePath)
  451.                     elseif X>=28 and X<=38 and Y==11 and button == 1 then
  452.                         configFile.setSectionedValue("Appearance","tBarCol",themeGreyScale[1])
  453.                         configFile.setSectionedValue("Appearance","tBarTextCol",themeGreyScale[2])
  454.                         configFile.setSectionedValue("Appearance","backColor",themeGreyScale[3])
  455.                         configFile.setSectionedValue("Appearance","textColor",themeGreyScale[4])
  456.                         configFile.setSectionedValue("Other","currentTheme","Greyscale")
  457.                         configFile.save(configPath)
  458.                         slc = 0
  459.                         slcTheme = 0
  460.                         shell.run(cFilePath)
  461.                     end
  462.                 end
  463.             end
  464.         elseif slc == 2 then
  465.             if event == "mouse_click" then
  466.                 if X>=3 and X<=8 and Y==1 and button==1 then
  467.                     return
  468.                     shell.run(mFilePath)
  469.                 elseif X==17 and Y==8 and button==1 then slc = 1
  470.                     drawBarDesktop()
  471.                 elseif X==17 and Y==10 and button==1 then slc = 3
  472.                     drawBarAppearance()
  473.                 elseif X==51 and Y==7 and button==1 then
  474.                     if currentUser == "admin" then 
  475.                         QuickTils.bColor(backColor)
  476.                         QuickTils.color(textColor)
  477.                         QuickTils.cursor(40,7)
  478.                         print(string.rep(" ",10))
  479.                         QuickTils.cursor(40,7)
  480.                         local newUserAdmin = read()
  481.                         configFile.setSectionedValue("Accounts","adminUser",newUserAdmin)
  482.                         configFile.save(configPath)
  483.                         slc = 0
  484.                         shell.run(cFilePath)
  485.                     end
  486.                 elseif X==51 and Y==8 and button==1 then
  487.                     if currentUser == "admin" then
  488.                         QuickTils.bColor(backColor)
  489.                         QuickTils.color(textColor)
  490.                         QuickTils.cursor(40,8)
  491.                         print(string.rep(" ",10))
  492.                         QuickTils.cursor(40,8)
  493.                         local newPassAdmin = read()
  494.                         configFile.setSectionedValue("Accounts","adminPass",newPassAdmin)
  495.                         configFile.save(configPath)
  496.                         slc = 0
  497.                         shell.run(cFilePath)
  498.                     end
  499.                 elseif X==51 and Y==10 and button==1 then
  500.                     if currentUser == "admin" then 
  501.                         QuickTils.bColor(backColor)
  502.                         QuickTils.color(textColor)
  503.                         QuickTils.cursor(40,10)
  504.                         print(string.rep(" ",10))
  505.                         QuickTils.cursor(40,10)
  506.                         local newUser1 = read()
  507.                         configFile.setSectionedValue("Accounts","basicUser1",newUser1)
  508.                         configFile.save(configPath)
  509.                         slc = 0
  510.                         shell.run(cFilePath)
  511.                     elseif currentUser == "user1" then
  512.                         QuickTils.bColor(backColor)
  513.                         QuickTils.color(textColor)
  514.                         QuickTils.cursor(40,10)
  515.                         print(string.rep(" ",10))
  516.                         QuickTils.cursor(40,10)
  517.                         local newUser1 = read()
  518.                         configFile.setSectionedValue("Accounts","basicUser1",newUser1)
  519.                         configFile.save(configPath)
  520.                         slc = 0
  521.                         shell.run(cFilePath)
  522.                     end
  523.                 elseif X==51 and Y==11 and button==1 then
  524.                     if currentUser == "admin" then
  525.                         QuickTils.bColor(backColor)
  526.                         QuickTils.color(textColor)
  527.                         QuickTils.cursor(40,11)
  528.                         print(string.rep(" ",10))
  529.                         QuickTils.cursor(40,11)
  530.                         local newPass1 = read()
  531.                         configFile.setSectionedValue("Accounts","basicPass1",newPass1)
  532.                         configFile.save(configPath)
  533.                         slc = 0
  534.                         shell.run(cFilePath)
  535.                     elseif currentUser == "user1" then
  536.                         QuickTils.bColor(backColor)
  537.                         QuickTils.color(textColor)
  538.                         QuickTils.cursor(40,11)
  539.                         print(string.rep(" ",10))
  540.                         QuickTils.cursor(40,11)
  541.                         local newPass1 = read()
  542.                         configFile.setSectionedValue("Accounts","basicPass1",newPass1)
  543.                         configFile.save(configPath)
  544.                         slc = 0
  545.                         shell.run(cFilePath)
  546.                     end
  547.                 elseif X==51 and Y==13 and button==1 then
  548.                     if currentUser == "admin" then
  549.                         QuickTils.bColor(backColor)
  550.                         QuickTils.color(textColor)
  551.                         QuickTils.cursor(40,13)
  552.                         print(string.rep(" ",10))
  553.                         QuickTils.cursor(40,13)
  554.                         local newUser2 = read()
  555.                         configFile.setSectionedValue("Accounts","basicUser2",newUser2)
  556.                         configFile.save(configPath)
  557.                         slc = 0
  558.                         shell.run(cFilePath)
  559.                     elseif currentUser == "user2" then
  560.                         QuickTils.bColor(backColor)
  561.                         QuickTils.color(textColor)
  562.                         QuickTils.cursor(40,13)
  563.                         print(string.rep(" ",10))
  564.                         QuickTils.cursor(40,13)
  565.                         local newUser2 = read()
  566.                         configFile.setSectionedValue("Accounts","basicUser2",newUser2)
  567.                         configFile.save(configPath)
  568.                         slc = 0
  569.                         shell.run(cFilePath)
  570.                     end
  571.                 elseif X==51 and Y==14 and button==1 then
  572.                     if currentUser == "admin" then
  573.                         QuickTils.bColor(backColor)
  574.                         QuickTils.color(textColor)
  575.                         QuickTils.cursor(40,14)
  576.                         print(string.rep(" ",10))
  577.                         QuickTils.cursor(40,14)
  578.                         local newPass2 = read()
  579.                         configFile.setSectionedValue("Accounts","basicPass2",newPass2)
  580.                         configFile.save(configPath)
  581.                         slc = 0
  582.                         shell.run(cFilePath)
  583.                     elseif currentUser == "user2" then
  584.                         QuickTils.bColor(backColor)
  585.                         QuickTils.color(textColor)
  586.                         QuickTils.cursor(40,14)
  587.                         print(string.rep(" ",10))
  588.                         QuickTils.cursor(40,14)
  589.                         local newPass2 = read()
  590.                         configFile.setSectionedValue("Accounts","basicPass2",newPass2)
  591.                         configFile.save(configPath)
  592.                         slc = 0
  593.                         shell.run(cFilePath)
  594.                     end
  595.                 elseif X==51 and Y==16 and button==1 then
  596.                     if currentUser == "admin" then
  597.                         QuickTils.bColor(backColor)
  598.                         QuickTils.color(textColor)
  599.                         QuickTils.cursor(40,16)
  600.                         print(string.rep(" ",10))
  601.                         QuickTils.cursor(40,16)
  602.                         local newUser3 = read()
  603.                         configFile.setSectionedValue("Accounts","basicUser3",newUser3)
  604.                         configFile.save(configPath)
  605.                         slc = 0
  606.                         shell.run(cFilePath)
  607.                     elseif currentUser == "user3" then
  608.                         QuickTils.bColor(backColor)
  609.                         QuickTils.color(textColor)
  610.                         QuickTils.cursor(40,16)
  611.                         print(string.rep(" ",10))
  612.                         QuickTils.cursor(40,16)
  613.                         local newUser3 = read()
  614.                         configFile.setSectionedValue("Accounts","basicUser3",newUser3)
  615.                         configFile.save(configPath)
  616.                         slc = 0
  617.                         shell.run(cFilePath)
  618.                     end
  619.                 elseif X==51 and Y==17 and button==1 then
  620.                     if currentUser == "admin" then
  621.                         QuickTils.bColor(backColor)
  622.                         QuickTils.color(textColor)
  623.                         QuickTils.cursor(40,17)
  624.                         print(string.rep(" ",10))
  625.                         QuickTils.cursor(40,17)
  626.                         local newPass3 = read()
  627.                         configFile.setSectionedValue("Accounts","basicPass3",newPass3)
  628.                         configFile.save(configPath)
  629.                         slc = 0
  630.                         shell.run(cFilePath)
  631.                     elseif currentUser == "user3" then
  632.                         QuickTils.bColor(backColor)
  633.                         QuickTils.color(textColor)
  634.                         QuickTils.cursor(40,17)
  635.                         print(string.rep(" ",10))
  636.                         QuickTils.cursor(40,17)
  637.                         local newPass3 = read()
  638.                         configFile.setSectionedValue("Accounts","basicPass3",newPass3)
  639.                         configFile.save(configPath)
  640.                         slc = 0
  641.                         shell.run(cFilePath)
  642.                     end
  643.                 end
  644.             end
  645.         elseif slc == 3 then
  646.             palletX, palletY = 33, 14
  647.             if event == "mouse_click" then
  648.                 if X==47 and Y==9 and button==1 then
  649.                     QuickTils.bColor(backColor)
  650.                     QuickTils.color(textColor)
  651.                     QuickTils.cursor(33,9)
  652.                     print("        ")
  653.                     QuickTils.cursor(33,9)
  654.                     local bgImage = read()
  655.                     if fs.exists("/AquaOS/Resources/.backgrounds/"..bgImage) then
  656.                         configFile.setSectionedValue("Appearance","bGPic",bgImage)
  657.                         configFile.save(configPath)
  658.                         slc = 0
  659.                         shell.run(cFilePath)
  660.                     end
  661.                 elseif X>=3 and X<=8 and Y==1 and button==1 then
  662.                     return
  663.                     shell.run(mFilePath)
  664.                 elseif X==17 and Y==9 and button==1 then slc = 2
  665.                     drawBarUsers()
  666.                 elseif X==17 and Y==8 and button==1 then slc = 1
  667.                     drawBarDesktop()
  668.                 elseif X==palletX and Y==palletY and button==1 then
  669.                     configFile.setSectionedValue("Appearance","backColor","1")
  670.                     configFile.save(configPath)
  671.                     slc = 0
  672.                     shell.run(cFilePath)
  673.                 elseif X==palletX+2 and Y==palletY and button==1 then
  674.                     configFile.setSectionedValue("Appearance","backColor","2")
  675.                     configFile.save(configPath)
  676.                     slc = 0
  677.                     shell.run(cFilePath)
  678.                 elseif X==palletX+4 and Y==palletY and button==1 then
  679.                     configFile.setSectionedValue("Appearance","backColor","4")
  680.                     configFile.save(configPath)
  681.                     slc = 0
  682.                     shell.run(cFilePath)
  683.                 elseif X==palletX+6 and Y==palletY and button==1 then
  684.                     configFile.setSectionedValue("Appearance","backColor","8")
  685.                     configFile.save(configPath)
  686.                     slc = 0
  687.                     shell.run(cFilePath)   
  688.                 elseif X==palletX and Y==palletY+1 and button==1 then
  689.                     configFile.setSectionedValue("Appearance","backColor","16")
  690.                     configFile.save(configPath)
  691.                     slc = 0
  692.                     shell.run(cFilePath)
  693.                 elseif X==palletX+2 and Y==palletY+1 and button==1 then
  694.                     configFile.setSectionedValue("Appearance","backColor","32")
  695.                     configFile.save(configPath)
  696.                     slc = 0
  697.                     shell.run(cFilePath)
  698.                 elseif X==palletX+4 and Y==palletY+1 and button==1 then
  699.                     configFile.setSectionedValue("Appearance","backColor","64")
  700.                     configFile.save(configPath)
  701.                     slc = 0
  702.                     shell.run(cFilePath)
  703.                 elseif X==palletX+6 and Y==palletY+1 and button==1 then
  704.                     configFile.setSectionedValue("Appearance","backColor","128")
  705.                     configFile.save(configPath)
  706.                     slc = 0
  707.                     shell.run(cFilePath)
  708.                 elseif X==palletX and Y==palletY+2 and button==1 then
  709.                     configFile.setSectionedValue("Appearance","backColor","256")
  710.                     configFile.save(configPath)
  711.                     slc = 0
  712.                     shell.run(cFilePath)
  713.                 elseif X==palletX+2 and Y==palletY+2 and button==1 then
  714.                     configFile.setSectionedValue("Appearance","backColor","512")
  715.                     configFile.save(configPath)
  716.                     slc = 0
  717.                     shell.run(cFilePath)
  718.                 elseif X==palletX+4 and Y==palletY+2 and button==1 then
  719.                     configFile.setSectionedValue("Appearance","backColor","1024")
  720.                     configFile.save(configPath)
  721.                     slc = 0
  722.                     shell.run(cFilePath)
  723.                 elseif X==palletX+6 and Y==palletY+2 and button==1 then
  724.                     configFile.setSectionedValue("Appearance","backColor","2048")
  725.                     configFile.save(configPath)
  726.                     slc = 0
  727.                     shell.run(cFilePath)
  728.                 elseif X==palletX and Y==palletY+3 and button==1 then
  729.                     configFile.setSectionedValue("Appearance","backColor","4096")
  730.                     configFile.save(configPath)
  731.                     slc = 0
  732.                     shell.run(cFilePath)
  733.                 elseif X==palletX+2 and Y==palletY+3 and button==1 then
  734.                     configFile.setSectionedValue("Appearance","backColor","8192")
  735.                     configFile.save(configPath)
  736.                     slc = 0
  737.                     shell.run(cFilePath)
  738.                 elseif X==palletX+4 and Y==palletY+3 and button==1 then
  739.                     configFile.setSectionedValue("Appearance","backColor","16384")
  740.                     configFile.save(configPath)
  741.                     slc = 0
  742.                     shell.run(cFilePath)
  743.                 elseif X==palletX+6 and Y==palletY+3 and button==1 then
  744.                     configFile.setSectionedValue("Appearance","backColor","32768")
  745.                     configFile.save(configPath)
  746.                     slc = 0
  747.                     shell.run(cFilePath)
  748.                 end
  749.             end
  750.         end        
  751.     end
  752. end
Advertisement
Add Comment
Please, Sign In to add comment