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