Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions lua/entities/lvs_base_wheeldrive/cl_hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,35 @@ function ENT:LVSHudPaintInfoText( X, Y, W, H, ScrX, ScrY, ply )

surface.SetDrawColor( 0, 0, 0, 200 )
surface.DrawTexturedRectRotated( hX + 4, hY + 1, H * 0.5, H * 0.5, 0 )
surface.SetDrawColor( color_white )

local IsManual = self:IsManualTransmission()

if ( IsManual ) then
local Engine = self:GetEngine()
if ( not IsValid( Engine ) or not isnumber( self.EngineMaxRPM ) or self.EngineMaxRPM <= 0 ) then
surface.SetDrawColor( color_white )
return
end

local RPM = Engine:GetRPM() / self.EngineMaxRPM
if ( RPM > 0.95 ) then
local OverRev = math.min( ( RPM - 0.95 ) * 10, 1 )

surface.SetDrawColor( 255, 255 - (255 * OverRev), 0, 255 )
else
surface.SetDrawColor( 255, 255, 255, 255 )
end
else
surface.SetDrawColor( color_white )
end

surface.DrawTexturedRectRotated( hX + 2, hY - 1, H * 0.5, H * 0.5, 0 )

if not self:GetEngineActive() then
draw.SimpleText( "X" , "LVS_FONT", hX, hY, Color(0,0,0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
else
oldThrottleActive = false

local Reverse = self:GetReverse()

if oldReverse ~= Reverse then
Expand All @@ -59,7 +80,6 @@ function ENT:LVSHudPaintInfoText( X, Y, W, H, ScrX, ScrY, ply )
WaveScale = 1
end

local IsManual = self:IsManualTransmission()
local Gear = self:GetGear()

if oldGear ~= Gear then
Expand Down