diff --git a/lua/entities/lvs_base_wheeldrive/cl_hud.lua b/lua/entities/lvs_base_wheeldrive/cl_hud.lua index b2d8e016..4c4bc4c7 100644 --- a/lua/entities/lvs_base_wheeldrive/cl_hud.lua +++ b/lua/entities/lvs_base_wheeldrive/cl_hud.lua @@ -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 @@ -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