new sg crosshairs

This commit is contained in:
Darsu 2024-11-02 19:31:52 +07:00
parent 84a9d38e34
commit 96604c457c
6 changed files with 55 additions and 15 deletions

View File

@ -149,6 +149,14 @@ ARC9.SettingsTable = {
{ type = "bool", text = "settings.crosshair.crosshair_force.title", convar = "crosshair_force", desc = "settings.crosshair.crosshair_force.desc" }, { type = "bool", text = "settings.crosshair.crosshair_force.title", convar = "crosshair_force", desc = "settings.crosshair.crosshair_force.desc" },
{ type = "bool", text = "settings.crosshair.crosshair_target.title", convar = "crosshair_target", desc = "settings.crosshair.crosshair_target.desc" }, { type = "bool", text = "settings.crosshair.crosshair_target.title", convar = "crosshair_target", desc = "settings.crosshair.crosshair_target.desc" },
{ type = "bool", text = "settings.crosshair.crosshair_peeking.title", convar = "crosshair_peek", desc = "settings.crosshair.crosshair_peeking.desc" }, { type = "bool", text = "settings.crosshair.crosshair_peeking.title", convar = "crosshair_peek", desc = "settings.crosshair.crosshair_peeking.desc" },
{ type = "combo", text = "settings.crosshair.crosshair_sgstyle.title", convar = "cross_sgstyle", desc = "settings.crosshair.crosshair_sgstyle.desc", content = {
{"1" .. ARC9:GetPhrase("settings.crosshair.crosshair_sgstyle_fullcircle"), "1"},
{"2" .. ARC9:GetPhrase("settings.crosshair.crosshair_sgstyle_four"), "2"},
{"3" .. ARC9:GetPhrase("settings.crosshair.crosshair_sgstyle_two"), "3"},
{"4" .. ARC9:GetPhrase("settings.crosshair.crosshair_sgstyle_dots"), "4"},
{"5" .. ARC9:GetPhrase("settings.crosshair.crosshair_sgstyle_dots_accurate"), "5"},
},
},
}, },
{ {
TabName = "settings.tabname.hud_cust", TabName = "settings.tabname.hud_cust",

View File

@ -580,6 +580,14 @@ L["settings.crosshair.crosshair_target.desc"] = "Make the crosshair red when aim
L["settings.crosshair.crosshair_peeking.title"] = "Display Crosshair when Peeking" L["settings.crosshair.crosshair_peeking.title"] = "Display Crosshair when Peeking"
L["settings.crosshair.crosshair_peeking.desc"] = "Displays the crosshair when aiming and using the peek function." L["settings.crosshair.crosshair_peeking.desc"] = "Displays the crosshair when aiming and using the peek function."
L["settings.crosshair.crosshair_sgstyle.title"] = "sg xhair"
L["settings.crosshair.crosshair_sgstyle.desc"] = "meow"
L["settings.crosshair.crosshair_sgstyle_fullcircle"] = "full circle"
L["settings.crosshair.crosshair_sgstyle_four"] = "4 prong"
L["settings.crosshair.crosshair_sgstyle_two"] = "2 prong"
L["settings.crosshair.crosshair_sgstyle_dots"] = "original dots"
L["settings.crosshair.crosshair_sgstyle_dots_accurate"] = "dots match amount of pellets"
////////////////////// Customization ////////////////////// Customization
L["settings.tabname.hud_cust"] = "Customization" L["settings.tabname.hud_cust"] = "Customization"

View File

@ -10,6 +10,7 @@ local arc9_cross_b = GetConVar("arc9_cross_b")
local arc9_cross_a = GetConVar("arc9_cross_a") local arc9_cross_a = GetConVar("arc9_cross_a")
local arc9_dev_crosshair = GetConVar("arc9_dev_crosshair") local arc9_dev_crosshair = GetConVar("arc9_dev_crosshair")
local arc9_crosshair_peek = GetConVar("arc9_crosshair_peek") local arc9_crosshair_peek = GetConVar("arc9_crosshair_peek")
local arc9_crosshair_sgstyle = GetConVar("arc9_cross_sgstyle")
function SWEP:ShouldDrawCrosshair() function SWEP:ShouldDrawCrosshair()
@ -42,6 +43,10 @@ local lerp = Lerp
-- local arcticcolor = Color(255, 255, 255, 100) -- local arcticcolor = Color(255, 255, 255, 100)
local ARC9ScreenScale = ARC9.ScreenScale local ARC9ScreenScale = ARC9.ScreenScale
local arc9_crosshair_target = GetConVar("arc9_crosshair_target") local arc9_crosshair_target = GetConVar("arc9_crosshair_target")
local sgcircle = Material("arc9/circlehollow.png", "mips smooth")
local sgcirclethick = Material("arc9/circlehollowsmall.png", "mips smooth")
local sgcirclethin = Material("arc9/circlehollowbig.png", "mips smooth")
local sgcircleprong = Material("arc9/circleprong.png", "mips smooth")
function SWEP:DoDrawCrosshair(x, y) function SWEP:DoDrawCrosshair(x, y)
if !arc9_cross_enable:GetBool() then return end if !arc9_cross_enable:GetBool() then return end
@ -179,7 +184,7 @@ function SWEP:DoDrawCrosshair(x, y)
local size = self:GetProcessedValue("CustomCrosshairSize", true) or 40 local size = self:GetProcessedValue("CustomCrosshairSize", true) or 40
if self:GetProcessedValue("CustomCrosshairSingle", true) then if self:GetProcessedValue("CustomCrosshairSingle", true) then
surface.DrawTexturedRectRotated(x, y, size + gap, size + gap, 0) -- Central surface.DrawTexturedRectRotated(x, y, (dotsize + gap) * 2, (dotsize + gap) * 2, 0) -- Central
else else
surface.DrawTexturedRectRotated(x - (dotsize / 2) - gap - ARC9.ScreenScale(11), y - (dotsize / 2), size, size, 0) -- Left surface.DrawTexturedRectRotated(x - (dotsize / 2) - gap - ARC9.ScreenScale(11), y - (dotsize / 2), size, size, 0) -- Left
surface.DrawTexturedRectRotated(x - (dotsize / 2) + gap + ARC9.ScreenScale(11), y - (dotsize / 2), size, size, 180) -- Right surface.DrawTexturedRectRotated(x - (dotsize / 2) + gap + ARC9.ScreenScale(11), y - (dotsize / 2), size, size, 180) -- Right
@ -253,24 +258,43 @@ function SWEP:DoDrawCrosshair(x, y)
drawshadowrect(x - (dotsize / 2) - (minigap * 2), y - (dotsize / 2) + gap + (staticgap * 5.5), dotsize, dotsize, col) drawshadowrect(x - (dotsize / 2) - (minigap * 2), y - (dotsize / 2) + gap + (staticgap * 5.5), dotsize, dotsize, col)
drawshadowrect(x - (dotsize / 2) + (minigap * 2), y - (dotsize / 2) + gap + (staticgap * 5.5), dotsize, dotsize, col) drawshadowrect(x - (dotsize / 2) + (minigap * 2), y - (dotsize / 2) + gap + (staticgap * 5.5), dotsize, dotsize, col)
elseif self:GetProcessedValue("Num", true) > 1 and !forcestd then elseif self:GetProcessedValue("Num", true) > 1 and !forcestd then
-- local dotcount = 10 local style = arc9_crosshair_sgstyle:GetInt()
-- for i = 1, dotcount do if style == 4 or style == 5 then
-- local rad = i * math.pi * 2 / dotcount local dotcount = style == 5 and self:GetProcessedValue("Num", true) or 10
-- rad = rad - (math.pi / 2)
-- local cx = math.cos(rad)
-- local cy = math.sin(rad)
-- cx = cx * gap for i = 1, dotcount do
-- cy = cy * gap local rad = i * math.pi * 2 / dotcount
rad = rad - (math.pi / 2) + math.pi / 2
local cx = math.cos(rad)
local cy = math.sin(rad)
-- drawshadowrect(x + cx - (dotsize / 2), y + cy - (dotsize / 2), dotsize, dotsize, col) cx = cx * gap
-- end cy = cy * gap
surface.DrawCircle(x, y, dotsize + gap - 1, col.r, col.g, col.b, 255) -- Middle White / Coloured One drawshadowrect(x + cx - (dotsize / 2), y + cy - (dotsize / 2), dotsize, dotsize, col)
surface.DrawCircle(x, y, dotsize + gap, 0, 0, 0, 100) -- Outside Gray end
surface.DrawCircle(x, y, dotsize + gap -2, 0, 0, 0, 100) -- Inside Gray elseif style == 3 or style == 2 then
local size = gap - gap * 0.5 + 15
surface.SetDrawColor(col)
surface.SetMaterial(sgcircleprong)
surface.DrawTexturedRectRotated(x - (dotsize / 2) - gap, y - (dotsize / 2) + 1, size, size, 0) -- Left
surface.DrawTexturedRectRotated(x - (dotsize / 2) + 2 + gap, y - (dotsize / 2) + 1, size, size, 180) -- Right
if style == 2 then
surface.DrawTexturedRectRotated(x - (dotsize / 2) + 1, y - (dotsize / 2) - gap - 1 , size, size, -90) -- Top
surface.DrawTexturedRectRotated(x - (dotsize / 2) + 1, y + (dotsize / 2) + gap , size, size, 90) -- Bottom
end
else
surface.SetDrawColor(col)
surface.SetMaterial((gap > 75 and sgcirclethin) or (gap < 30 and sgcirclethick) or sgcircle)
surface.DrawTexturedRectRotated(x, y, (dotsize + gap) * 2, (dotsize + gap) * 2, 0) -- Central
end
-- surface.DrawCircle(x, y, dotsize + gap - 1, col.r, col.g, col.b, 255) -- Middle White / Coloured One
-- surface.DrawCircle(x, y, dotsize + gap, 0, 0, 0, 100) -- Outside Gray
-- surface.DrawCircle(x, y, dotsize + gap -2, 0, 0, 0, 100) -- Inside Gra
else else
if mode > 1 then if mode > 1 then
-- Burst crosshair -- Burst crosshair

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB