pepeknamornik

VZOR MODERN APP PD

Jul 6th, 2020 (edited)
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.01 KB | None | 0 0
  1. local verze = "20.0707.R1"
  2. local anim = 0.1
  3. local w, h = term.getSize()
  4. ----------------------------------------------------
  5. local f=fs.open("/C/system/RAM/user","r")
  6. user=f.readLine()
  7. pass=f.readLine()
  8. Fname=f.readLine()
  9. Lname=f.readLine()
  10. f.close()
  11. local function bgc(barvaP) term.setBackgroundColor(barvaP) end
  12. local function txc(barvaP) term.setTextColor(barvaP) end
  13. local function curs(xi,yi) term.setCursorPos(xi,yi) end
  14. local function Barvy()
  15.     if fs.exists ("/C/system/Users/"..user.."/.Registry/colors") then
  16.     local data = fs.open("/C/system/Users/"..user.."/.Registry/colors", "r")
  17.     BarPoz = tonumber(data.readLine())
  18.     BarTxt = tonumber(data.readLine())
  19.     data.close()
  20.     end
  21.     if BarPoz == nil or BarTxt == nil then BarPoz = 2048 BarTxt = 1 end
  22. end
  23.  
  24. function ukonceni ()
  25.     fs.delete (RamCesta)
  26.     error()
  27. end
  28.  
  29. function cbarva()
  30. lista.setTextColor(colors.black)
  31. lista.setBackgroundColor(colors.gray)
  32. end
  33.  
  34. function defaultvalue()
  35. end
  36.  
  37. function start()
  38. defaultvalue()
  39. Barvy()
  40. local myWindow = window.create(term.current(),w/2-11,h/2-5,25,9)
  41. myWindow.setBackgroundColor(colors.yellow)
  42. myWindow.setTextColor(colors.black)
  43. myWindow.clear()
  44. myWindow.setCursorPos (8, 5)
  45. myWindow.write"Help Catalog"
  46. myWindow.setCursorPos (1, 9)
  47. myWindow.write(verze)
  48. myWindow.setCursorPos (1, 1)
  49. myWindow.write"Pepek@Soft"
  50. myWindow.setCursorPos (22, 9)
  51. myWindow.write"2020"
  52. sleep(1)
  53. menu()
  54. end
  55.  
  56. function plocha()
  57. w, h = term.getSize()
  58. paintutils.drawLine(1, 1, w, 1, nastaveni.barva)
  59. paintutils.drawPixel (w,1, colors.red)
  60. term.setCursorPos (w,1)
  61. term.setTextColor(text.barva)
  62. write "*"
  63. barW = window.create(term.current(),1,2,w,1)
  64. barW.setBackgroundColor(colors.gray)
  65. barW.clear()
  66. barW.setTextColor(colors.white)
  67. barW.setCursorPos(2,1)
  68. barW.write"Samba Manager >"
  69. pozadi = window.create(term.current(),13,3,w,h-2)
  70. pozadi.setBackgroundColor(colors.white)
  71. pozadi.setTextColor(colors.black)
  72. pozadi.clear()
  73. lista = window.create(term.current(),1,3,12,h-2)
  74. lista.setBackgroundColor(nastaveni.barva)
  75. lista.setTextColor(text.barva)
  76. lista.clear()
  77. lista.setCursorPos(2,3)
  78. lista.write"Dashboard"
  79. lista.setCursorPos(2,h-2)
  80. lista.setTextColor(colors.white)
  81. lista.write("Pepek@Soft")
  82. term.setBackgroundColor(colors.lightGray)
  83. end
  84. -----------------------------------------------------------------------------
  85. local page = "main"
  86.  
  87. function main()
  88. barW.setCursorPos(19,1)
  89. barW.write"Dashboard"
  90. pozadi.setCursorPos(2,2)
  91. pozadi.write"it Will be Soon,"
  92. pozadi.setCursorPos(2,3)
  93. pozadi.write"we are working on development"
  94. end
  95.  
  96. function menu()
  97.     plocha()
  98.     if (page == "main") then
  99.         main ()
  100.     end
  101.  
  102.     while true do
  103.         local event, button, x, y = os.pullEvent("mouse_click")
  104.         xy = x..","..y
  105.        
  106.         if event == "mouse_click" and x >= 2 and x <= 12 and y == 5 then
  107.         cbarva()
  108.         lista.setCursorPos(1,3)--
  109.         lista.write" Dashboard  "
  110.         sleep(anim)
  111.         page = "main"
  112.         menu()
  113.         end
  114.        
  115.        
  116.         if x == w and y == 1 then
  117.             ukonceni ()
  118.         else
  119.             menu() -------- stejne jako nazev funkce
  120.         end
  121.     end
  122. end
  123.  
  124. start()
Add Comment
Please, Sign In to add comment