Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions lua/wire/client/customspawnmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

AccessorFunc( PANEL, "m_TabID", "TabID" )

local expand_all = CreateConVar( "wire_tool_menu_expand_all", 0, {FCVAR_ARCHIVE} )

Check warning on line 6 in lua/wire/client/customspawnmenu.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: expand_all
local separate_wire_extras = CreateConVar( "wire_tool_menu_separate_wire_extras", 1, {FCVAR_ARCHIVE} )
local hide_duplicates = CreateConVar( "wire_tool_menu_hide_duplicates", 0, {FCVAR_ARCHIVE} )
local custom_for_all_tabs = CreateConVar( "wire_tool_menu_custom_menu_for_all_tabs", 0, {FCVAR_ARCHIVE} )
Expand All @@ -26,18 +26,14 @@
end
end

local function expandbycookie( nodes )
for i=1,#nodes do
local b = cookie.GetNumber( nodes[i].WireCookieText )

if b and b == 1 then
nodes[i]:SetExpanded( b and b == 1 )
local function expandbycookie(nodes)
for _, node in ipairs(nodes) do
if node.WireCookieText then
node:SetExpanded(cookie.GetNumber(node.WireCookieText) == 1)
end

if nodes[i].ChildNodes then
expandbycookie( nodes[i].ChildNodes:GetChildren() )
end
else
nodes[i]:SetExpanded( false )
if node.ChildNodes then
expandbycookie(node.ChildNodes:GetChildren())
end
end
end
Expand Down Expand Up @@ -125,7 +121,7 @@
self.List:Dock( FILL )

self.SearchList = vgui.Create( "DListView", LeftPanel )
local x,y = self.List:GetPos()

Check warning on line 124 in lua/wire/client/customspawnmenu.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: y
local w,h = self.List:GetSize()
self.SearchList:SetPos( x + w, 160 )
self.SearchList:SetSize( w, h )
Expand Down Expand Up @@ -655,11 +651,11 @@

local function CreateCPanel( panel )
local checkbox = panel:CheckBox( "Use wire's custom tool menu for all tabs", "wire_tool_menu_custom_menu_for_all_tabs" )
checkbox:SetToolTip( "Requires rejoin to take effect" )

Check warning on line 654 in lua/wire/client/customspawnmenu.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use :SetTooltip instead, notice the lowercase fucking t

if WireLib.WireExtrasInstalled then
local SeparateWireExtras = panel:CheckBox( "Separate Wire Extras", "wire_tool_menu_separate_wire_extras" )
SeparateWireExtras:SetToolTip( "Whether or not to separate wire extras tools into its own category." )

Check warning on line 658 in lua/wire/client/customspawnmenu.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use :SetTooltip instead, notice the lowercase fucking t

setUpTabReloadOnChange( SeparateWireExtras )
end
Expand All @@ -670,10 +666,10 @@

local UseIcons = panel:CheckBox( "Use custom icons", "wire_tool_menu_custom_icons" )
setUpTabReloadOnChange( UseIcons )
UseIcons:SetToolTip( "If disabled, all tools will use the 'wrench' icon." )

Check warning on line 669 in lua/wire/client/customspawnmenu.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use :SetTooltip instead, notice the lowercase fucking t

local AutoCollapse = panel:CheckBox( "Autocollapse", "wire_tool_menu_autocollapse" )
AutoCollapse:SetToolTip( "If enabled, opening a category will collapse other categories." )

Check warning on line 672 in lua/wire/client/customspawnmenu.lua

View workflow job for this annotation

GitHub Actions / lint

"Deprecated"

Deprecated: Use :SetTooltip instead, notice the lowercase fucking t

local TabWidth = panel:NumSlider( "Tab width", "wire_tool_menu_tab_width", 300, 3000, 0 )
panel:Help( [[Set the width of all tabs.
Expand Down
Loading