Advertisement
RespawnTime

TimeOS Kernel

Nov 20th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.58 KB | None | 0 0
  1. ---TimeOS kernel [OS_KRNL]
  2. ---It's used for almost all TimeOS functions,Greatly reducing the OS line count because the OS files don't need to store function ---data
  3.  
  4. os.loadAPI ("APIs/fLib")
  5. user = fLib.getLine ("conf", 1)
  6.  
  7.  
  8. -----[GUI Functions]
  9. function titleBar()
  10.   term.setCursorPos(1,1)
  11.   term.setBackgroundColor(colors.white)
  12.   term.setTextColor(colors.black)
  13.   term.clearLine()
  14.   term.setCursorPos(1, 1)
  15.   print("RevengeOS")
  16.   term.setCursorPos(20,1)
  17.   print ("Welcome,"..user)
  18. end
  19.  
  20. function titleBarAbout()
  21.   term.setCursorPos(1,1)
  22.   term.setBackgroundColor(colors.white)
  23.   term.setTextColor(colors.black)
  24.   term.clearLine()
  25.   term.setCursorPos(1, 1)
  26.   print("TimeOS")
  27.   term.setBackgroundColor (colors.lightGray)
  28.   term.setCursorPos (10,1)
  29.   print ("Desktop X")
  30.   term.setCursorPos (21,1)
  31.   term.setBackgroundColor (colors.gray)
  32.   print ("About TimeOS X")
  33.   term.setBackgroundColor (colors.white)
  34. end
  35.  os.loadAPI ("APIs/fLib")
  36. name1 = fLib.getLine ("desktop.cfg", 2)
  37. name2 = fLib.getLine ("desktop.cfg", 4)
  38. name3 = fLib.getLine ("desktop.cfg", 6)
  39. name4 = fLib.getLine ("desktop.cfg", 8)
  40. name5 = fLib.getLine ("desktop.cfg", 10)
  41. name6 = fLib.getLine ("desktop.cfg", 12)
  42. name7 = fLib.getLine ("desktop.cfg", 14)
  43. name8 = fLib.getLine ("desktop.cfg", 16)
  44. name9 = fLib.getLine ("desktop.cfg", 18)
  45. name10 = fLib.getLine ("desktop.cfg", 20)
  46. name11 = fLib.getLine ("desktop.cfg", 22)
  47. name12 = fLib.getLine ("desktop.cfg", 24)
  48. name13 = fLib.getLine ("desktop.cfg", 26)
  49. name14 = fLib.getLine ("desktop.cfg", 28)
  50. name15 = fLib.getLine ("desktop.cfg", 30)
  51.  
  52. function drawDesktop()
  53.   term.clear()
  54.   term.setBackgroundColor(colors.cyan)
  55.   term.setTextColor(colors.black)
  56.   term.clear()
  57.   titleBar()
  58.   term.setBackgroundColor (colors.cyan)
  59.   term.setCursorPos (3,3)
  60.   print (""..name1)
  61.   term.setCursorPos (12,3)
  62.   term.setBackgroundColor (colors.cyan)
  63.   print (""..name2)
  64.   term.setCursorPos (21,3)
  65.   print (""..name3)
  66.   term.setCursorPos (3,6)
  67.   term.setBackgroundColor (colors.cyan)
  68.   print (""..name4)
  69. term.setCursorPos (12,6)
  70.   print (""..name5)
  71.   term.setCursorPos (21,6)
  72.   term.setBackgroundColor (colors.cyan)
  73.   print (""..name6)
  74. term.setCursorPos (3,9)
  75.   print (""..name7)
  76.   term.setCursorPos (12,9)
  77.   term.setBackgroundColor (colors.cyan)
  78.   print (""..name8)
  79.  term.setCursorPos (21,9)
  80.   print (""..name9)
  81.   term.setCursorPos (3,12)
  82.   term.setBackgroundColor (colors.cyan)
  83.   print (""..name10)
  84. term.setCursorPos (12,12)
  85.   print (""..name11)
  86.   term.setCursorPos (21,12)
  87.   term.setBackgroundColor (colors.cyan)
  88.   print (""..name12)
  89.  term.setCursorPos (3,15)
  90.   print (""..name13)
  91.   term.setCursorPos (12,15)
  92.   term.setBackgroundColor (colors.cyan)
  93.   print (""..name14)
  94. term.setCursorPos (21,15)
  95.   print (""..name15)
  96. end
  97.  
  98.  
  99.  
  100.  
  101.  
  102. function about()
  103.   term.setBackgroundColor (colors.white)
  104.   term.setTextColor (colors.black)
  105.   term.clear()
  106.   titleBar()
  107.   term.setCursorPos (3,3)
  108.   print ("TimeOS Alpha 3.00")
  109.   term.setCursorPos (3,4)
  110.   print ("by Time.")
  111.   term.setCursorPos (2,6)
  112.   print ("Credits:")
  113.   term.setCursorPos (3,7)
  114.   print ("GravityScore's LuaIDE,inventor2514's GUI File Browser.")
  115.   term.setCursorPos (2,12)
  116.   print ("Disk Space:")
  117.   term.setCursorPos (3, 13)
  118.   print (fs.getFreeSpace("/"))
  119.   term.setCursorPos (14,13)
  120.   print ("Bytes free")
  121. end
  122.  
  123.  
  124.  
  125.  
  126. function drawMenu1()
  127. term.setTextColor(colors.black)
  128. term.setBackgroundColor(colors.white)
  129. term.setCursorPos(1,2)
  130. print("                 ")
  131. term.setCursorPos (1,5)
  132. print("Sleep            ")
  133. term.setCursorPos (1,3)  
  134. print("Desktop          ")
  135. term.setCursorPos(1,4)
  136. print("About TimeOS     ")
  137. term.setCursorPos(1,6)
  138. print("-----------------")
  139. term.setCursorPos(1,7)
  140. print("Update TimeOS    ")
  141. term.setCursorPos(1,8)
  142. print("-----------------")
  143. term.setCursorPos(1,9)
  144. print("Reboot           ")
  145. term.setCursorPos(1,10)
  146. print("Shutdown         ")
  147. term.setCursorPos(1,11)
  148. print("                 ")
  149. end
  150.  
  151.  
  152.  
  153. function drawLoginBox()
  154. term.setCursorBlink (false)
  155. term.clear()
  156. term.setTextColor (colors.blue)
  157. term.setBackgroundColor (colors.gray)
  158. term.setCursorPos (12,5)
  159. print("TimeOS Login       ")
  160. term.setCursorPos (33,5)
  161. term.setBackgroundColor (colors.lightGray)
  162. print ("X")
  163. term.setBackgroundColor (colors.white)
  164. term.setCursorPos (12,6)
  165. print ("                      ")
  166. term.setCursorPos (12,8)
  167. print ("                      ")
  168. term.setCursorPos (12,10)
  169. print ("                      ")
  170. term.setCursorPos (12,7)
  171. print ("User: ")
  172. term.setCursorPos (12,9)
  173. print ("Pass: ")
  174. term.setCursorPos (33,7)
  175. print (" ")
  176. term.setCursorPos (33,9)
  177. print (" ")
  178. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement