Skip to content

Commit 3f31ccb

Browse files
committed
Added the new Dragonflight research trees
1 parent 98289c5 commit 3f31ccb

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

ResearchViewer.lua

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,30 @@ local orderHalls = {
1919
["DEMONHUNTER"] = 125,
2020
}
2121

22+
ResearchViewer.orderedExpansions = {
23+
'Dragonflight (unordered)',
24+
'Shadowlands',
25+
'BFA',
26+
'Legion',
27+
}
28+
2229
ResearchViewer.talentTrees = {
30+
["Dragonflight (unordered)"] = {
31+
{ type = 111, id = 463, name = "Drake Mastery Progression" },
32+
{ type = 111, id = 467, name = "Drake Mastery Progression" },
33+
{ type = 111, id = 479, name = "Thunder Lizard Effigy" },
34+
{ type = 111, id = 482, name = "Dragonriding Skills" },
35+
{ type = 111, id = 483, name = "Monster Hunter's Gear Rack" },
36+
{ type = 111, id = 484, name = "Advanced Dragonriding" },
37+
{ type = 111, id = 485, name = "Shikaar Hunting Tactics" },
38+
{ type = 111, id = 486, name = "Select Your Companion" },
39+
{ type = 111, id = 487, name = "Clan Teerai Progression" },
40+
{ type = 111, id = 488, name = "Tuskarr Fishing" },
41+
{ type = 111, id = 489, name = "Expedition Supplies" },
42+
{ type = 111, id = 491, name = "Hunting Party Loadout" },
43+
{ type = 111, id = 492, name = "Cobalt Assembly Arcana" },
44+
{ type = 111, id = 493, name = "Cobalt Assembly Arcana" },
45+
},
2346
Shadowlands = {
2447
{ type = 111, id = 461, name = "The Box of Many Things" },
2548
{ type = 111, id = 474, name = "Cypher Research Console" },
@@ -237,7 +260,7 @@ function ResearchViewer:MakeDropDownButton()
237260
icon:SetTexture("Interface\\ChatFrame\\ChatFrameExpandArrow")
238261

239262
mainButton:SetText("Select another Research tree")
240-
mainButton:SetSize(200, 22)
263+
mainButton:SetSize(210, 22)
241264
mainButton:SetPoint("TOPRIGHT", 10, 20)
242265

243266
dropDown:Hide()
@@ -271,6 +294,12 @@ function ResearchViewer:OpenSelectedResearch()
271294
end
272295
end
273296

297+
function ResearchViewer:TreeExists(treeId)
298+
local treeInfo = C_Garrison.GetTalentTreeInfo(treeId)
299+
300+
return treeInfo and treeInfo.treeID == treeId
301+
end
302+
274303
local isMenuItemChecked
275304
do
276305
isMenuItemChecked = function(button)
@@ -282,11 +311,13 @@ do
282311
end
283312

284313
function ResearchViewer:BuildFinalSubMenuItem(parentList, value, setValueFunc)
314+
local treeExists = self:TreeExists(value.id)
285315
table.insert(parentList, {
286-
text = string.format("%s (%d)", value.name, value.id),
316+
text = string.format("%s (%s)", value.name, treeExists and value.id or (value.id .. ' - not available')),
287317
func = setValueFunc,
288318
arg1 = value,
289319
checked = isMenuItemChecked,
320+
disabled = not treeExists,
290321
})
291322
end
292323

@@ -317,7 +348,8 @@ end
317348
function ResearchViewer:BuildMenu(setValueFunc)
318349
local menu = {}
319350

320-
for expansion, list in pairs(self.talentTrees) do
351+
for _, expansion in ipairs(self.orderedExpansions) do
352+
local list = self.talentTrees[expansion]
321353
self:BuildSubMenuList(expansion, nil, menu, setValueFunc, list)
322354
end
323355

0 commit comments

Comments
 (0)