Skip to content

Commit e97ae57

Browse files
committed
Fixed support for TWW version of TalentTreeViewer
1 parent 6b726a6 commit e97ae57

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

core/IcyVeinsImport.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function IcyVeinsImport:ParseDataSegment(startingLevel, dataSegment, levelingOrd
150150
else
151151
local entryIndex = nextChar == '1' and 2 or 1;
152152
local nodeInfo = LibTT:GetNodeInfo(nodeID);
153-
local entry = nodeInfo.type == Enum.TraitNodeType.Selection and nodeInfo.entryIDs and nodeInfo.entryIDs[entryIndex] or nil;
153+
local entry = (nodeInfo.type == Enum.TraitNodeType.Selection or nodeInfo.type == Enum.TraitNodeType.SubTreeSelection) and nodeInfo.entryIDs and nodeInfo.entryIDs[entryIndex] or nil;
154154
rankByNodeID[nodeID] = (rankByNodeID[nodeID] or 0) + 1;
155155

156156
--- @type TalentLoadoutManager_LevelingBuildEntry_withEntry

core/ImportExport.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function ImportExport:ConvertToImportLoadoutEntryInfo(treeID, loadoutContent)
261261

262262
if (indexInfo.isNodeSelected) then
263263
local treeNode = LibTT:GetNodeInfo(treeNodeID);
264-
local isChoiceNode = treeNode.type == Enum.TraitNodeType.Selection;
264+
local isChoiceNode = treeNode.type == Enum.TraitNodeType.Selection or treeNode.type == Enum.TraitNodeType.SubTreeSelection;
265265
local choiceNodeSelection = indexInfo.isChoiceNode and indexInfo.choiceNodeSelection or nil;
266266
if indexInfo.isNodeSelected and isChoiceNode ~= indexInfo.isChoiceNode then
267267
-- guard against corrupt import strings
@@ -398,7 +398,7 @@ function ImportExport:WriteLoadoutContent(exportStream, deserialized, treeID, cl
398398
exportStream:AddValue(self.bitWidthRanksPurchased, info.rank);
399399
end
400400

401-
local isChoiceNode = nodeInfo and nodeInfo.type == Enum.TraitNodeType.Selection;
401+
local isChoiceNode = nodeInfo and (nodeInfo.type == Enum.TraitNodeType.Selection or nodeInfo.type == Enum.TraitNodeType.SubTreeSelection);
402402
exportStream:AddValue(1, isChoiceNode and 1 or 0);
403403
if isChoiceNode then
404404
local entryIndex = 0;

core/TalentLoadoutManager.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ function TLM:IsChoiceNode(nodeID)
363363
if configID == nil or nodeID == nil then return; end
364364

365365
local nodeInfo = C_Traits.GetNodeInfo(configID, nodeID);
366-
return nodeInfo and Enum.TraitNodeType.Selection == nodeInfo.type;
366+
return nodeInfo and (Enum.TraitNodeType.Selection == nodeInfo.type or Enum.TraitNodeType.SubTreeSelection == nodeInfo.type);
367367
end
368368

369369
--- @return number incremented unique ID
@@ -603,15 +603,15 @@ function TLM:LoadoutInfoToEntryInfo(loadoutInfo)
603603
for _, entryID in pairs(nodeInfo.entryIDs) do
604604
if entryID == loadoutNodeInfo.entryID then
605605
nodeInfoExists = true;
606-
isChoiceNode = Enum.TraitNodeType.Selection == nodeInfo.type;
606+
isChoiceNode = Enum.TraitNodeType.Selection == nodeInfo.type or Enum.TraitNodeType.SubTreeSelection == nodeInfo.type;
607607
break;
608608
else
609609
local nodeEntryInfo = C_Traits.GetEntryInfo(configID, entryID);
610610
local definitionInfo = nodeEntryInfo and nodeEntryInfo.definitionID and C_Traits.GetDefinitionInfo(nodeEntryInfo.definitionID);
611611
if definitionInfo and definitionInfo.spellID == loadoutNodeInfo.spellID then
612612
nodeInfoExists = true;
613613
loadoutNodeInfo.entryID = entryID;
614-
isChoiceNode = Enum.TraitNodeType.Selection == nodeInfo.type;
614+
isChoiceNode = Enum.TraitNodeType.Selection == nodeInfo.type or Enum.TraitNodeType.SubTreeSelection == nodeInfo.type;
615615
break;
616616
end
617617
end

modules/SideBarMixin.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,10 @@ function SideBarMixin:OpenDropDownMenu(dropDown, frame, elementData)
750750
openInTTV = {
751751
text = "Open in TalentTreeViewer",
752752
notCheckable = true,
753-
disabled = not (C_AddOns.GetAddOnEnableState('TalentTreeViewer', UnitName('player')) == 2),
753+
disabled = C_AddOns.GetAddOnEnableState(
754+
TalentViewerLoader and TalentViewerLoader:GetLodAddonName() or 'TalentTreeViewer',
755+
UnitName('player')
756+
) ~= 2,
754757
func = function()
755758
self:OpenInTalentTreeViewer(elementData);
756759
end,
@@ -896,7 +899,12 @@ function SideBarMixin:OpenInTalentTreeViewer(elementData)
896899
if not exportString then
897900
return;
898901
end
899-
C_AddOns.LoadAddOn('TalentTreeViewer');
902+
if TalentViewerLoader then
903+
TalentViewerLoader:LoadTalentViewer();
904+
else
905+
C_AddOns.LoadAddOn('TalentTreeViewer');
906+
end
907+
local TalentViewer = TalentViewerLoader:GetTalentViewer() or _G.TalentViewer;
900908
if not TalentViewer or not TalentViewer.ImportLoadout then
901909
return;
902910
end

modules/TalentTreeViewerSidebar.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,11 @@ end
104104

105105
function Module:GetBlizzMoveFrameTable()
106106
return {
107-
['TalentTreeViewer'] = {
107+
[TalentViewerLoader and TalentViewerLoader:GetLodAddonName() or 'TalentTreeViewer'] = {
108108
['TalentViewer_DF'] = {
109-
MinVersion = 100000,
110109
SubFrames = {
111-
['TalentViewer_DF.Talents.ButtonsParent'] = {
112-
MinVersion = 100000,
113-
},
110+
['TalentViewer_DF.Talents.ButtonsParent'] = {},
114111
["TLM-TTVSideBar"] = {
115-
MinVersion = 100000,
116112
FrameReference = self.SideBar,
117113
Detachable = true,
118114
},

0 commit comments

Comments
 (0)