forked from HaodongMo/ArcCW
dev crosshair
This commit is contained in:
parent
fb463ccca9
commit
214eb0b036
@ -139,7 +139,9 @@ ArcCW.ClientConVars = {
|
||||
["arccw_dev_benchgun_custom"] = { def = "" },
|
||||
|
||||
["arccw_dev_removeonclose"] = { def = 0, desc = "Remove the hud when closing instead of fading out, allowing easy reloading of the hud." },
|
||||
["arccw_noinspect"] = { def = 0, usri = true }
|
||||
["arccw_noinspect"] = { def = 0, usri = true },
|
||||
|
||||
["arccw_dev_crosshair"] = { def = 0 },
|
||||
}
|
||||
|
||||
for name, data in pairs(ArcCW.ClientConVars) do
|
||||
|
@ -47,6 +47,13 @@ function SWEP:GetFOVAcc( acc, disp )
|
||||
return gaA, gaD
|
||||
end
|
||||
|
||||
function SWEP:DrawDevCrosshair(x, y)
|
||||
surface.SetDrawColor(255, 50, 50, 255)
|
||||
|
||||
surface.DrawLine(x, y - 256, x, y + 256)
|
||||
surface.DrawLine(x - 256, y, x + 256, y)
|
||||
end
|
||||
|
||||
function SWEP:DoDrawCrosshair(x, y)
|
||||
local ply = LocalPlayer()
|
||||
local pos = ply:EyePos()
|
||||
@ -143,6 +150,10 @@ function SWEP:DoDrawCrosshair(x, y)
|
||||
sp.x = w2s.x sp.y = w2s.y
|
||||
x, y = sp.x, sp.y
|
||||
|
||||
if GetConVar("arccw_dev_crosshair"):GetBool() and LocalPlayer():IsAdmin() then
|
||||
self:DrawDevCrosshair(x, y)
|
||||
end
|
||||
|
||||
local st = self:GetSightTime() / 2
|
||||
|
||||
if self:ShouldDrawCrosshair() then
|
||||
|
@ -1528,7 +1528,6 @@ function SWEP:AdjustAtts()
|
||||
self:AdjustAmmo(old_inf)
|
||||
end
|
||||
|
||||
|
||||
function SWEP:GetAttachmentMaxHP(slot)
|
||||
if !self.Attachments[slot] then return 100 end
|
||||
if !self.Attachments[slot].Installed then return 100 end
|
||||
@ -1748,4 +1747,9 @@ function SWEP:AddSubSlot(i, attname)
|
||||
self.Attachments[index].SubAtts = {}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:OnReloaded()
|
||||
self:RecalcAllBuffs()
|
||||
self:SetupActiveSights()
|
||||
end
|
Loading…
Reference in New Issue
Block a user