diff --git a/lua/autorun/trackassembly_init.lua b/lua/autorun/trackassembly_init.lua index 45c3bda6..fec36990 100644 --- a/lua/autorun/trackassembly_init.lua +++ b/lua/autorun/trackassembly_init.lua @@ -86,7 +86,7 @@ local asmlib = trackasmlib; if(not asmlib) then -- Module present ------------ CONFIGURE ASMLIB ------------ asmlib.InitBase("track","assembly") -asmlib.SetOpVar("TOOL_VERSION","8.758") +asmlib.SetOpVar("TOOL_VERSION","8.759") ------------ CONFIGURE GLOBAL INIT OPVARS ------------ diff --git a/lua/trackassembly/trackasmlib.lua b/lua/trackassembly/trackasmlib.lua index 555370da..6041a79f 100644 --- a/lua/trackassembly/trackasmlib.lua +++ b/lua/trackassembly/trackasmlib.lua @@ -1710,6 +1710,22 @@ function GetDirectory(pCurr, vName) return pItem, pItem[keyOb] end +function SetExpandNode(pnBase) + if(inputIsKeyDown(KEY_LSHIFT)) then + if(pnBase:GetExpanded()) then + pnBase:ExpandRecurse(false) + else + pnBase:ExpandRecurse(true) + end + else + if(pnBase:GetExpanded()) then + pnBase:SetExpanded(false) + else + pnBase:SetExpanded(true) + end + end +end + function SetDirectory(pnBase, pCurr, vName) if(not IsValid(pnBase)) then LogInstance("Base panel invalid"); return nil end @@ -1724,11 +1740,8 @@ function SetDirectory(pnBase, pCurr, vName) pCurr[sName] = {}; pCurr[sName][keyOb] = pNode pNode:SetTooltip(languageGetPhrase("tool."..sTool..".subfolder")) pNode.Icon:SetImage(ToIcon("subfolder_item")) - pNode.DoClick = function(pnSelf) - if(inputIsKeyDown(KEY_LSHIFT)) then - pNode:ExpandRecurse(true) - else pnSelf:SetExpanded(true) end - end + pNode.DoClick = function() SetExpandNode(pNode) end + pNode.Expander.DoClick = function() SetExpandNode(pNode) end pNode.DoRightClick = function() SetClipboardText(pNode:GetText()) end diff --git a/lua/weapons/gmod_tool/stools/trackassembly.lua b/lua/weapons/gmod_tool/stools/trackassembly.lua index 5e6424ab..84459c28 100644 --- a/lua/weapons/gmod_tool/stools/trackassembly.lua +++ b/lua/weapons/gmod_tool/stools/trackassembly.lua @@ -2329,11 +2329,8 @@ function TOOL.BuildCPanel(CPanel) local pRoot = pTree:AddNode(sTyp) -- No type folder made already pRoot:SetTooltip(languageGetPhrase("tool."..gsToolNameL..".type")) pRoot.Icon:SetImage(asmlib.ToIcon(defTable.Name)) - pRoot.DoClick = function(pnSelf) - if(inputIsKeyDown(KEY_LSHIFT)) then - pnSelf:ExpandRecurse(true) - else pnSelf:SetExpanded(true) end - end + pRoot.DoClick = function() asmlib.SetExpandNode(pRoot) end + pRoot.Expander.DoClick = function() asmlib.SetExpandNode(pRoot) end pRoot.DoRightClick = function() local sID = asmlib.WorkshopID(sTyp) if(sID and sID:len() > 0 and inputIsKeyDown(KEY_LSHIFT)) then