Skip to content
Merged
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
2 changes: 1 addition & 1 deletion lua/entities/gmod_wire_hudindicator/init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )

Check warning on line 3 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'single quoted strings' and 'double quoted strings'

include('shared.lua')

Check warning on line 5 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of 'single quoted strings' and 'double quoted strings'

DEFINE_BASECLASS("base_wire_entity")

Expand Down Expand Up @@ -149,13 +149,13 @@
-- Send as string (there should be a way to send colors)
local ainfo = self.AR.."|"..self.AG.."|"..self.AB
local binfo = self.BR.."|"..self.BG.."|"..self.BB
umsg.Start("HUDIndicatorStylePercent", pl)

Check warning on line 152 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Short(self:EntIndex())
umsg.String(ainfo)
umsg.String(binfo)
umsg.End()
elseif (hudstyle == 3) then -- Full Circle Gauge
umsg.Start("HUDIndicatorStyleFullCircle", pl)

Check warning on line 158 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Short(self:EntIndex())
umsg.Float(self.FullCircleAngle)
umsg.End()
Expand All @@ -172,10 +172,10 @@
if not self.RegisteredPlayers[plyuid] then
self.RegisteredPlayers[plyuid] = { ply = ply, hookhidehud = hookhidehud, podonly = podonly }
-- This is used to check for pod-only status in ClientCheckRegister()
self:SetNWBool( plyuid, util.tobool(podonly) )

Check warning on line 175 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use tobool, without the util bit
end

umsg.Start("HUDIndicatorRegister", ply)

Check warning on line 178 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Short(eindex)
umsg.String(self.HUDDesc or "")
umsg.Short(self.HUDShowValue)
Expand All @@ -193,7 +193,7 @@
end

function ENT:UnRegisterPlayer(ply)
umsg.Start("HUDIndicatorUnRegister", ply)

Check warning on line 196 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Short(self:EntIndex())
umsg.End()
self.RegisteredPlayers[ply:UniqueID()] = nil
Expand Down Expand Up @@ -232,7 +232,7 @@

function ENT:ShowOutput(factor, value)
if (factor ~= self.PrevOutput) then
self:SetOverlayText( self.PrefixText .. string.format("%.1f", (factor * 100)) .. "%" )

Check warning on line 235 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self.PrevOutput = factor

local rf = RecipientFilter()
Expand All @@ -249,7 +249,7 @@
end
end

umsg.Start("HUDIndicatorFactor", rf)

Check warning on line 252 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Short(self:EntIndex())
-- Send both to ensure that all styles work properly
umsg.Float(factor)
Expand All @@ -263,9 +263,9 @@
local pl = self:GetPlayer()

for index,rplayer in pairs(self.RegisteredPlayers) do
if (rplayer.ply) then
if (IsValid(rplayer.ply)) then
if rplayer.ply ~= pl or (self.ShowInHUD or self.PodPly == pl) then
umsg.Start("HUDIndicatorHideHUD", rplayer.ply)

Check warning on line 268 in lua/entities/gmod_wire_hudindicator/init.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use net messages.
umsg.Short(self:EntIndex())
-- Check player's preference
if (rplayer.hookhidehud) then
Expand Down
Loading