Settings, "X overrides Primary Attack" settings...
This commit is contained in:
parent
5ea4634429
commit
d52abef64a
|
@ -54,7 +54,19 @@ function SWEP:D_SetClip( hand, value )
|
||||||
end
|
end
|
||||||
|
|
||||||
function SWEP:C_DualCheck()
|
function SWEP:C_DualCheck()
|
||||||
return self:BTable( true )--self:BTable( false ) and self:BTable( true ) and self:BClass( false ).Features == "firearm" and self:BClass( true ).Features == "firearm"
|
local p = self:GetOwner()
|
||||||
|
local lt = self:BTable( true )
|
||||||
|
if lt then
|
||||||
|
if lt.Features == "firearm" then
|
||||||
|
return p:GetInfoNum( "benny_wep_ao_firearms", 1 )==1
|
||||||
|
elseif lt.Features == "grenade" then
|
||||||
|
return p:GetInfoNum( "benny_wep_ao_grenades", 0 )==1
|
||||||
|
else
|
||||||
|
return p:GetInfoNum( "benny_wep_ao_junk", 0 )==1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function SWEP:C_AttackDown( hand )
|
function SWEP:C_AttackDown( hand )
|
||||||
|
|
|
@ -48,6 +48,9 @@ CONVARS_CL["hud_enable_active"] = { 1, nil, nil, false, true, "Draw Active
|
||||||
CONVARS_CL["hud_enable_hints"] = { 1, nil, nil, false, true, "Draw Hints panel" }
|
CONVARS_CL["hud_enable_hints"] = { 1, nil, nil, false, true, "Draw Hints panel" }
|
||||||
|
|
||||||
CONVARS_CL["wep_toggleaim"] = { 1, 0, 1, true, true, "Hold or toggle to aim weapon." }
|
CONVARS_CL["wep_toggleaim"] = { 1, 0, 1, true, true, "Hold or toggle to aim weapon." }
|
||||||
|
CONVARS_CL["wep_ao_firearms"] = { 1, 0, 1, true, true, "Whether offhand firearms overrides primary attack." }
|
||||||
|
CONVARS_CL["wep_ao_grenades"] = { 0, 0, 1, true, true, "Whether offhand grenades overrides primary attack." }
|
||||||
|
CONVARS_CL["wep_ao_junk"] = { 0, 0, 1, true, true, "Whether offhand junk overrides primary attack." }
|
||||||
|
|
||||||
CONVARS_CL["wep_toolgun"] = { "", nil, nil, true, true, "Toolgun tool." }
|
CONVARS_CL["wep_toolgun"] = { "", nil, nil, true, true, "Toolgun tool." }
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,53 @@
|
||||||
-- 0 = checkbox, 1 = slider, 2 = string
|
-- 0 = checkbox, 1 = slider, 2 = string
|
||||||
local conf = {
|
local conf = {
|
||||||
[1] = {
|
[1] = {
|
||||||
{ "benny_hud_enable_health", "Health", 0 },
|
{ 0, "benny_hud_enable_health", "Health", },
|
||||||
{ "benny_hud_enable_active", "Active Weapon", 0 },
|
{ 0, "benny_hud_enable_active", "Active Weapon", },
|
||||||
{ "benny_hud_enable_hints", "Hints", 0 },
|
{ 0, "benny_hud_enable_hints", "Hints", },
|
||||||
{ "benny_hud_enable_hotbar", "Hotbar", 0 },
|
{ 0, "benny_hud_enable_hotbar", "Hotbar", },
|
||||||
{ "benny_hud_scale", "Scale", 1, 1, 4, 0 },
|
{ 1, "benny_hud_scale", "Scale", 1, 4, 0 },
|
||||||
|
},
|
||||||
|
[2] = {
|
||||||
|
{ 0, "benny_wep_ao_firearms", "Firearms Override Primary Attack" },
|
||||||
|
{ 2, "Pressing Left Mouse will shoot an offhand firearm." },
|
||||||
|
{ 0, "benny_wep_ao_grenades", "Grenades Override Primary Attack" },
|
||||||
|
{ 2, "Pressing Left Mouse will throw an offhand grenade." },
|
||||||
|
{ 0, "benny_wep_ao_junk", "Junk Override Primary Attack" },
|
||||||
|
{ 2, "Pressing Left Mouse will throw offhand junk." },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local function genpan( Base, Sect, Num )
|
||||||
|
local Scroll = Base:Add("DPanel")
|
||||||
|
Scroll:DockPadding( 10, 5, 10, 5 )
|
||||||
|
Scroll.Paint = function() end
|
||||||
|
Sect:SetContents( Scroll )
|
||||||
|
|
||||||
|
for i, v in ipairs( conf[Num] ) do
|
||||||
|
if v[1] == 0 then
|
||||||
|
local Butt = Scroll:Add("DCheckBoxLabel")
|
||||||
|
Butt:Dock(TOP)
|
||||||
|
Butt:DockMargin( 0, 2, 0, 2 )
|
||||||
|
Butt:SetText( v[3] )
|
||||||
|
Butt:SetConVar( v[2] )
|
||||||
|
elseif v[1] == 1 then
|
||||||
|
local Butt = Scroll:Add("DNumSlider")
|
||||||
|
Butt:Dock(TOP)
|
||||||
|
Butt:DockMargin( 0, 2, 0, 2 )
|
||||||
|
Butt:SetText( v[3] )
|
||||||
|
Butt:SetConVar( v[2] )
|
||||||
|
Butt:SetMin( v[4] )
|
||||||
|
Butt:SetMax( v[5] )
|
||||||
|
Butt:SetDecimals( v[6] )
|
||||||
|
elseif v[1] == 2 then
|
||||||
|
local Butt = Scroll:Add("DLabel")
|
||||||
|
Butt:Dock(TOP)
|
||||||
|
Butt:DockMargin( 40, -5, 0, 0 )
|
||||||
|
Butt:SetText( v[2] )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function OpenSettingsMenu()
|
function OpenSettingsMenu()
|
||||||
local Base = vgui.Create("DFrame")
|
local Base = vgui.Create("DFrame")
|
||||||
Base:SetTitle("Settings")
|
Base:SetTitle("Settings")
|
||||||
|
@ -24,35 +63,15 @@ function OpenSettingsMenu()
|
||||||
Sect:Dock(TOP)
|
Sect:Dock(TOP)
|
||||||
Sect:SetLabel("Preferences")
|
Sect:SetLabel("Preferences")
|
||||||
|
|
||||||
local Scroll = Base:Add("DPanel")
|
genpan( Base, Sect, 1 )
|
||||||
Scroll:DockPadding( 10, 5, 10, 5 )
|
|
||||||
Scroll.Paint = function() end
|
|
||||||
Sect:SetContents( Scroll )
|
|
||||||
|
|
||||||
for i, v in ipairs( conf[1] ) do
|
|
||||||
if v[3] == 0 then
|
|
||||||
local Butt = Scroll:Add("DCheckBoxLabel")
|
|
||||||
Butt:Dock(TOP)
|
|
||||||
Butt:DockMargin( 0, 2, 0, 2 )
|
|
||||||
Butt:SetText( v[2] )
|
|
||||||
Butt:SetConVar( v[1] )
|
|
||||||
elseif v[3] == 1 then
|
|
||||||
local Butt = Scroll:Add("DNumSlider")
|
|
||||||
Butt:Dock(TOP)
|
|
||||||
Butt:DockMargin( 0, 2, 0, 2 )
|
|
||||||
Butt:SetText( v[2] )
|
|
||||||
Butt:SetConVar( v[1] )
|
|
||||||
Butt:SetMin( v[4] )
|
|
||||||
Butt:SetMax( v[5] )
|
|
||||||
Butt:SetDecimals( v[6] )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
do -- Sect 2
|
do -- Sect 2
|
||||||
local Sect = Base:Add("DCollapsibleCategory")
|
local Sect = Base:Add("DCollapsibleCategory")
|
||||||
Sect:Dock(TOP)
|
Sect:Dock(TOP)
|
||||||
Sect:SetLabel("Controls")
|
Sect:SetLabel("Controls")
|
||||||
|
|
||||||
|
genpan( Base, Sect, 2 )
|
||||||
end
|
end
|
||||||
|
|
||||||
do -- Sect 3
|
do -- Sect 3
|
||||||
|
|
Loading…
Reference in New Issue