Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion lua/effects/glide_explosion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ end

local GLOW_MAT = Material( "sprites/light_glow02_add" )

local color_render = Color( 255, 200, 150, 255 )
function EFFECT:Render()
render.SetMaterial( GLOW_MAT )
render.DrawSprite( self.origin, self.size, self.size, Color( 255, 200, 150, 255 ) )
render.DrawSprite( self.origin, self.size, self.size, color_render )
end

local FLAME_MATERIAL = "glide/effects/flamelet"
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/base_glide/cl_hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ do
["square"] = "glide/aim_square.png"
}

local color_green = Color( 100, 255, 100 )
function ENT:EnableCrosshair( params )
params = params or {}

Expand All @@ -18,7 +19,7 @@ do
icon = CROSSHAIR_ICONS[params.iconType or "dot"],

size = params.size or 0.05,
color = params.color or Color( 100, 255, 100 )
color = params.color or color_green
}
end

Expand Down
3 changes: 2 additions & 1 deletion lua/entities/base_glide_plane/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ local size, x, y
local power = 0

--- Override this base class function.
local COLOR_STALL = Color( 255, 100, 100, 200 )
function ENT:DrawVehicleHUD( screenW, screenH )
local playerListWidth = BaseClass.DrawVehicleHUD( self, screenW, screenH )

Expand Down Expand Up @@ -231,7 +232,7 @@ function ENT:DrawVehicleHUD( screenW, screenH )
x = x + ( size * 0.5 ) - ( w * 0.5 )
y = y - h - size * 0.1

surface.SetDrawColor( 255, 100, 100, 200 )
surface.SetDrawColor( COLOR_STALL )
surface.DrawRect( x, y, w, h )

SimpleText( text, "GlideHUD", x + w * 0.5, y + h * 0.5, colors.icon, 1, 1 )
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/glide_projectile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ local traceData = {
mins = Vector()
}

local color_red = Color( 255, 0, 0 )
function ENT:Think()
local t = CurTime()

Expand Down Expand Up @@ -193,7 +194,7 @@ function ENT:Think()
traceData.filter[2] = self:GetOwner()

if GetDevMode() then
debugoverlay.Line( traceData.start, traceData.endpos, 0.75, Color( 255, 0, 0 ), true )
debugoverlay.Line( traceData.start, traceData.endpos, 0.75, color_red, true )
end

-- Trace result is stored on `ray`
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/glide_rotor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ end
local GetDevMode = Glide.GetDevMode

--- Check if the rotor blades are hitting things.
local color_red = Color( 255, 0, 0 )
function ENT:CheckRotorClearance( dt, parent )
-- The trace will use a spinning angle separate from the model
self.traceAngle = ( self.traceAngle + dt * 1600 ) % 360
Expand All @@ -176,7 +177,7 @@ function ENT:CheckRotorClearance( dt, parent )
data.endpos = origin + dir * self.radius

if GetDevMode() then
debugoverlay.Line( data.start, data.endpos, 0.05, Color( 255, 0, 0 ), true )
debugoverlay.Line( data.start, data.endpos, 0.05, color_red, true )
end

local tr = TraceHull( data )
Expand Down
6 changes: 4 additions & 2 deletions lua/entities/glide_wheel/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ local EntSetLocalPos = FindMetaTable( "Entity" ).SetLocalPos
local tractionCycle = Vector()
local contactPos = Vector()

local color_gray = Color( 100, 100, 100 )
local color_green = Color( 0, 200, 0 )
function ENT:DoPhysics( vehicle, phys, traceFilter, outLin, outAng, dt, vehSurfaceGrip, vehSurfaceResistance, vehPos, vehVel, vehAngVel )
local state, params = self.state, self.params

Expand Down Expand Up @@ -400,8 +402,8 @@ function ENT:DoPhysics( vehicle, phys, traceFilter, outLin, outAng, dt, vehSurfa
state.lastSurfaceId = surfaceId

if state.isDebugging then
debugoverlay.Cross( pos, 10, 0.05, Color( 100, 100, 100 ), true )
debugoverlay.Box( contactPos, traceData.mins, traceData.maxs, 0.05, Color( 0, 200, 0 ) )
debugoverlay.Cross( pos, 10, 0.05, color_gray, true )
debugoverlay.Box( contactPos, traceData.mins, traceData.maxs, 0.05, color_green )
end

if not ray.Hit then
Expand Down
3 changes: 2 additions & 1 deletion lua/entities/gtav_insurgent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ if CLIENT then
stream:LoadPreset( "insurgent" )
end

local color_green = Color( 0, 255, 0 )
function ENT:OnLocalPlayerEnter( seatIndex )
self:DisableCrosshair()

-- Enable the crosshair when a player enters the turret seat
if seatIndex == TURRET_SEAT_INDEX then
self:EnableCrosshair( { iconType = "dot", color = Color( 0, 255, 0 ) } )
self:EnableCrosshair( { iconType = "dot", color = color_green } )
else
-- Let the base class handle it
BaseClass.OnLocalPlayerEnter( self, seatIndex )
Expand Down
3 changes: 2 additions & 1 deletion lua/glide/client/vgui/sound_browser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ local L = StyledTheme.GetUpperLanguagePhrase

local PANEL = {}

local BLACK_COLOR = Color( 0, 0, 0, 255 )
function PANEL:Init()
local frameW, frameH = ScaleSize( 1000 ), ScaleSize( 700 )

Expand Down Expand Up @@ -137,7 +138,7 @@ function PANEL:Init()
panelFooter:DockPadding( ScaleSize( 4 ), ScaleSize( 4 ), ScaleSize( 4 ), ScaleSize( 4 ) )

panelFooter.Paint = function( _, w, h )
surface.SetDrawColor( 0, 0, 0, 255 )
surface.SetDrawColor( BLACK_COLOR )
surface.DrawRect( 0, 0, w, h )
end

Expand Down
2 changes: 1 addition & 1 deletion lua/glide/client/vgui/stream_editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function PANEL:ShowExportFrame( code, titleText, helpText )
local labelHelp = vgui.Create( "DLabel", frame )
labelHelp:SetFont( "Trebuchet18" )
labelHelp:SetText( helpText )
labelHelp:SetTextColor( Color( 255, 255, 255 ) )
labelHelp:SetTextColor( color_white )
labelHelp:Dock( TOP )
labelHelp:SetContentAlignment( 5 )

Expand Down
3 changes: 2 additions & 1 deletion lua/glide/client/vgui/stream_editor_layer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ end

local COLOR_HEADER = Color( 60, 60, 60 )
local COLOR_LIST_HEADER = Color( 40, 40, 40, 255 )
local COLOR_LAYER = Color( 13, 122, 13, 255 )
local SimpleText = draw.SimpleText

function PANEL:Paint( w, h )
Expand All @@ -382,7 +383,7 @@ function PANEL:Paint( w, h )
DrawRect( 0, 0, w, headerHeight, COLOR_HEADER )

if self.layerData then
surface.SetDrawColor( 13, 122, 13 )
surface.SetDrawColor( COLOR_LAYER )
surface.DrawRect( 1, 1, ( w - 2 ) * self.layerData.volume, headerHeight - 2 )

SimpleText( self.id, "StyledTheme_Small", padding, headerHeight * 0.5, colors.buttonText, 0, 1 )
Expand Down
3 changes: 2 additions & 1 deletion lua/glide/client/vgui/stream_editor_tab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ end

local IsKeyDown = input.IsKeyDown

local color_red = Color( 255, 0, 0 )
function PANEL:Think()
if not self.isEngineOn then return end

Expand Down Expand Up @@ -520,7 +521,7 @@ function PANEL:Think()

if self.isRedlining ~= isRedlining then
self.isRedlining = isRedlining
self.rpmLabel:SetColor( isRedlining and Color( 255, 0, 0 ) or color_white )
self.rpmLabel:SetColor( isRedlining and color_red or color_white )
end

local rpmFraction = ( rpm - self.minRPM ) / ( self.maxRPM - self.minRPM )
Expand Down
16 changes: 10 additions & 6 deletions lua/glide/server/ragdoll.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ do
local ray = {}

--- Check if a vehicle exit position/ragdoll respawn point is unobstructed.
local color_red = Color( 255, 0, 0 )
local color_orange = Color( 255, 100, 0 )
local color_green = Color( 0, 255, 0 )
local color_opacity20 = Color( 255, 255, 255, 20 )
function Glide.ValidateExitPos( origin, pos, traceData )
traceData = traceData or {}

Expand All @@ -263,8 +267,8 @@ do

if ray.Hit then
if GetDevMode() then
debugoverlay.Line( origin, traceData.endpos, 8, Color( 255, 0, 0 ), true )
debugoverlay.EntityTextAtPosition( traceData.endpos, 0, "<blocked>", 8, Color( 255, 0, 0 ) )
debugoverlay.Line( origin, traceData.endpos, 8, color_red, true )
debugoverlay.EntityTextAtPosition( traceData.endpos, 0, "<blocked>", 8, color_red )
end

return true, pos
Expand All @@ -278,16 +282,16 @@ do

if ray.StartSolid then
if GetDevMode() then
debugoverlay.Line( origin, traceData.endpos, 8, Color( 255, 100, 0 ), true )
debugoverlay.EntityTextAtPosition( traceData.endpos, 0, "<too small>", 8, Color( 255, 100, 0 ) )
debugoverlay.Line( origin, traceData.endpos, 8, color_orange, true )
debugoverlay.EntityTextAtPosition( traceData.endpos, 0, "<too small>", 8, color_orange )
end

return true, pos
end

if GetDevMode() then
debugoverlay.Line( origin, pos, 8, Color( 0, 255, 0 ), true )
debugoverlay.Box( pos, traceData.mins, traceData.maxs, 8, Color( 255, 255, 255, 20 ) )
debugoverlay.Line( origin, pos, 8, color_green, true )
debugoverlay.Box( pos, traceData.mins, traceData.maxs, 8, color_opacity20 )
end

return false, pos
Expand Down
5 changes: 3 additions & 2 deletions lua/glide/server/sockets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ local Remove = table.remove
local FindClosestSocket = Glide.FindClosestSocket
local GetDevMode = Glide.GetDevMode

local color_orange = Color( 255, 145, 0 )
timer.Create( "Glide.UpdateSockets", 0.1, 0, function()
local vehicleCount = #vehiclesWithSockets
if vehicleCount == 0 then return end
Expand Down Expand Up @@ -138,12 +139,12 @@ timer.Create( "Glide.UpdateSockets", 0.1, 0, function()
if not GetDevMode() then return end

for _, v in ipairs( receptacles ) do
debugoverlay.Cross( v.pos, 8, 0.1, Color( 255, 145, 0 ), true )
debugoverlay.Cross( v.pos, 8, 0.1, color_orange, true )
debugoverlay.Text( v.pos, v.id .. " | isReceptacle: true", 0.1, false )
end

for _, v in ipairs( plugs ) do
debugoverlay.Cross( v.pos, 8, 0.1, Color( 255, 145, 0 ), true )
debugoverlay.Cross( v.pos, 8, 0.1, color_orange, true )
debugoverlay.Text( v.pos, v.id .. " | isReceptacle: false", 0.1, false )
end
end )
2 changes: 1 addition & 1 deletion lua/weapons/glide_homing_launcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ if CLIENT then

if user:KeyDown( IN_ATTACK2 ) then
surface.SetMaterial( AREA_MAT )
surface.SetDrawColor( 255, 255, 255, 255 )
surface.SetDrawColor( color_white )
surface.DrawTexturedRectRotated( ScrW() * 0.5, ScrH() * 0.5, size, size, 0 )
end

Expand Down
2 changes: 1 addition & 1 deletion lua/weapons/glide_repair.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function SWEP:DrawHUD()

local x, y = ScrW() * 0.5, ScrH() * 0.5

Glide.DrawWeaponCrosshair( x, y, "glide/aim_dot.png", 0.05, Color( 255, 255, 255, 255 ) )
Glide.DrawWeaponCrosshair( x, y, "glide/aim_dot.png", 0.05, color_white )

local w = math.floor( ScrH() * 0.4 )
local h = math.floor( ScrH() * 0.03 )
Expand Down
6 changes: 4 additions & 2 deletions lua/weapons/gmod_tool/stools/glide_misc_sounds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ function TOOL:Reload( trace )
end

local TEXT_COLOR = Color( 255, 255, 255, 255 )
local COLOR_BACKGROUND = Color( 30, 30, 30, 255 )
local COLOR_HEADER = Color( 70, 70, 70, 255 )
local HEADER_HEIGHT = 28

local function CategoryPaint( s, w, h )
surface.SetDrawColor( 30, 30, 30, 255 )
surface.SetDrawColor( COLOR_BACKGROUND )
surface.DrawRect( 0, 0, w, h )

surface.SetDrawColor( 70, 70, 70, 255 )
surface.SetDrawColor( COLOR_HEADER )
surface.DrawRect( 0, 0, w, HEADER_HEIGHT )

draw.SimpleText( s._name, "Trebuchet18", 4, HEADER_HEIGHT * 0.5, TEXT_COLOR, 0, 1 )
Expand Down
Loading