mirror of
https://github.com/dvdvideo1234/TrackAssemblyTool.git
synced 2025-03-04 03:13:32 -05:00
Added: Centralized base node panel expand routine
Fixed: All nodes are expanded/contracted correctly no matter where are clicked Fixed: Database browser consistency between expander/node Fixed: Sub-categories are expanded/contacted and state is preserved
This commit is contained in:
parent
54b42533b0
commit
186db54456
@ -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 ------------
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user