Marlingaming

CC Tweaked CCSPS 20 - Desktop

Feb 18th, 2022 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. local tArg = {...}
  2. local w, h = term.getSize()
  3. local Shortcuts = {}
  4. local TaskbarItems = {}
  5. local TabsSaved = {}
  6.  
  7. local function Clear()
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. end
  11.  
  12. function DrawDesktop()
  13. term.setBackgroundColor(colors.black)
  14. Clear()
  15. paintutils.drawBox(1,h,w,h,colors.lightGray)
  16. paintutils.drawBox(w - 6, h, w, h, colors.white)
  17. term.setBackgroundColor(colors.black)
  18. end
  19.  
  20. function DrawShortcuts()
  21.  
  22. end
  23.  
  24. function DrawTaskbarItems()
  25.  
  26. end
  27.  
  28. function DrawTab()
  29. paintutils.drawFilledBox(1,1,w,h - 1,colors.white)
  30. paintutils.drawbox(1,1,w,1, colors.lightGray)
  31. paintutils.drawBox(w,1,w,1,colors.red)
  32. paintutils.drawBox(w - 1, 1, w - 1, 1, colors.blue)
  33. term.setBackgroundColor(colors.white)
  34. term.setTextColor(colors.black)
  35. term.setCursorPos(1,2)
  36. end
  37.  
  38. function OpenDesktop()
  39. DrawDesktop()
  40. DrawShortcuts()
  41. DrawTaskBarItems()
  42. DesktopControl()
  43. end
  44.  
  45. function DesktopControl()
  46.  
  47. end
  48.  
  49. function TabControl()
  50. local n = 0
  51. local a, b, c, d
  52. while true do
  53. a, b, c, d = os.pullEvent("mouse_click")
  54. if d == 1 then
  55. if c == w then n = 1 end
  56. if c == w - 1 then n = 2 end
  57. elseif d == h then
  58. if c > w - 7 then n = 3 else n = 4 end
  59. end
  60. if d >= 2 and d <= h - 1 then n = 5 end
  61. if n > 0 then break end
  62. end
  63. if n == 1 then
  64. OpenDesktop()
  65. elseif n == 2 then
  66. TabsSaved[#TabsSaved + 1] = tArg[1]
  67. OpenDesktop()
  68. elseif n == 3 then
  69.  
  70. elseif n == 4 then
  71.  
  72. elseif n == 5 then
  73. shell.run(,"click",c,d)
  74. TabControl()
  75. end
  76. end
  77.  
  78. DrawDesktop()
  79. if tArg[1] == "Desktop" then
  80. OpenDesktop()
  81. else
  82. DrawTaskbarItems()
  83. DrawTab()
  84. TabControl()
  85. end
Add Comment
Please, Sign In to add comment