Advertisement
MarcoPolo0306

Lastest News

Apr 29th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. local w,h = term.getSize()
  2.  
  3. function drawWindow()
  4.   local tbarC = colors.lightBlue
  5.   local tBartC = colors.white
  6.   term.setBackgroundColor(colors.white)
  7.   term.clear()
  8.   term.setCursorPos(1,1)
  9.   term.setBackgroundColor(tbarC)
  10.   term.setTextColor(tBartC)
  11.   term.clearLine()
  12.   term.setCursorPos(2,1)
  13.   write("News")
  14.   term.setCursorPos(w,1)
  15.   term.setBackgroundColor(colors.red)
  16.   print("X")
  17.   term.setBackgroundColor(colors.white)
  18.   term.setTextColor(colors.gray)
  19. end
  20.  
  21. function titleBar()
  22.   term.setCursorPos(1,h)
  23.   term.setBackgroundColor(tBarC)
  24.   term.setTextColor(tBartC)
  25.   term.clearLine()
  26.   term.setTextColor(tBartC)
  27.   term.setCursorPos(1, h)
  28.   write(" Menu ")
  29. end
  30.  
  31. function menu()
  32.     term.setTextColor(colors.gray)
  33.     term.setBackgroundColor(colors.white)
  34.     term.setCursorPos(1,2)
  35.     print("MarcoSoft news")
  36.     print(" ")
  37.     print("M-OS 1.1.4 (posted 3/5/17)")
  38.     print("M-OS 1.2 is coming soon!")
  39.     print(" ")
  40.     print("New features:")
  41.     print(" ")
  42.     print("- App store")
  43.     print("- New programs menu")
  44.     print("- Crash Screen")
  45.     print(" ")
  46. end
  47.  
  48. drawWindow()
  49. titleBar()
  50. menu()
  51.  
  52. while true do
  53.     local event, button, X, Y = os.pullEvent()
  54.     if event == "mouse_click" then
  55.         if X == w and Y==1 and button ==1 then
  56.             term.clear()
  57.             fs.delete("m-os/programs/.latestNews")
  58.             shell.run("m-os/desktop")
  59.         end
  60.     end
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement