more handedness bullsh

This commit is contained in:
Fesiug 2023-11-16 22:30:17 -05:00
parent 95b96ddb7b
commit 97d5939b91
7 changed files with 22 additions and 22 deletions

View File

@ -22,7 +22,7 @@ function SWEP:BFire( hand )
self:B_Ammo( hand, self:D_GetClip( hand ) - 1 ) self:B_Ammo( hand, self:D_GetClip( hand ) - 1 )
B_Sound( self, wep_class.Sound_Fire ) B_Sound( self, wep_class.Sound_Fire )
self:TPFire() self:TPFire( self:GetTempHandedness() )
self:CallFire( hand ) self:CallFire( hand )
self:D_SetDelay( hand, CurTime() + wep_class.Delay ) self:D_SetDelay( hand, CurTime() + wep_class.Delay )

View File

@ -112,33 +112,33 @@ SWEP.GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_SHOTGUN, 0.85 }
SWEP.GestureReload = { ACT_FLINCH_STOMACH, 0.3 } SWEP.GestureReload = { ACT_FLINCH_STOMACH, 0.3 }
SWEP.GestureDraw = { ACT_GMOD_GESTURE_MELEE_SHOVE_1HAND, 0.75 } SWEP.GestureDraw = { ACT_GMOD_GESTURE_MELEE_SHOVE_1HAND, 0.75 }
SWEP.GestureHolster = { ACT_GMOD_GESTURE_MELEE_SHOVE_1HAND, 0.65 } SWEP.GestureHolster = { ACT_GMOD_GESTURE_MELEE_SHOVE_1HAND, 0.65 }
function SWEP:TPFire() function SWEP:TPFire( hand )
if CLIENT and !IsFirstTimePredicted() then return end if CLIENT and !IsFirstTimePredicted() then return end
local target = self:BClass( false ).GestureFire local target = self:BClass( hand ) and self:BClass( hand ).GestureFire
if !target then if !target then
target = self.GestureFire target = self.GestureFire
end end
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true ) self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
end end
function SWEP:TPReload() function SWEP:TPReload( hand )
if CLIENT and !IsFirstTimePredicted() then return end if CLIENT and !IsFirstTimePredicted() then return end
local target = self:BClass( false ).GestureReload local target = self:BClass( hand ) and self:BClass( hand ).GestureReload
if !target then if !target then
target = self.GestureReload target = self.GestureReload
end end
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true ) self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
end end
function SWEP:TPDraw() function SWEP:TPDraw( hand )
if CLIENT and !IsFirstTimePredicted() then return end if CLIENT and !IsFirstTimePredicted() then return end
local target = self:BClass( false ).GestureDraw local target = self:BClass( hand ) and self:BClass( hand ).GestureDraw
if !target then if !target then
target = self.GestureDraw target = self.GestureDraw
end end
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true ) self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
end end
function SWEP:TPHolster() function SWEP:TPHolster( hand )
if CLIENT and !IsFirstTimePredicted() then return end if CLIENT and !IsFirstTimePredicted() then return end
local target = self:BClass( false ) and self:BClass( false ).GestureHolster local target = self:BClass( hand ) and self:BClass( hand ).GestureHolster
if !target then if !target then
target = self.GestureHolster target = self.GestureHolster
end end

View File

@ -153,7 +153,7 @@ function SWEP:Reload()
B_Sound( self, "Common.NoAmmo" ) B_Sound( self, "Common.NoAmmo" )
end end
end end
self:TPReload() self:TPReload( self:GetTempHandedness() )
end end
-- end -- end
end end
@ -196,9 +196,9 @@ function SWEP:Think()
end end
if ht == "normal" and self:GetHoldType() != "normal" then if ht == "normal" and self:GetHoldType() != "normal" then
self:TPHolster() self:TPHolster( self:GetTempHandedness() )
elseif ht != "normal" and self:GetHoldType() == "normal" then elseif ht != "normal" and self:GetHoldType() == "normal" then
self:TPDraw() self:TPDraw( self:GetTempHandedness() )
end end
if self:BClass( false ) then if self:BClass( false ) then

View File

