@@ -10,6 +10,29 @@ edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 16,
10
10
insets = { left = 4 , right = 3 , top = 4 , bottom = 3 }
11
11
}
12
12
13
+ local GetSpellInfo = GetSpellInfo or function (spellID )
14
+ if not spellID then
15
+ return nil ;
16
+ end
17
+
18
+ local spellInfo = C_Spell .GetSpellInfo (spellID );
19
+ if spellInfo then
20
+ return spellInfo .name , nil , spellInfo .iconID , spellInfo .castTime , spellInfo .minRange , spellInfo .maxRange , spellInfo .spellID , spellInfo .originalIconID ;
21
+ end
22
+ end
23
+
24
+ local GetSpellCharges = GetSpellCharges or function (id )
25
+ local chargeInfo = C_Spell .GetSpellCharges (id )
26
+ if not chargeInfo then return end
27
+ return chargeInfo .currentCharges , chargeInfo .maxCharges , chargeInfo .cooldownStartTime , chargeInfo .cooldownDuration , chargeInfo .chargeModRate
28
+ end
29
+
30
+ local BOOKTYPE_SPELL = " spell" ;
31
+
32
+ local GetSpellBookItemName = GetSpellBookItemName or function (index , bookType )
33
+ local spellBank = (bookType == BOOKTYPE_SPELL ) and Enum .SpellBookSpellBank .Player or Enum .SpellBookSpellBank .Pet ;
34
+ return C_SpellBook .GetSpellBookItemName (index , spellBank );
35
+ end
13
36
14
37
local frame = CreateFrame (" Frame" , nil , UIParent , " BackdropTemplate" )
15
38
frame :SetBackdrop (backdrop )
@@ -62,7 +85,9 @@ local function updateSpec()
62
85
" spellsWithGlowOverlay" ,
63
86
" spellsWithRequireTarget" ,
64
87
" spellsWithTotem" ,
65
- " spellsWithUsable"
88
+ " spellsWithUsable" ,
89
+ " spellNameIsHero" ,
90
+ " spellIDIsHero"
66
91
}) do
67
92
specDB [field ] = specDB [field ] or {}
68
93
end
@@ -87,18 +112,30 @@ local function gatherTalent()
87
112
local nodes = C_Traits .GetTreeNodes (treeId )
88
113
for _ , nodeId in ipairs (nodes ) do
89
114
local node = C_Traits .GetNodeInfo (configId , nodeId )
90
- if node .ID ~= 0 then
115
+ if node and node .ID ~= 0 then
91
116
for idx , talentId in ipairs (node .entryIDs ) do
92
117
local entryInfo = C_Traits .GetEntryInfo (configId , talentId )
93
- local definitionInfo = C_Traits .GetDefinitionInfo (entryInfo .definitionID )
94
- local spellId = definitionInfo .spellID
95
- local spellName = GetSpellInfo (spellId )
96
- if spellName then
97
- if not specDB .spellIdToTalentId [spellId ] then
98
- PRINT (" talent: " .. GetSpellInfo (spellId ))
118
+ if entryInfo and entryInfo .definitionID then
119
+ local definitionInfo = C_Traits .GetDefinitionInfo (entryInfo .definitionID )
120
+ local spellId = definitionInfo .spellID
121
+ if spellId then
122
+ local spellName = GetSpellInfo (spellId )
123
+ if spellName then
124
+ if not specDB .spellIdToTalentId [spellId ] then
125
+ if node .subTreeID then
126
+ PRINT (" herotalent: " .. spellName )
127
+ else
128
+ PRINT (" talent: " .. spellName )
129
+ end
130
+ end
131
+ specDB .spellIdToTalentId [spellId ] = talentId
132
+ specDB .spellNameToTalentId [spellName ] = talentId
133
+ if node .subTreeID then
134
+ specDB .spellNameIsHero [spellName ] = true
135
+ specDB .spellIDIsHero [spellId ] = true
136
+ end
137
+ end
99
138
end
100
- specDB .spellIdToTalentId [spellId ] = talentId
101
- specDB .spellNameToTalentId [spellName ] = talentId
102
139
end
103
140
end
104
141
end
@@ -621,7 +658,11 @@ function export()
621
658
if specDB .spellsWithUsable [spellId ] then
622
659
parameters = parameters .. " , usable = true"
623
660
end
624
- if specDB .spellIdToTalentId [spellId ] then
661
+ if specDB .spellIDIsHero [spellId ] then
662
+ parameters = parameters .. (" , herotalent = %s" ):format (specDB .spellIdToTalentId [spellId ])
663
+ elseif specDB .spellNameIsHero [spellName ] then
664
+ parameters = parameters .. (" , herotalent = %s" ):format (specDB .spellNameToTalentId [spellName ])
665
+ elseif specDB .spellIdToTalentId [spellId ] then
625
666
parameters = parameters .. (" , talent = %s" ):format (specDB .spellIdToTalentId [spellId ])
626
667
elseif specDB .spellNameToTalentId [spellName ] then
627
668
parameters = parameters .. (" , talent = %d" ):format (specDB .spellNameToTalentId [spellName ])
0 commit comments