mirror of
https://github.com/HaodongMo/ARC-9.git
synced 2025-03-04 03:02:58 -05:00
Single image custom crosshair
- Added support for a single image custom crosshair. Also included a hollow circle PNG creators can use. - Fixed that one could still melee while sprinting if ShootWhileSprint was set to false.
This commit is contained in:
parent
d437da2617
commit
eb0076663c
@ -177,14 +177,15 @@ function SWEP:DoDrawCrosshair(x, y)
|
||||
|
||||
local size = self.CustomCrosshairSize or 40
|
||||
|
||||
-- surface.DrawTexturedRect(x - (dotsize / 2) - gap - prong - ARC9.ScreenScale(11), y - (dotsize / 2) - ARC9.ScreenScale(7), size, size) -- 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), y - (dotsize / 2) - gap - prong - ARC9.ScreenScale(7), size, size, -90) -- Top
|
||||
surface.DrawTexturedRectRotated(x - (dotsize / 2), y + (dotsize / 2) + gap + ARC9.ScreenScale(10), size, size, 90) -- Bottom
|
||||
|
||||
if self.CustomCrosshairSingle then
|
||||
surface.DrawTexturedRectRotated(x, y, size + gap, size + gap, 0) -- Central
|
||||
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, 180) -- Right
|
||||
|
||||
surface.DrawTexturedRectRotated(x - (dotsize / 2), y - (dotsize / 2) - gap - prong - ARC9.ScreenScale(7), size, size, -90) -- Top
|
||||
surface.DrawTexturedRectRotated(x - (dotsize / 2), y + (dotsize / 2) + gap + ARC9.ScreenScale(10), size, size, 90) -- Bottom
|
||||
end
|
||||
elseif self:GetProcessedValue("MissileCrosshair", true) then
|
||||
-- local dotcount = 4
|
||||
|
||||
|
@ -268,6 +268,7 @@ function SWEP:PrimaryAttack()
|
||||
if self:GetCustomize() then return end
|
||||
|
||||
if processedValue(self,"Bash", true) and owner:KeyDown(IN_USE) and !self:GetInSights() then
|
||||
if self:GetIsSprinting() and !self.ShootWhileSprint then return end
|
||||
self:MeleeAttack()
|
||||
self:SetNeedTriggerPress(true)
|
||||
return
|
||||
|
@ -125,6 +125,7 @@ SWEP.MissileCrosshair = false -- Force the missile launcher crosshair
|
||||
SWEP.ForceStandardCrosshair = nil -- Force default + or T crosshair no matter what!
|
||||
|
||||
SWEP.CustomCrosshair = false -- Enables custom crosshair use.
|
||||
SWEP.CustomCrosshairSingle = false -- Enables a single image to be used as the custom crosshair.
|
||||
SWEP.CustomCrosshairMaterial = "" -- Point towards a file to use as the custom crosshair.
|
||||
SWEP.CustomCrosshairSize = 40 -- Changes the custom crosshair size. (Default 40)
|
||||
|
||||
|
BIN
materials/arc9/circlehollow.png
Normal file
BIN
materials/arc9/circlehollow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
Loading…
Reference in New Issue
Block a user