@ -503,7 +503,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
for n, bucket in ipairs( inventorylist ) do for n, bucket in ipairs( inventorylist ) do
for i, v in ipairs( bucket ) do for i, v in ipairs( bucket ) do
if v == wep:D_GetID( false ) then if v == wep:D_GetID( wep:GetTempHandedness() ) then
bucket_selected = n bucket_selected = n
item_selected = i item_selected = i
end end
@ -541,7 +541,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
else else
for d, item in ipairs( bucket ) do for d, item in ipairs( bucket ) do
local idata = WEAPONS[inv[item].Class] local idata = WEAPONS[inv[item].Class]
local sel = item==wep:D_GetID( false )--d==item_selected local sel = item==wep:D_GetID( wep:GetTempHandedness() )--d==item_selected
surface.SetDrawColor( scheme["bg"] ) surface.SetDrawColor( scheme["bg"] )
surface.DrawRect( bump + b, (item_start+ybump) + b, size_textx, (sel and size_texty_sel or size_texty) ) surface.DrawRect( bump + b, (item_start+ybump) + b, size_textx, (sel and size_texty_sel or size_texty) )
if sel then if sel then
@ -727,7 +727,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
end end
end end
if true and p:BennyCheck() then if false and p:BennyCheck() then
local bx, by = sw/2, sh*(0.75) local bx, by = sw/2, sh*(0.75)
local mx = 50 local mx = 50
@ -804,7 +804,7 @@ do
["invnext"] = function( ply ) ["invnext"] = function( ply )
if !ply:BennyCheck() then return end if !ply:BennyCheck() then return end
local buckets = ply:INV_Buckets() local buckets = ply:INV_Buckets()
local currsel = ply:GetActiveWeapon():GetWep1() local currsel = ply:GetActiveWeapon():D_GetID( ply:GetActiveWeapon():GetTempHandedness() )
local lb, li = Locate( ply, buckets, currsel ) local lb, li = Locate( ply, buckets, currsel )
if lb then if lb then
@ -828,7 +828,7 @@ do
end, end,
["invprev"] = function( ply ) ["invprev"] = function( ply )
local buckets = ply:INV_Buckets() local buckets = ply:INV_Buckets()
local currsel = ply:GetActiveWeapon():GetWep1() local currsel = ply:GetActiveWeapon():D_GetID( ply:GetActiveWeapon():GetTempHandedness() )
local lb, li = Locate( ply, buckets, currsel ) local lb, li = Locate( ply, buckets, currsel )
if lb then if lb then

View File

@ -61,7 +61,7 @@ end, "arg 1: item id, arg 2 does offhand")
-- PROTO: Move this all into weapon code. -- PROTO: Move this all into weapon code.
concommand.Add("benny_inv_holster", function( ply, cmd, args ) concommand.Add("benny_inv_holster", function( ply, cmd, args )
if ply:BennyCheck() then ply:GetActiveWeapon():BHolster( false ) end if ply:BennyCheck() then ply:GetActiveWeapon():BHolster( ply:GetActiveWeapon():GetTempHandedness() ) end
end) end)
concommand.Add("benny_inv_sync", function( ply, cmd, args ) concommand.Add("benny_inv_sync", function( ply, cmd, args )

View File

@ -187,10 +187,10 @@ hook.Add("StartCommand", "Benny_INV_StartCommand", function( ply, cmd )
cmd:SetUpMove( inv_bucketlist_flipped[ ply.CLIENTDESIRE ] ) cmd:SetUpMove( inv_bucketlist_flipped[ ply.CLIENTDESIRE ] )
end end
local id = cmd:GetUpMove() local id = cmd:GetUpMove()
local hand = wep:GetTempHandedness()
if id > 0 and inv_bucketlist[id] and inv[inv_bucketlist[id]] then if id > 0 and inv_bucketlist[id] and inv[inv_bucketlist[id]] then
wep:BDeploy( false, inv_bucketlist[ id ] ) wep:BDeploy( hand, inv_bucketlist[ id ] )
if CLIENT and (wep:D_GetID( false ) == ply.CLIENTDESIRE) then if CLIENT and (wep:D_GetID( hand ) == ply.CLIENTDESIRE) then
ply.CLIENTDESIRE = 0 ply.CLIENTDESIRE = 0
print("Fixed") print("Fixed")
end end

View File

@ -925,7 +925,7 @@ do -- Grenades, nothing here is guaranteed.
-- TEMP: Do this right! -- TEMP: Do this right!
if !class.GrenadeCharge then self:SetGrenadeDownStart( CurTime() ) end if !class.GrenadeCharge then self:SetGrenadeDownStart( CurTime() ) end
-- --
self:TPFire() self:TPFire( self:GetTempHandedness() )
if SERVER then GrenadeCreate( self, data ) end if SERVER then GrenadeCreate( self, data ) end
local id = self:D_GetID( false ) local id = self:D_GetID( false )
self:BHolster( false ) self:BHolster( false )