Updated stations HUD UI

master
E. Almqvist 5 years ago
parent e9bbc4e442
commit d4454e9bc7
  1. 20
      entities/entities/q_crafting_station/cl_init.lua
  2. 3
      gamemode/settings/sv_crafting_stations_locations.lua

@ -20,8 +20,13 @@ local barW, barH
local scale = Quantum.Client.ResolutionScale
local padding = 10 * scale
local txtAlpha = 0
local plDist
function ENT:Draw()
stationTbl = Quantum.Station.Get( self:GetNWInt( "q_station_id" ) )
if( stationTbl ) then
stationName = stationTbl.name
self:DrawModel()
@ -40,21 +45,22 @@ function ENT:Draw()
ang.y = LocalPlayer():EyeAngles().y - 90
-- distance calc
plDist = LocalPlayer():GetPos():Distance( self:GetPos() )
txtAlpha = Lerp( plDist/400, 255, 0 )
if( txtAlpha > 0 ) then
cam.Start3D2D( pos, ang, 0.15 )
surface.SetTextColor( Color( 255, 255, 255 ) )
surface.SetTextColor( Color( 255, 255, 255, txtAlpha ) )
surface.SetFont( "q_title" )
txtW, txtH = surface.GetTextSize( stationName )
barW, barH = txtW + padding, txtH + padding
surface.SetDrawColor( 0, 0, 0, 150 )
surface.DrawRect( -barW/2, -padding/2, barW, barH )
surface.SetDrawColor( 255, 255, 255, 255 )
surface.DrawOutlinedRect( -barW/2, -padding/2, barW, barH )
surface.SetTextPos( -txtW/2, 0 )
surface.DrawText( stationName )
cam.End3D2D()
end
end
end
end

@ -5,5 +5,4 @@
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
Quantum.Server.Station.Register( "barrel", Vector( 747.13494873047, 10483.685546875, 7168.0317382813 ), Angle( 0, -118.23150634766, 0 ) )
Quantum.Server.Station.Register( "barrel2", Vector( 885.861328125, 10542.946289063, 7168.03125 ), Angle( 0, -118.23150634766, 0 ) )
Quantum.Server.Station.Register( "barrel", Vector( 3815.68359375, -1565.5415039063, -129.41325378418 ), Angle( 0, 173.51203918457, 0 ) )
Loading…
Cancel
Save