Advertisement
PolskiWisnia

NextUI Mobile Menu

Nov 13th, 2019
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.57 KB | None | 0 0
  1. local function s(...) return sleep(...) end
  2. local function w(...) return write(...) end
  3. local function p(...) return print(...) end
  4. local function tw(...) return term.write(...) end
  5. local function scp(...) return term.setCursorPos(...) end
  6. local function sbc(...) return term.setBackgroundColor(...) end
  7. local function stc(...) return term.setTextColor(...) end
  8. local function tc(...) return term.clear(...) end
  9. local function tcl(...) return term.clearLine(...) end
  10. local function r(...) return shell.run(...) end
  11. local function sp(...) return textutils.slowPrint(...) end
  12. local function sw(...) return textutils.slowWrite(...) end
  13. local function fse(...) return fs.exists(...) end
  14. local function pul(...) return paintutils.loadImage(...) end
  15. local function pud(...) return paintutils.drawImage(...) end
  16. local function pfb(...) return paintutils.drawFilledBox(...) end
  17. local function su(...) return os.shutdown(...) end
  18. local function re(...) return os.reboot(...) end
  19. local function pdp(...) return paintutils.drawPixel(...) end
  20.  
  21. function ustawienia()
  22. while true do
  23. pfb(1, 2, 26, 20, colors.black)
  24. pfb(1, 2, 26, 2, colors.white)
  25. pdp(26,2, colors.red)
  26. sbc(colors.white)
  27. stc(colors.black)
  28. scp(1,2)
  29. p("Ustawienia NextUI")
  30. sbc(colors.black)
  31. stc(colors.white)
  32. p("System NextUI Mobile 1.0")
  33. p("Zmien nazwe urzadzenia")
  34. local event, click, x, y = os.pullEvent("mouse_click")
  35. if x == 26 and y == 2 then system() end
  36. if x>0 and x<27 and y == 4 then
  37.  scp(1,5)
  38.  w("Wpisz nowa nazwe: ")
  39.  nazwa = read()
  40.  os.setComputerLabel(nazwa)
  41.  ustawienia()
  42. end
  43. end
  44. end
  45.  
  46. function obraz()
  47. tc()
  48. pfb(1, 2, 26, 20, colors.cyan)
  49. pdp(25, 20, colors.orange)
  50. pdp(26, 20, colors.red)
  51. scp(1,1)
  52. sbc(colors.blue)
  53. stc(colors.white)
  54. p("NextUI Mobile. Microcraft ")
  55. sbc(colors.green)
  56. scp(7,20)
  57. w("Start")
  58. scp(13,20)
  59. w("Ustawienia")
  60. end
  61.  
  62.  
  63. function mysz1()
  64. local event, click, x, y = os.pullEvent("mouse_click")
  65. if x == 25 and y == 20 then re() end
  66. if x == 26 and y == 20 then su() end
  67. if x>6 and x<13 and y == 20 then aplikacje() end
  68. if x>13 and x<24 and y == 20 then ustawienia() end
  69. end
  70.  
  71.  
  72. function aplikacje()
  73. while true do
  74. pfb(1, 2, 26, 20, colors.black)
  75. pfb(1, 2, 26, 2, colors.white)
  76. scp(1,2)
  77. stc(colors.black)
  78. p("Aplikacje NextUI")
  79. pdp(26,1, colors.red)
  80. pfb(2, 4, 3, 5, colors.green)
  81. scp(2,6)
  82. sbc(colors.black)
  83. stc(colors.white)
  84. p("Tetris")
  85. local event, click, x, y = os.pullEvent("mouse_click")
  86. if x>1 and x<4 and y>3 and y<6 then r("falling") end
  87. if x == 26 and y == 1 then system() end
  88. end
  89. end
  90.  
  91.  
  92. function system()
  93. while true do
  94. obraz()
  95. mysz1()
  96. end
  97. end
  98.  
  99. system()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement