Advertisement
GohoCraft

Gmod13 - Hud

May 31st, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.84 KB | None | 0 0
  1. local Health = 0
  2.  
  3. local av
  4. local name
  5.  
  6. local oldName
  7.  
  8. local function DrawPlayerAvatar( p )
  9.    
  10.     oldName = LocalPlayer():Name()
  11.     print( oldName )
  12.    
  13.     av = vgui.Create("AvatarImage")
  14.     av:SetPos(64,ScrH() - 130)
  15.     av:SetSize(56, 56)
  16.     av:SetPlayer( p, 64 )
  17. end
  18.  
  19.  
  20.  
  21.  
  22.  
  23. -- My fancy new HUD
  24.  
  25. -- Colors & Fonts
  26.  
  27. local col1 = Color( 102,102,102, 255 )
  28. local col2 = Color( 51, 51, 51, 255 )
  29. local col3 = Color( 82, 82, 82, 255 )
  30. local col4 = Color(0,0,0,200)
  31.  
  32. surface.CreateFont( "pname", {
  33.  font = "Perspective Sans",
  34.  size = 26,
  35.  weight = 500,
  36.  blursize = 0,
  37.  scanlines = 0,
  38.  antialias = true
  39. } )
  40.  
  41. surface.CreateFont( "tname", {
  42.  font = "Capture Smallz",
  43.  size = 20,
  44.  weight = 500,
  45.  blursize = 0,
  46.  scanlines = 0,
  47.  antialias = true
  48. } )
  49.  
  50. surface.CreateFont( "tname_s", {
  51.  font = "Capture Smallz",
  52.  size = 16,
  53.  weight = 500,
  54.  blursize = 0,
  55.  scanlines = 0,
  56.  antialias = true
  57. } )
  58. surface.SetTextPos( 34, ScrH()/2+ScrH()/4 )
  59.  
  60. surface.CreateFont( "money", {
  61.  font = "Bebas Neue",
  62.  size = 22,
  63.  weight = 500,
  64.  blursize = 0,
  65.  scanlines = 0,
  66.  antialias = true
  67. } )
  68.  
  69. surface.CreateFont("exp", {
  70. size = 17,
  71. weight = 800,
  72. antialias = true,
  73. additive = false
  74. })
  75.  
  76. surface.CreateFont("ammo", {
  77. size = 17,
  78. weight = 800,
  79. antialias = true,
  80. additive = false
  81. })
  82.  
  83. surface.CreateFont( "small", {
  84.  font = "Capture Smallz",
  85.  size = 17,
  86.  blursize = 0,
  87.  scanlines = 0,
  88.  antialias = true
  89. } )
  90.  
  91. surface.CreateFont( "small2", {
  92.  font = "Helvetica",
  93.  size = 18,
  94.  weight = 800,
  95.  blursize = 0,
  96.  scanlines = 0,
  97.  antialias = true
  98. } )
  99.  
  100. surface.CreateFont( "desc", {
  101.  font = "Bebas Neue",
  102.  size = ScreenScale( 6 ),
  103.  weight = 500,
  104.  blursize = 0,
  105.  scanlines = 0,
  106.  antialias = true
  107. } )
  108.  
  109. -- Avatar func
  110. local av
  111. local function DrawPlayerAvatar0( x,y,w,h )
  112.     av = vgui.Create("AvatarImage")
  113.     av:SetPos(x,y)
  114.     av:SetSize(w,h)
  115.     av:SetPlayer( LocalPlayer(), 64 )
  116.     --draw.RoundedBox( 0, x, y, w, h, Color(0,100,0,255) )
  117. end
  118.  
  119. function GM:DrawBasewarsHUD()
  120.     --local w = ScrW() / 4.5
  121.     local w = 380
  122.     --local h = ScrW() / 10
  123.     local h = 160
  124.     local x = 5
  125.     local y = ScrH() - h - 5
  126.    
  127.     local offsetx, offsety
  128.    
  129. -- Main box
  130.     --surface.SetDrawColor( col1 )
  131.     --surface.DrawRect( x, y, w, h )
  132.     draw.RoundedBox( 4, x-1, y-1, w+2, h+2, Color(0,0,0,255) )
  133.     draw.RoundedBox( 4, x, y, w, h, col1 )
  134.    
  135.     --surface.SetDrawColor( col2 )
  136.     --surface.DrawOutlinedRect( x, y, w+2, h )
  137.     --draw.RoundedBox( 4, x, y, w, h, col2 )
  138.    
  139.    
  140.    
  141. -- Background boxes
  142.     draw.RoundedBox( 4, x, y, 47, h, col2 )                      -- Drugmeter
  143.     draw.RoundedBox( 4, x+46, y+85, w-46, h-85, col3 )           -- Bars
  144.    
  145. -- 3D effect lines
  146.     -- Drugbar
  147.     surface.SetDrawColor( 200, 200, 200, 20 )
  148.     surface.DrawLine( x+2, y, x+45, y )
  149.     surface.DrawLine( x, y+2, x, y+h-2 )
  150.    
  151.     surface.SetDrawColor( 0, 0, 0, 255 )
  152.     surface.DrawLine( x+46, y, x+46, y+h )
  153.    
  154.     surface.SetDrawColor( 0, 0, 0, 255 )
  155.     surface.DrawLine( x+46, y+84, w+6, y+84 )    
  156.     surface.SetDrawColor( 0, 0, 0, 100 )
  157.     surface.DrawLine( x+46, y+85, w+6, y+85 )
  158.    
  159.    
  160.     -- Testing line
  161.     --surface.SetDrawColor( 0, 0, 0, 255 )
  162.     --surface.DrawLine( x+115, y+35, x+320, y+35 )
  163.    
  164.    
  165.     -- Simple concave polygon vertices
  166.     local concave = {}
  167.     concave[1] = { x = (ScrW() / 2) - 200, y = (ScrH() / 2) }
  168.     concave[2] = { x = (ScrW() / 2) + 200, y = (ScrH() / 2) }
  169.     concave[3] = { x = (ScrW() / 2) + 200, y = (ScrH() / 2) - 150 }
  170.     concave[4] = { x = (ScrW() / 2), y = (ScrH() / 2) - 100 }
  171.     concave[5] = { x = (ScrW() / 2) - 200, y = (ScrH() / 2) - 150 }
  172.    
  173.     surface.SetDrawColor(255, 255, 255, 255)
  174.     surface.DrawPoly(concave)
  175.  
  176.    
  177.    
  178.    
  179.    
  180.    
  181.    
  182.    
  183.    
  184.    
  185.    
  186.    
  187.    
  188.    
  189.    
  190.    
  191.    
  192.    
  193. -- Buffs/Drugmeter
  194.     draw.RoundedBox(4, x + 10, y+10, 26, h-40, Color(0,0,0,200))   
  195.     draw.SimpleText( "?", "desc", 27, y+h-25, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )
  196.    
  197.    
  198.    
  199.    
  200.    
  201.    
  202.    
  203. -- Player Name
  204.    
  205.    
  206.     local font
  207.    
  208.     surface.SetFont( "pname" )
  209.     local PlayerName = LocalPlayer():Name()
  210.     local wi, hi = surface.GetTextSize(PlayerName)
  211.  
  212.     if wi > 320 then
  213.         PlayerName = string.sub( LocalPlayer():Name(), 1, 24 )..".."
  214.     else
  215.         local PlayerName = LocalPlayer():Name()
  216.     end
  217.    
  218.     offsetx = x+115
  219.    
  220.     draw.SimpleText( PlayerName, "pname", offsetx+2, y+5+2, Color(50,50,50,255) )
  221.     draw.SimpleText( PlayerName, "pname", offsetx, y+5, Color( 255, 255, 255 ) )
  222.    
  223.    
  224. -- Team Name
  225.    
  226.     surface.SetFont( "tname" )
  227.     local PlayerTeam = team.GetName(LocalPlayer():Team())
  228.     local wi, hi = surface.GetTextSize(PlayerTeam)
  229.     font = "tname"
  230.     if wi > 230 then
  231.         PlayerTeam = string.sub( team.GetName(LocalPlayer():Team()), 1, 21 ).."..."
  232.         --font = "tname_s"
  233.    -- else
  234.         --font = "tname"
  235.     end
  236.     draw.SimpleText( PlayerTeam, font, offsetx+1, y+33+2, Color(222,222,222,150) )
  237.     draw.SimpleText( PlayerTeam, font, offsetx, y+33, team.GetColor( LocalPlayer():Team() ) )
  238.    
  239.    
  240.    
  241.    
  242.    
  243. -- Life
  244.     local x2, y2 = x+105,y+120
  245.     local w2, h2 = w-107,16
  246.     local localplayer = LocalPlayer()
  247.     Health = math.min(100, (Health == localplayer:Health() and Health) or Lerp(0.1, Health, localplayer:Health()))
  248.  
  249.     local DrawHealth = math.Min(Health / 50, 1)
  250.     local Border = math.Min(6, math.pow(2, math.Round(3*DrawHealth)))
  251.     draw.RoundedBox(4, x2-1, y2-1, w2 - 7, h2, Color(0,0,0,200))
  252.     if LocalPlayer():Health() > 0 then
  253.         draw.RoundedBox(4, x2, y2, (w2 - 9) * DrawHealth, h2-2, Color(255,40,40,180))
  254.     end
  255.     draw.DrawText(math.Max(0, math.Round(localplayer:Health())), "small", x2+w2/2, y2-2, Color(255,255,255,200), 1, TEXT_ALIGN_CENTER)
  256.     draw.SimpleText("HP", "small2", x2-8, y2-2, Color(255,255,255,255), TEXT_ALIGN_RIGHT)
  257.        
  258. -- Armor
  259.     local x3, y3 = x2,y2+20
  260.     local armor = LocalPlayer():Armor()
  261.     draw.RoundedBox(4, x3-1, y3-1, w2 - 7, h2, Color(0,0,0,200))
  262.     if armor > 0 then
  263.         draw.RoundedBox(4, x3, y3, armor/100*(w2 - 9), 14, Color(40,40,255,255))
  264.     end
  265.     draw.SimpleText(armor, "small",  x3+w2/2,y3-2, Color(255,255,255,200), TEXT_ALIGN_CENTER)
  266.     draw.SimpleText("Armor", "small2", x3-8, y3-2, Color(255,255,255,255), TEXT_ALIGN_RIGHT)
  267.  
  268.    
  269.    
  270.    
  271. -- Raidstatus
  272.     local box_r = 46
  273.     draw.RoundedBox(4, w-box_r, y+4, box_r, box_r, col3)
  274.     -- Get raidstatus
  275.  
  276.    
  277.    
  278.    
  279.    
  280. -- Money
  281.     surface.SetFont( "money" )
  282.     --local PlayerMoney = formatNumber(LocalPlayer():GetTable().Money)
  283.     local PlayerMoney = BW_Comma(LocalPlayer():GetTable().Money)
  284.     local wl, hl = surface.GetTextSize(PlayerMoney)
  285.    
  286.     -- Draw Icon
  287.     surface.SetDrawColor( 255, 255, 255, 255 )
  288.     surface.SetMaterial( Material( "icon16/money.png" ) )
  289.     surface.DrawTexturedRect( w-wl-36, y+60, 16, 16 )
  290.    
  291.     draw.SimpleText( PlayerMoney.." $", "money", w+1, y+56+2, Color( 0, 0, 0, 255 ), TEXT_ALIGN_RIGHT )
  292.     draw.SimpleText( PlayerMoney.." $", "money", w, y+56, Color( 255, 255, 255, 255 ), TEXT_ALIGN_RIGHT )
  293.    
  294.    
  295.    
  296.    
  297. -- Exp bar
  298.     --XP/Level
  299.     local XPPos         = x+105
  300.     local XPPosy        = y+91
  301.     local XPwidth       = w2-8
  302.     local XPheight      = 20
  303.    
  304.    
  305.    
  306. -- Level box
  307.     draw.RoundedBox(4, x + 56, XPPosy-1, XPheight*2, XPheight+2, Color(0,0,0,200))
  308.     draw.SimpleText( localplayer.Level, "small2", x+77, XPPosy+1, Color( 220, 220, 220, 255 ), TEXT_ALIGN_CENTER )
  309.    
  310.  
  311.        
  312.         localplayer.Exp = localplayer.Exp or 1
  313.         localplayer.Level = localplayer.Level or 1
  314.        
  315.         -- Calc Level and xp bar
  316.         local XPmax
  317.         --local function getExp(ply)
  318.             for k,v in ipairs(xp["exp"]) do
  319.                
  320.                 local diff = v/localplayer.Exp
  321.                 if diff >= 1 then
  322.                     --print(v)
  323.                     -- Set exp and level
  324.                     XPmax = tonumber(v)
  325.                     --localplayer.Level = k
  326.                     break
  327.                 end
  328.             end
  329.         --end
  330.         local vars = (localplayer.Level or 1) -1
  331.         if vars == 0 then vars = 1 end
  332.         local lastep = xp["exp"][vars] or 0
  333.         local diff = XPmax-lastep
  334.        
  335.         local XPprocent     = (100*((localplayer.Exp-lastep)/diff))
  336.         local XPbarwidth    =  XPprocent*((XPwidth)/100)
  337.        
  338.         draw.RoundedBox( 4, XPPos-1, XPPosy-1, XPwidth+2, XPheight+2, Color(0,0,0, 150))
  339.         draw.RoundedBox( 4, XPPos, XPPosy, XPwidth, XPheight, Color(0,0,0, 150))
  340.         draw.RoundedBox( 4, XPPos, XPPosy, XPbarwidth, XPheight, Color(0,200,0,255))
  341.            
  342.         if localplayer.Exp >= table.GetLastValue(xp["exp"]) then
  343.             draw.DrawText("ULTIMATE-RAID-MASTER", "exp", XPPos+(XPwidth/2), XPPosy+1, col4,TEXT_ALIGN_CENTER)
  344.         else
  345.             draw.DrawText(" XP: "..localplayer.Exp.."/"..XPmax, "exp", XPPos+(XPwidth/2), XPPosy+2, col4,TEXT_ALIGN_CENTER)
  346.         end
  347.     --draw.RoundedBox(4, x + 110, XPPosy, w-200, 45, Color(0,0,0,200))
  348.    
  349.    
  350. -- Player Avatar
  351.    
  352.     local x,y = x +52, y+5
  353.     local w,h = 58, 58
  354.    
  355.    
  356.     draw.RoundedBox(4, x, y, 57, 57, Color(0,0,0,200))
  357.     if !av then
  358.         DrawPlayerAvatar0( x+5, y+5, w-11, w-11 )
  359.     end
  360.    
  361.     surface.SetDrawColor( 200, 200, 200, 100 )
  362.     surface.DrawLine( x+5, y+4, x+w-6, y+4 )
  363.     surface.DrawLine( x+5, y+4, x+5, y+h-6 )
  364.    
  365.    
  366.    
  367.    
  368.  
  369.     local w = 200
  370.     local h = 40
  371.     local x = ScrW() - w - 5
  372.     local y = ScrH() - h - 5
  373.    
  374.  
  375.    
  376.    
  377.     -- This prevents client crash on death. LOL
  378.     -- Dont draw weapon hud if the players wears no valid sweap
  379.     if !LocalPlayer():GetActiveWeapon():IsValid() then return true end
  380.  
  381.     wep_name = LocalPlayer():GetActiveWeapon():GetPrintName() or LocalPlayer():GetActiveWeapon():GetClass()
  382.    
  383.     local mag_left = LocalPlayer():GetActiveWeapon():Clip1()
  384.     local mag_extra = LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType())
  385.     local secondary_ammo = LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetSecondaryAmmoType())
  386.     local mag_all
  387.    
  388.     -- Weapon has no ammo
  389.     if mag_left <= 0 && mag_extra <= 0 then
  390.        
  391.         -- Main box
  392.         draw.RoundedBox( 4, x-1, y-1, w+2, h+2, Color(0,0,0,255) )
  393.         draw.RoundedBox( 4, x, y, w, h, col1 )
  394.  
  395.      
  396.         draw.RoundedBox( 4, x+15, y+8, w-30, h/2, col3 )
  397.      
  398.      
  399.         draw.DrawText(wep_name, "ammo", x+w/2+1, y+10+2, Color(0, 0, 0, 255),TEXT_ALIGN_CENTER)
  400.         draw.DrawText(wep_name, "ammo", x+w/2, y+10, Color(255, 255, 255, 255),TEXT_ALIGN_CENTER)
  401.     -- Weapon has ammo
  402.     else
  403.        
  404.         local x_ammo, y_ammo = x+10, y+5
  405.        
  406.         local w_ammo
  407.         local h_ammo = 10
  408.         if (LocalPlayer():GetActiveWeapon().Primary == nil || LocalPlayer():GetActiveWeapon().Primary.ClipSize == nil) then
  409.             -- Fallback for other weapons
  410.             w_ammo=180
  411.             mag_left = LocalPlayer():GetActiveWeapon():GetClass()
  412.             mag_all = LocalPlayer():GetActiveWeapon():Clip1()
  413.         else
  414.             -- M9K Weapons
  415.             w_ammo=mag_left/LocalPlayer():GetActiveWeapon().Primary.ClipSize*180
  416.             --mag_left = mag_left/LocalPlayer():GetActiveWeapon().Primary.ClipSize*180
  417.             mag_all = LocalPlayer():GetActiveWeapon().Primary.ClipSize
  418.         end
  419.        
  420.        
  421.        
  422.         -- Has secondary ammo?
  423.         if secondary_ammo <= 0 then
  424.             -- Only primary ammo
  425.            
  426.             -- Main box
  427.             draw.RoundedBox( 4, x-1, y-1, w+2, h+2, Color(0,0,0,255) )
  428.             draw.RoundedBox( 4, x, y, w, h, col1 )
  429.            
  430.             --draw.SimpleText("Mag: "..mag_left, "ammo", x_ammo+10, y_ammo, Color(0, 220, 0, 255), 0, 0)
  431.             draw.SimpleText("Mag: "..mag_left.." / "..mag_all , "ammo", x_ammo+10, y_ammo, Color(0, 220, 0, 255), 0, 0)
  432.            
  433.            
  434.            
  435.             draw.SimpleText(mag_extra , "ammo", x_ammo+130, y_ammo, Color(0, 220, 0, 255), 0, 0)
  436.            
  437.            
  438.             draw.RoundedBox(4, x_ammo, y_ammo+20, w_ammo, h_ammo, Color(0,180,0,255), 0, 0)
  439.             draw.RoundedBox(4, x_ammo, y_ammo+20, w_ammo, h_ammo-6, Color(120,180,120,175), 0, 0)
  440.            
  441.            
  442.            
  443.            
  444.         else
  445.             -- Draw primary and secondary ammo
  446.            
  447.         end
  448.     end
  449. end
  450.  
  451. -- Raidtimer HUD
  452.  
  453. function GM:DrawRaidtimer()
  454.    
  455.     -- check raidtimer table for running raids
  456.    
  457.     -- Draw timer hud for each raid running
  458.    
  459.     local w = ScrW() / 12
  460.     local h = ScrW() / 22
  461.     local x = 5
  462.     local y = ScrH() - h*22 + 5
  463.  
  464.     local w_bar = ScrW() / 8
  465.     local h_bar = ScrW() / 80
  466.     local x_bar = x + w + 5
  467.     local bar_spacing = ScrW() / 300
  468.  
  469.     surface.SetDrawColor( BasewarsBackgroundColor )
  470.     surface.DrawRect( x, y, w, h )
  471.  
  472.     surface.SetDrawColor( BasewarsBorderColor )
  473.     surface.DrawOutlinedRect( x, y, w, h )
  474.     -- Raidtimer
  475.     local raidColor = BasewarsTextColor
  476.     -- get data from tables...
  477.     local attacker = test1
  478.     local defender = test2
  479.    
  480.     draw.SimpleTextOutlined( tostring( LocalPlayer():Health() ), "DefaultHealth", x + w / 2, y + h / 2, hpColor, 1, 1, 0.5, BasewarsBorderColor )
  481.    
  482.  
  483. end
  484.  
  485. function TestDrawHud()
  486.  
  487. local struc = {}
  488. struc.pos = {}
  489. --struc.pos[1] = ScrW()*.5 -- x pos
  490. struc.pos[1] = 580 -- x pos
  491. --struc.pos[2] = ScrH()*.005 -- y pos
  492. struc.pos[2] = ScrH()-10 -- y pos
  493. struc.color = Color(0,0,0,255)
  494. struc.text = "--- Baswars PreAlpha "..GAMEMODE.Version.." for GMOD13 by .delay ---"
  495. struc.font = "DefaultFixed" -- Font
  496. struc.xalign = TEXT_ALIGN_CENTER -- Horizontal Alignment
  497. struc.yalign = TEXT_ALIGN_LEFT -- Vertical Alignment
  498. draw.Text( struc )
  499.  
  500. end
  501. hook.Add("HUDPaint", "HUD_TEST", TestDrawHud)
  502.  
  503. -- Door HUD
  504. function BW_DoorHUD()
  505.    
  506.    
  507.     --local ply = LocalPlayer()
  508.     --local entity = ply:GetEyeTrace().Entity
  509.     --if entity:IsValid() and door_classes[entity:GetClass()] then
  510.    
  511.     --for k,v in pairs(ents.GetAll()) do
  512.     --for k,v in pairs(ents.FindByClass("prop_door_rotating")) do
  513.     for k,v in pairs(ents.FindInSphere(LocalPlayer():GetPos(),550)) do
  514.         if v:GetClass() == "prop_door_rotating" then
  515.            
  516.             --local distance = entity:LocalToWorld( entity:OBBCenter() ):Distance( LocalPlayer():EyePos() )
  517.             --if (distance <= 500) then
  518.             if LocalPlayer():GetPos():Distance(v:GetPos()) < 550 then
  519.                
  520.                
  521.                 if v.Owner == "nil" then continue end
  522.                
  523.                
  524.             local function doorstuff(pos,ang)
  525.             cam.Start3D2D(pos, ang, 0.1)
  526.                 draw.RoundedBox( 10, 5, 5, 450, 50, Color(255,255,255, 30) )
  527.                 local owner
  528.                 local teamid
  529.                 local tname
  530.                 local tcol = Color(0, 0, 0, 180)
  531.                
  532.                 -- Door Owner is player?
  533.                 if v.Owner:IsPlayer() then
  534.                     owner = v.Owner:Nick()
  535.                     teamid = v.Owner:Team()
  536.                     tname = team.GetName(teamid)
  537.                     tname = BW_StrUp(tname)
  538.                    
  539.                     -- Is in basic team?
  540.                     if teamid > 0 then
  541.                         local col = team.GetColor(teamid)
  542.                         tcol = Color(col.r, col.g, col.b, 100)
  543.                         draw.RoundedBox( 10, 0, 0, 460, 60, tcol )
  544.                         draw.SimpleText(tname, "font_17", 230, 20, Color(255, 255, 255, 180), 1, 1)
  545.                         draw.SimpleText(tname, "font_17", 229, 19, Color(0, 0, 0, 255), 1, 1)
  546.                     else
  547.                         draw.SimpleText("Door owner:", "font_20", 230, 20, Color(0, 0, 0, 180), 1, 1)
  548.                         draw.SimpleText("Door owner:", "font_20", 229, 18, Color(255, 255, 255, 255), 1, 1)
  549.                     end
  550.                    
  551.                     draw.SimpleText(owner, "font_17", 230, 40, Color(0, 0, 0, 180), 1, 1)
  552.                     draw.SimpleText(owner, "font_17", 229, 38, Color(255, 255, 255, 255), 1, 1)
  553.                    
  554.                    
  555.                    
  556.                 -- Door is free to buy
  557.                 else
  558.                         -- only draw valid/spawned doors
  559.                         owner = "Door"
  560.                         draw.SimpleText("Free Door", "font_20", 230, 30, Color(0, 0, 0, 180), 1, 1)
  561.                         draw.SimpleText("Free Door", "font_20", 229, 28, Color(255, 255, 255, 255), 1, 1)
  562.                        
  563.                 end
  564.  
  565.             cam.End3D2D()
  566.             end
  567.                
  568.                
  569.                
  570.                 local angles = v:GetAngles()
  571.                 local position = v:GetPos()
  572.                 local offset = angles:Up()*-7.3 + angles:Forward() * -1.2 + angles:Right() * - 46
  573.                 local offset2 = angles:Up()*-7.3 + angles:Forward() * 1.2 + angles:Right() * - 0
  574.                
  575.                 -- One Side
  576.                 angles:RotateAroundAxis(angles:Forward(), 90)
  577.                 angles:RotateAroundAxis(angles:Right(), 90)
  578.                 angles:RotateAroundAxis(angles:Up(), 0)
  579.                
  580.                 doorstuff(position + offset, angles)
  581.                
  582.                 --cam.Start3D2D(position + offset, angles, 0.1)
  583.                 --    draw.SimpleText("Door", "font_11", 80.5, 46, Color(255, 255, 255, 255), 1, 1)
  584.                 --    draw.SimpleText("Door", "font_11", 80.5, 46, Color(255, 255, 255, 255), 1, 1)
  585.                 --cam.End3D2D()
  586.  
  587.                 -- The other side
  588.                 angles:RotateAroundAxis(angles:Forward(), 0)
  589.                 angles:RotateAroundAxis(angles:Right(), 180)
  590.                 angles:RotateAroundAxis(angles:Up(), 0)
  591.                
  592.                 doorstuff(position + offset2, angles)
  593.             end
  594.         end
  595.     end
  596. end
  597. -- Test a few hooks for performance
  598. hook.Add("PostDrawOpaqueRenderables", "cam_door_test", BW_DoorHUD)
  599. --hook.Add("RenderScreenspaceEffects", "cam_door_test", BW_DoorHUD)
  600.  
  601.  
  602. --hook.Add( "PreDrawHalos", "AddHalos", function()
  603. --  halo.Add( ents.FindByClass( "prop_door_rotating" ), Color( 255, 0, 0 ), 5, 5, 2 )
  604. --end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement