Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.26 KB | None | 0 0
  1. local PB_RED = PB_RED or 255
  2. local PB_GREEN = PB_GREEN or 255
  3. local PB_BLUE = PB_BLUE or 255
  4. local trace = ErrorNoHalt
  5. local drawcross = drawcross or true
  6.  
  7. local LoadedColor = LoadedColor or false
  8.  
  9. local htock = surface.GetTextureID("hud/fo/tick")
  10. local hammo = surface.GetTextureID("hud/fo/ammo")
  11. local cross = surface.GetTextureID("hud/fo/crhossair")
  12.  
  13. local cross_normal = Material("forp/glow_crosshair.png", "noclamp smooth")
  14. local cross_highlight = Material("forp/glow_crosshair_filled.png", "noclamp smooth")
  15. local bottom_infobars = Material("forp/glow_hud_bottom_info_seperator_divider.png", "noclamp smooth")
  16.  
  17. concommand.Add("refreshcolor", function() SCHEMA:RefreshColor() end)
  18.  
  19. function SCHEMA:RefreshColor()
  20. LoadedColor = false
  21. end
  22.  
  23. function SCHEMA:GetPBColor(a)
  24. if (!LoadedColor) then
  25. if file.Exists("lazaruscolors.txt", "DATA") then
  26. local colors = string.Explode(" ", file.Read("lazaruscolors.txt", "DATA"))
  27. PB_RED = colors[1]
  28. PB_GREEN = colors[2]
  29. PB_BLUE = colors[3]
  30.  
  31.  
  32. LoadedColor = true
  33. else
  34. file.Write("lazaruscolors.txt", "255 194 0")
  35.  
  36. PB_RED = 255
  37. PB_GREEN = 194
  38. PB_BLUE = 0
  39.  
  40. LoadedColor = true
  41. end
  42. end
  43.  
  44. return Color(PB_RED, PB_GREEN, PB_BLUE, a or 255)
  45. end
  46. ---------------------------------------------------------------------------------------
  47.  
  48. ---------------------------------------------------------------------------------------
  49.  
  50. -- This HUD was created by Gonzolablog, we have permission to use a modified version --
  51.  
  52. ---------------------------------------------------------------------------------------
  53.  
  54. ---------------------------------------------------------------------------------------
  55.  
  56. function SCHEMA.DrawBlur(x,y,text,align,blur,color,font,blurfont,alpha)
  57. local alpha = alpha or 255
  58.  
  59. if blur == nil then
  60. blur = false
  61. end
  62.  
  63. if color and color != 0 then
  64. color = color
  65. else
  66. color = SCHEMA:GetPBColor()
  67. end
  68.  
  69. local normfo, blurfo = "FOFont_normal", "FOFont_normal_blur"
  70.  
  71. if (font and blurfont) then
  72. normfo = font
  73. blurfo = blurfont
  74. end
  75.  
  76. if (!blur) then
  77. for i =0,3 do
  78. draw.SimpleText(text, blurfo, x, y, Color(0, 0, 0, alpha), align, 0)
  79. end
  80.  
  81. draw.SimpleText(text, normfo, x, y, color, align, 0)
  82. else
  83. for i =0,3 do
  84. draw.SimpleText(text, "FOFont_big_blur", x, y, Color(0, 0, 0, alpha), align, 0)
  85. end
  86.  
  87. draw.SimpleText(text, "FOFont_big", x, y, color, align, 0)
  88. end
  89. end
  90.  
  91. local validclasses = {"nut_keys", "nut_fists", "weapon_physgun", "gmod_tool"}
  92.  
  93. local val = val or ""
  94. local weight = weight or ""
  95. local interactname = interactname or 0
  96. local name = name or ""
  97. local itemcolor =itemcolor or 0
  98. local isdoor = isdoor or false
  99. local isbench = isbench or false
  100.  
  101. hook.Add("Think", "HUD_DrawInfoCheck", function()
  102. local trace = LocalPlayer():GetEyeTraceNoCursor()
  103. local refresh = true
  104.  
  105. if (LocalPlayer():GetPos():Distance(trace.HitPos)) < 128 then
  106. if (trace.Entity and trace.Entity:GetClass() != "Worldspawn") then
  107. if (trace.Entity.GetInteractionData) then
  108. local interactinfo = trace.Entity:GetInteractionData()
  109. itemcolor = interactinfo[5] or 0
  110. val = interactinfo[4] or "--"
  111. weight = interactinfo[3] or "--"
  112. interactname = interactinfo[2] or ""
  113. name = interactinfo[1] or "Take"
  114.  
  115. refresh = false
  116. elseif (trace.Entity.isdoor) then
  117. name = trace.Entity:GetType()
  118. interactname = trace.Entity:GetDestination()
  119. isdoor = true
  120. refresh = false
  121. elseif (trace.Entity.craftingbench) then
  122. name = "horse"
  123. interactname = "horse"
  124. isbench = true
  125. refresh = false
  126. end
  127. end
  128. end
  129.  
  130. if (refresh) then
  131. isdoor, itemcolor, weight, interactname, val, name = false, 0, "", 0, "", ""
  132. isbench = false
  133. end
  134. end)
  135.  
  136. hook.Add("HUDPaint","DrawHUDFO",function()
  137.  
  138. if !nut.config.drawHUD then
  139. return
  140. end
  141.  
  142. if LocalPlayer().character == nil then
  143. return
  144. end
  145. local class = "nut_keys"
  146. if (LocalPlayer():Alive() and LocalPlayer():GetActiveWeapon():IsValid()) then
  147. class = LocalPlayer():GetActiveWeapon():GetClass()
  148. end
  149.  
  150. if table.HasValue(validclasses, class) then
  151. if (LocalPlayer():Alive() and !LocalPlayer():IsRagdolled()) then
  152. if !(LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType()) > 0 or LocalPlayer():GetActiveWeapon():Clip1() > -1) then
  153. if (name != "" and interactname != "") then
  154. if (!isdoor and !isbench) then
  155. if (drawcross) then
  156. surface.SetMaterial(cross_highlight)
  157. surface.SetDrawColor(SCHEMA:GetPBColor())
  158. surface.DrawTexturedRectRotated(ScrW()/2, ScrH() /2, 64,64,0)
  159. end
  160.  
  161. surface.SetMaterial(bottom_infobars)
  162. surface.DrawTexturedRectRotated(ScrW()/2, ScrH() - 40, 323, 128, 0)
  163.  
  164. SCHEMA.DrawBlur(ScrW()/2, ScrH() - 160,"E) "..name, 1, false)
  165. SCHEMA.DrawBlur(ScrW()/2, ScrH() - 136, interactname, 1, false)
  166.  
  167.  
  168. SCHEMA.DrawBlur(ScrW()/2 - 130, ScrH() - 80,"WG", 0, false)
  169. SCHEMA.DrawBlur(ScrW()/2 - 20, ScrH() - 80,weight, 2, false)
  170.  
  171. if (itemcolor != 0) then
  172. if string.len(tostring(val)) > 8 then
  173. SCHEMA.DrawBlur(ScrW()/2 + 20, ScrH() - 80,"VAL", 0, false)
  174. SCHEMA.DrawBlur(ScrW()/2 + 56, ScrH() - 80,string.upper(tostring(val)), 0, false, itemcolor)
  175. else
  176. SCHEMA.DrawBlur(ScrW()/2 + 20, ScrH() - 80,"VAL", 0, false)
  177. SCHEMA.DrawBlur(ScrW()/2 + 120, ScrH() - 80,string.upper(tostring(val)), 2, false, itemcolor)
  178. end
  179. else
  180. if string.len(tostring(val)) > 8 then
  181. SCHEMA.DrawBlur(ScrW()/2 + 20, ScrH() - 80,"VAL", 0, false)
  182. SCHEMA.DrawBlur(ScrW()/2 + 56, ScrH() - 80,string.upper(tostring(val)), 0, false)
  183. end
  184. SCHEMA.DrawBlur(ScrW()/2 + 20, ScrH() - 80,"VAL", 0, false)
  185. SCHEMA.DrawBlur(ScrW()/2 + 120, ScrH() - 80,string.upper(tostring(val)), 2, false)
  186. end
  187. elseif (isbench) then
  188. if (drawcross) then
  189. surface.SetMaterial(cross_highlight)
  190. surface.SetDrawColor(SCHEMA:GetPBColor())
  191. surface.DrawTexturedRectRotated(ScrW()/2, ScrH() /2, 64,64,0)
  192. end
  193.  
  194. SCHEMA.DrawBlur(ScrW()/2, ScrH() - 160,"E) ".."Interact With Crafting Bench", 1, false)
  195. else
  196. if (drawcross) then
  197. surface.SetMaterial(cross_highlight)
  198. surface.SetDrawColor(SCHEMA:GetPBColor())
  199. surface.DrawTexturedRectRotated(ScrW()/2, ScrH() /2, 64,64,0)
  200. end
  201.  
  202. SCHEMA.DrawBlur(ScrW()/2, ScrH() - 160,"E) ".."Open", 1, false)
  203. SCHEMA.DrawBlur(ScrW()/2, ScrH() - 136, name.." to "..interactname, 1, false)
  204. end
  205. else
  206. if (drawcross) then
  207. surface.SetMaterial(cross_normal)
  208. surface.SetDrawColor(SCHEMA:GetPBColor())
  209. surface.DrawTexturedRectRotated(ScrW()/2, ScrH() /2, 64,64,0)
  210. end
  211. end
  212. end
  213. end
  214. end
  215.  
  216. surface.SetTexture(hammo)
  217. surface.SetDrawColor(PB_RED,PB_GREEN,PB_BLUE,255)
  218. surface.DrawTexturedRectRotated( ScrW() - 170, ScrH() - 40, 390,200,0 )
  219.  
  220. if LocalPlayer().character:GetVar("stamina", 0) <= 100 && LocalPlayer().character:GetVar("stamina", 0) then
  221. hl = LocalPlayer().character:GetVar("stamina", 0)
  222. for i=0,hl/2.75 do
  223. surface.SetTexture(htock)
  224. surface.SetDrawColor(PB_RED,PB_GREEN,PB_BLUE,255)
  225. surface.DrawTexturedRectRotated( ScrW() - 90 - i * 6, ScrH() - 100, 20,24,0 )
  226. end
  227.  
  228. elseif(LocalPlayer():Health() > 0) then
  229.  
  230. for i=0,36.3636 do
  231. surface.SetTexture(htock)
  232. surface.SetDrawColor(PB_RED,PB_GREEN,PB_BLUE,255)
  233. surface.DrawTexturedRectRotated( ScrW() - 100 - i * 7, ScrH() - 116, 24,30,0 )
  234. end
  235. end
  236. end)
  237.  
  238. local compass = surface.GetTextureID("hud/fo/compass")
  239. local npc = surface.GetTextureID("hud/fo/pointer2")
  240. local player = surface.GetTextureID("hud/fo/player_found")
  241. local objetive = surface.GetTextureID("hud/fo/objetive")
  242.  
  243. hook.Add("HUDPaint","DRAWFOTEXT",function()
  244.  
  245. if !nut.config.drawHUD then
  246. return
  247. end
  248.  
  249. SCHEMA.DrawBlur(90,ScrH() - 135,"HP",0)
  250. SCHEMA.DrawBlur(ScrW() - 95,ScrH() - 135,"STM",2)
  251.  
  252. if(LocalPlayer():GetActiveWeapon():IsValid()) then
  253. if LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType()) > 0 or LocalPlayer():GetActiveWeapon():Clip1() > -1 then
  254. if(LocalPlayer():GetActiveWeapon():Clip1() > -1) then
  255. SCHEMA.DrawBlur(ScrW() - 95,ScrH() - 80,tostring(LocalPlayer():GetActiveWeapon():Clip1()).."/"..tostring(LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType())),2)
  256. else
  257. SCHEMA.DrawBlur(ScrW() - 95,ScrH() - 80,tostring(LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType())),2)
  258. end
  259. end
  260. end
  261.  
  262. for c,b in pairs(ents.GetAll()) do
  263. if(b:GetNWBool("FOObjetive") == true) then
  264. ang = LocalPlayer():GetAngles().y - SCHEMA.GetAngleOfLineBetweenTwoPoints(LocalPlayer(),b)
  265. if (ang < -103) then
  266. ang = -104
  267. elseif(ang > 145) then
  268. ang = 145
  269. end
  270.  
  271. surface.SetTexture(objetive)
  272.  
  273. if(b:GetNWBool("Enemy") == true) then
  274. surface.SetDrawColor(255,75,75,255)
  275. else
  276. surface.SetDrawColor(PB_RED, PB_GREEN, PB_BLUE, 255)
  277. end
  278. surface.DrawTexturedRectRotated(ang + 202, ScrH() - 48 , 48,48,0 )
  279. end
  280. end
  281. surface.SetTexture(compass)
  282. surface.SetDrawColor(PB_RED, PB_GREEN, PB_BLUE, 255)
  283. SCHEMA.DrawPartialTexturedRect( 82, ScrH() - 97, 256, 64, (-LocalPlayer():GetAngles().y/360) * 1024, 0, 256, 64,1024,64 );
  284. end)
  285.  
  286. local htick = surface.GetTextureID("hud/fo/tick")
  287. local hbar = surface.GetTextureID("hud/fo/life_hud")
  288. local henemy = surface.GetTextureID("hud/fo/enemy_health")
  289. local armor = surface.GetTextureID("hud/fo/armor")
  290.  
  291. hook.Add("HUDPaint","FOHL",function()
  292. if !nut.config.drawHUD then
  293. return
  294. end
  295.  
  296. surface.SetTexture(hbar)
  297. surface.SetDrawColor(PB_RED, PB_GREEN, PB_BLUE, 255)
  298. surface.DrawTexturedRectRotated( 264, ScrH() - 40, 390,200,0 )
  299.  
  300. if(LocalPlayer():Health() <= 100 && LocalPlayer():Health() > 0) then
  301. hl = LocalPlayer():Health()
  302. for i=0,hl/2.75 do
  303. surface.SetTexture(htick)
  304. surface.SetDrawColor(PB_RED, PB_GREEN, PB_BLUE, 255)
  305. surface.DrawTexturedRectRotated( 92.5 + i * 6, ScrH() - 100, 20,24,0 )
  306. end
  307. elseif(LocalPlayer():Health() > 0) then
  308. for i=0,36.3636 do
  309. surface.SetTexture(htick)
  310. surface.SetDrawColor(PB_RED, PB_GREEN, PB_BLUE, 255)
  311. surface.DrawTexturedRectRotated( 92.5 + i * 6, ScrH() - 100, 20,24,0 )
  312. end
  313. end
  314.  
  315. if (LocalPlayer():Armor() > 0) then
  316. surface.SetTexture(armor)
  317. surface.SetDrawColor(PB_RED, PB_GREEN, PB_BLUE, 255)
  318. surface.DrawTexturedRectRotated( 327, ScrH() - 102, 20,20,0 )
  319. end
  320.  
  321. if(LocalPlayer():GetNWEntity("FOVictim"):IsValid()) then
  322. SCHEMA.DrawBlur(ScrW()/2,ScrH() - 85,LocalPlayer():GetNWEntity("FOVictim"):GetClass(),1,false)
  323.  
  324. surface.SetTexture(henemy)
  325. surface.SetDrawColor(255,70,70,255)
  326. surface.DrawTexturedRectRotated( ScrW() / 2 + 60, ScrH() - 75, 390,75,0 )
  327. exponent = LocalPlayer():GetNWInt("VOHLT")/LocalPlayer():GetNWInt("VLIFE") * 100
  328.  
  329. for i=0,exponent/6.5 do
  330. surface.SetTexture(htick)
  331. surface.SetDrawColor(255,70,70,255)
  332. surface.DrawTexturedRectRotated( ScrW() / 2 + 5 - i * 6, ScrH() - 100, 24,30,0 )
  333. end
  334.  
  335. for i=0,exponent/6.5 do
  336. surface.SetTexture(htick)
  337. surface.SetDrawColor(255,70,70,255)
  338. surface.DrawTexturedRectRotated( ScrW() / 2 + 10 + i * 6, ScrH() - 100, 23,30,0 )
  339. end
  340. end
  341. end)
  342.  
  343. function SCHEMA.DrawPartialTexturedRect(x, y, w, h, partx, party, partw, parth, texw, texh)
  344.  
  345. -- Verify that we recieved all arguments
  346. if !( x && y && w && h && partx && party && partw && parth && texw && texh ) then
  347.  
  348. return
  349. end
  350.  
  351. -- Get the positions and sizes as percentages / 100
  352. local percX, percY = partx / texw, party / texh
  353. local percW, percH = partw / texw, parth / texh
  354.  
  355. -- Process the data
  356. local vertexData = {
  357. {
  358. x = x,
  359. y = y,
  360. u = percX,
  361. v = percY
  362. },
  363. {
  364. x = x + w,
  365. y = y,
  366. u = percX + percW,
  367. v = percY
  368. },
  369. {
  370. x = x + w,
  371. y = y + h,
  372. u = percX + percW,
  373. v = percY + percH
  374. },
  375. {
  376. x = x,
  377. y = y + h,
  378. u = percX,
  379. v = percY + percH
  380. }
  381. }
  382. surface.DrawPoly( vertexData )
  383. end
  384.  
  385. --function SCHEMA.DrawPartialTexturedRect( x, y, w, h, partx, party, partw, parth, texturename )
  386. --
  387. -- if !( x && y && w && h && partx && party && partw && parth && texturename ) then
  388. -- return
  389. -- end
  390. --
  391. -- local texture = surface.GetTextureID(texturename)
  392. -- local texW, texH = surface.GetTextureSize( texture )
  393. -- local percX, percY = partx / texW, party / texH
  394. -- local percW, percH = partw / texW, parth / texH
  395. --
  396. -- local vertexData = {
  397. -- {
  398. -- x = x,
  399. -- y = y,
  400. -- u = percX,
  401. -- v = percY
  402. -- },
  403. -- {
  404. -- x = x + w,
  405. -- y = y,
  406. -- u = percX + percW,
  407. -- v = percY
  408. -- },
  409. -- {
  410. -- x = x + w,
  411. -- y = y + h,
  412. -- u = percX + percW,
  413. -- v = percY + percH
  414. -- },
  415. -- {
  416. -- x = x,
  417. -- y = y + h,
  418. -- u = percX,
  419. -- v = percY + percH
  420. -- }
  421. -- }
  422. --
  423. -- surface.SetTexture( texture )
  424. -- surface.SetDrawColor( 255, 255, 255, 255 * multiplo_fixture )
  425. -- surface.DrawPoly( vertexData )
  426. --end
  427.  
  428. local pointer = surface.GetTextureID("hud/fo/pointer")
  429. local cPos = Vector(0,0,0)
  430.  
  431. function SCHEMA.GetOurAttachment(npc) -- Create a selfmade function, that takes 1 argument.
  432. local ID = npc:LookupAttachment("eyes") -- this will return a number corresponding with the given attachment.
  433. return npc:GetAttachment( ID ) -- this will return a small table, see GetAttachment for more information.
  434. end
  435.  
  436. hook.Add("HUDPaint","PaintArrowsFO",function()
  437. if !nut.config.drawHUD then
  438. return
  439. end
  440.  
  441. for k,v in pairs(ents.FindInSphere(LocalPlayer():GetPos(),2048)) do
  442. if(v:IsNPC()) then
  443. if(v:LookupAttachment("eyes") != 0) then
  444.  
  445. cPos = SCHEMA.GetOurAttachment(v).Pos
  446. cPos = cPos + Vector(0,0,10)
  447. surface.SetTexture(pointer)
  448.  
  449. if(v:GetNWBool("Enemy") == true) then
  450. surface.SetDrawColor(255,75,75,255)
  451. else
  452. surface.SetDrawColor(PB_RED, PB_GREEN, PB_BLUE, 255)
  453. end
  454.  
  455. surface.DrawTexturedRectRotated( cPos:ToScreen().x, cPos:ToScreen().y , 32,32,0 )
  456. end
  457. end
  458. end
  459. end)
  460.  
  461. function SCHEMA.GetAngleOfLineBetweenTwoPoints(p1, p2)
  462. xDiff = p2:GetPos().x - p1:GetPos().x
  463. yDiff = p2:GetPos().y - p1:GetPos().y
  464. return math.atan2(yDiff, xDiff) * (180 / math.pi)
  465. end
  466.  
  467. local divider_left = Material("forp/glow_messages_left_seperator.png", "noclamp smooth")
  468. local divider_right = Material("forp/glow_messages_right_seperator.png", "noclamp smooth")
  469.  
  470.  
  471. SCHEMA.NotificationTimer = CurTime()
  472. SCHEMA.CurrentNotification = 0
  473. SCHEMA.Notifications = {} -- {message = "", messagetwo = "", messagethree = "", sound = "", image = 0, pos = 0}
  474.  
  475. --[[hook.Add("Think", "SCHEMA.NotificationThink", function()
  476. if (#SCHEMA.Notifications > 0) and (CurTime() > SCHEMA.NotificationTimer) then
  477. SCHEMA.CurrentNotification = SCHEMA.Notifications[#SCHEMA.Notifications]
  478. surface.PlaySound(SCHEMA.Notifications[#SCHEMA.Notifications].sound)
  479. SCHEMA.NotificationTimer = CurTime() + 4
  480. hook.Remove("HUDPaint", "PaintNotification")
  481.  
  482. local info = SCHEMA.Notifications[#SCHEMA.Notifications]
  483.  
  484. hook.Add("HUDPaint", "PaintNotification", function()
  485. if (SCHEMA.CurrentNotification.pos == 0) then
  486. surface.SetMaterial(divider_left)
  487. surface.SetDrawColor(SCHEMA:GetPBColor())
  488. surface.DrawTexturedRect(16, 16, (512*1.25), (128*1.25))
  489.  
  490. SCHEMA.DrawBlur(128, 38, SCHEMA.CurrentNotification.message, TEXT_ALIGN_LEFT, false, SCHEMA:GetPBColor())
  491. SCHEMA.DrawBlur(128, 58, SCHEMA.CurrentNotification.messagetwo, TEXT_ALIGN_LEFT, false, SCHEMA:GetPBColor())
  492. SCHEMA.DrawBlur(128, 78, SCHEMA.CurrentNotification.messagethree, TEXT_ALIGN_LEFT, false, SCHEMA:GetPBColor())
  493.  
  494. surface.SetMaterial(SCHEMA.NotificationMaterials[SCHEMA.CurrentNotification.image])
  495. surface.SetDrawColor(SCHEMA:GetPBColor())
  496. surface.DrawTexturedRect(16, 18, 128, 128)
  497. else
  498. SCHEMA.DrawBlur(ScrW() - 128, 38, SCHEMA.CurrentNotification.message, TEXT_ALIGN_RIGHT, false, SCHEMA:GetPBColor())
  499. SCHEMA.DrawBlur(ScrW() - 128, 58, SCHEMA.CurrentNotification.messagetwo, TEXT_ALIGN_RIGHT, false, SCHEMA:GetPBColor())
  500. SCHEMA.DrawBlur(ScrW() - 128, 78, SCHEMA.CurrentNotification.messagethree, TEXT_ALIGN_RIGHT, false, SCHEMA:GetPBColor())
  501.  
  502. surface.SetMaterial(divider_right)
  503. surface.SetDrawColor(SCHEMA:GetPBColor())
  504. surface.DrawTexturedRect((ScrW() - ((512*1.25) + 16)), 16, (512*1.25), (128*1.25))
  505.  
  506. surface.SetMaterial(SCHEMA.NotificationMaterials[SCHEMA.CurrentNotification.image])
  507. surface.SetDrawColor(SCHEMA:GetPBColor())
  508. surface.DrawTexturedRect((ScrW() - 150), 18, 128, 128)
  509. end
  510. end)
  511.  
  512. timer.Simple(4, function()
  513. hook.Remove("HUDPaint", "PaintNotification")
  514. end)
  515.  
  516. table.remove(SCHEMA.Notifications)
  517. end
  518. end)]]--
  519.  
  520. function PaintNotification()
  521. if #SCHEMA.Notifications > 0 then
  522. if not SCHEMA.Notifications[1].timer then
  523. -- this is new!
  524. surface.PlaySound(SCHEMA.Notifications[1].sound)
  525. SCHEMA.Notifications[1].timer = CurTime() + 4
  526. elseif SCHEMA.Notifications[1].timer <= CurTime() then
  527. -- times up, skip a frame but thats ok!
  528. table.remove(SCHEMA.Notifications, 1)
  529. return
  530. end
  531. if (SCHEMA.Notifications[1].pos == 0) then
  532. local alpha = 1
  533. local drawColor = Color(SCHEMA:GetPBColor().r, SCHEMA:GetPBColor().g, SCHEMA:GetPBColor().b, 255)
  534. if (SCHEMA.Notifications[1].timer - CurTime()) <= 0.5 then
  535. alpha = (2 * (SCHEMA.Notifications[1].timer - CurTime()))
  536. elseif (SCHEMA.Notifications[1].timer - CurTime()) >= 3.5 then
  537. alpha = (2 * (4 - (SCHEMA.Notifications[1].timer - CurTime())))
  538. end
  539. drawColor.a = 255 * alpha
  540.  
  541. surface.SetMaterial(divider_left)
  542. surface.SetDrawColor(drawColor)
  543. surface.DrawTexturedRect(16, 16, (512*1.25), (128*1.25))
  544.  
  545. SCHEMA.DrawBlur(128, 38, SCHEMA.Notifications[1].message, TEXT_ALIGN_LEFT, false, drawColor, "FOFont_normal", "FOFont_normal_blur", 255 * alpha)
  546. SCHEMA.DrawBlur(128, 58, SCHEMA.Notifications[1].messagetwo, TEXT_ALIGN_LEFT, false, drawColor, "FOFont_normal", "FOFont_normal_blur", 255 * alpha)
  547. SCHEMA.DrawBlur(128, 78, SCHEMA.Notifications[1].messagethree, TEXT_ALIGN_LEFT, false, drawColor, "FOFont_normal", "FOFont_normal_blur", 255 * alpha)
  548.  
  549. surface.SetMaterial(SCHEMA.NotificationMaterials[SCHEMA.Notifications[1].image])
  550. surface.SetDrawColor(drawColor)
  551. surface.DrawTexturedRect(16, 18, 128, 128)
  552. else
  553. local alpha = 1
  554. local drawColor = Color(SCHEMA:GetPBColor().r, SCHEMA:GetPBColor().g, SCHEMA:GetPBColor().b, 255)
  555. if (SCHEMA.Notifications[1].timer - CurTime()) <= 0.5 then
  556. alpha = (2 * (SCHEMA.Notifications[1].timer - CurTime()))
  557. elseif (SCHEMA.Notifications[1].timer - CurTime()) >= 3.5 then
  558. alpha = (2 * (4 - (SCHEMA.Notifications[1].timer - CurTime())))
  559. end
  560. drawColor.a = 255 * alpha
  561.  
  562. SCHEMA.DrawBlur(ScrW() - 128, 38, SCHEMA.Notifications[1].message, TEXT_ALIGN_RIGHT, false, drawColor, "FOFont_normal", "FOFont_normal_blur", 255 * alpha)
  563. SCHEMA.DrawBlur(ScrW() - 128, 58, SCHEMA.Notifications[1].messagetwo, TEXT_ALIGN_RIGHT, false, drawColor, "FOFont_normal", "FOFont_normal_blur", 255 * alpha)
  564. SCHEMA.DrawBlur(ScrW() - 128, 78, SCHEMA.Notifications[1].messagethree, TEXT_ALIGN_RIGHT, false, drawColor, "FOFont_normal", "FOFont_normal_blur", 255 * alpha)
  565.  
  566. surface.SetMaterial(divider_right)
  567. surface.SetDrawColor(drawColor)
  568. surface.DrawTexturedRect((ScrW() - ((512*1.25) + 16)), 16, (512*1.25), (128*1.25))
  569.  
  570. surface.SetMaterial(SCHEMA.NotificationMaterials[SCHEMA.Notifications[1].image])
  571. surface.SetDrawColor(drawColor)
  572. surface.DrawTexturedRect((ScrW() - 150), 18, 128, 128)
  573. end
  574. end
  575. end
  576. hook.Add("HUDPaint", "PaintNotification", PaintNotification)
  577.  
  578. netstream.Hook("nut_fnotify", function(data)
  579. data.message = data.message or ""
  580. data.messagetwo = data.messagetwo or ""
  581. data.messagethree = data.messagethree or ""
  582. SCHEMA.Notifications[#SCHEMA.Notifications+1] = data
  583. end)
  584.  
  585. netstream.Hook("nut_Teleporting", function(teleport)
  586. nut.config.drawHUD = teleport
  587. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement