Crosshair options

This commit is contained in:
Arctic 2022-07-31 17:22:45 +10:00
parent fab4fd267f
commit 87fb78804b
4 changed files with 48 additions and 1 deletions

View File

@ -53,6 +53,8 @@ You could also opt to combine these methods together - it's common for an attach
- New RT scopes
- Dynamic camo support
- Controller support
- Dynamic selecticon and preset icon generation
- Exportable presets
### New Recoil

View File

@ -29,6 +29,26 @@ local conVars = {
min = 0,
max = 1,
},
{
name = "cross_r",
default = "255",
client = true
},
{
name = "cross_enable",
default = "1",
client = true
},
{
name = "cross_g",
default = "255",
client = true
},
{
name = "cross_b",
default = "255",
client = true
},
{
name = "reflex_r",
default = "255",
@ -492,6 +512,23 @@ local function menu_client_customization(panel)
panel:ControlHelp( "Fake day to debug and test as, set over 0!!" )
end
local function menu_client_crosshair(panel)
panel:AddControl("label", {
text = "Crosshairs are only enabled on certain weapons."
})
panel:AddControl("checkbox", {
label = "Enable Crosshair",
command = "arc9_cross_enable"
})
panel:AddControl("color", {
label = "Crosshair Color",
red = "arc9_cross_r",
green = "arc9_cross_g",
blue = "arc9_cross_b"
})
end
local function menu_client_optics(panel)
panel:AddControl("checkbox", {
label = "Cheap Scopes",
@ -985,6 +1022,9 @@ local clientmenus_ti = {
{
text = "Client - Controller", func = menu_client_controller
},
{
text = "Client - Crosshair", func = menu_client_crosshair
},
{
text = "Client - Optics", func = menu_client_optics
},

View File

@ -97,7 +97,7 @@ function SWEP:CycleSelectedAtt(amt, cyc)
if #self.AttachmentAddresses <= 0 then return end
if cyc > #self.AttachmentAddresses then return end
local addr = self.BottomBarAddress
local addr = self.BottomBarAddress or 1
local newaddr = addr + amt

View File

@ -27,6 +27,7 @@ local lasthelperalpha = 0
local gaA = 0
function SWEP:DoDrawCrosshair(x, y)
if !GetConVar("arc9_cross_enable"):GetBool() then return end
local dotsize = ScreenScale(1)
local prong = ScreenScale(4)
@ -37,6 +38,10 @@ function SWEP:DoDrawCrosshair(x, y)
local staticgap = ScreenScale(4)
local col = Color(255, 255, 255, 100)
col.r = GetConVar("arc9_cross_r"):GetFloat()
col.g = GetConVar("arc9_cross_g"):GetFloat()
col.b = GetConVar("arc9_cross_b"):GetFloat()
local d = self:GetSightDelta()
prong = Lerp(d, prong, ScreenScale(6))