Rebind Reload1 and Reload2

This commit is contained in:
Fesiug 2024-01-03 21:08:59 -05:00
parent 5559d1ebe1
commit b973b4da70
3 changed files with 25 additions and 5 deletions

View File

@ -107,11 +107,11 @@ hook.Add( "PlayerButtonDown", "Benny_PlayerButtonDown_TempForAim", function( ply
end
end
if button == KEY_R then
if button == ply:GetInfoNum("benny_bind_reload", KEY_R) then
wep:Reload( wep:hFlipHand( false ) )
end
if button == KEY_T then
if button == ply:GetInfoNum("benny_bind_reloada", KEY_T) then
wep:Reload( wep:hFlipHand( true ) )
end
end

View File

@ -58,8 +58,12 @@ CONVARS_CL["wep_ao_junk"] = { 0, 0, 1, true, true, "Whether offhand junk
CONVARS_CL["wep_toolgun"] = { "", nil, nil, true, true, "Toolgun tool." }
CONVARS_CL["cam_override"] = { "", nil, nil, false, true, "Override camera" }
CONVARS_CL["cam_unlock"] = { 0, 0, 1, false, false, "Unlock camera" }
CONVARS_CL["cam_override"] = { "", nil, nil, false, true, "Override camera" }
CONVARS_CL["cam_unlock"] = { 0, 0, 1, false, false, "Unlock camera" }
CONVARS_CL["bind2_reload"] = { KEY_R, nil, nil, true, true, "Bind for Reload" }
CONVARS_CL["bind2_reloada"] = { KEY_T, nil, nil, true, true, "Bind for ReloadAlt" }
CONVARS_CL_GEN = {}
for i, v in pairs( CONVARS_CL ) do

View File

@ -1,7 +1,7 @@
-- Settings panel
-- 0 = checkbox, 1 = slider, 2 = string
-- 0 = checkbox, 1 = slider, 2 = string, 3 = binder
local conf = {
[1] = {
{ 0, "benny_hud_enable_health", "Health", },
@ -17,6 +17,8 @@ local conf = {
{ 2, "Pressing Left Mouse will throw an offhand grenade." },
{ 0, "benny_wep_ao_junk", "Junk Overrides Primary Attack" },
{ 2, "Pressing Left Mouse will throw offhand junk." },
{ 3, "benny_bind_reload", "Reload" },
{ 3, "benny_bind_reloada", "Reload Alt" },
},
}
@ -47,6 +49,20 @@ local function genpan( Base, Sect, Conf )
Butt:Dock(TOP)
Butt:DockMargin( 24, -5, 0, 0 )
Butt:SetText( v[2] )
elseif v[1] == 3 then
local Butt = Scroll:Add("DLabel")
Butt:Dock(TOP)
Butt:DockMargin( 48+5, 0, 0, 0 )
Butt:SetText( v[3] )
local Butt = Scroll:Add("DBinder")
Butt:Dock(TOP)
Butt:DockMargin( 48, 0, 48, 2 )
Butt:SetText( v[2] )
function Butt:OnChange( num )
RunConsoleCommand( v[2], num )
end
end
end
end