https://forum.wowcircle.net/showthread.php?t=741051
Talented > inspectui.lua
Код:
function Talented:ADDON_LOADED(_, addon)
if addon == "Blizzard_InspectUI" or addon == "Examiner" then
self:UnregisterEvent("ADDON_LOADED")
self.ADDON_LOADED = nil
self:HookInspectUI()
end
end
PS: https://forum.wowcircle.net/showthread.php?t=413338
Talented > inspectui.lua
Код:
function Talented:UpdateInspectTemplate()
local unit = self:GetInspectUnit()
if not unit then return end
local name = UnitName(unit)
if not UnitIsPlayer(unit) then return end
if not name then return end
local inspections = self.inspections
if not inspections then
inspections = {}
self.inspections = inspections
end
local _, class = UnitClass(unit)
local info = self:UncompressSpellData(class)
local retval
for talentGroup = 1, GetNumTalentGroups(true) do
local template_name = name.." - "..tostring(talentGroup)
local template = inspections[template_name]
if not template then
template = {
name = L["Inspection of %s"]:format(name)..(talentGroup == GetActiveTalentGroup(true) and "" or L[" (alt)"]),
class = class,
}
for tab, tree in ipairs(info) do
template[tab] = {}
end
inspections[template_name] = template
else
self:UnpackTemplate(template)
end
for tab, tree in ipairs(info) do
for index = 1, #tree do
local rank = select(5, GetTalentInfo(tab, index, true, nil, talentGroup))
template[tab][index] = rank
end
end
if not self:ValidateTemplate(template) then
inspections[template_name] = nil
else
local found
for _, view in self:IterateTalentViews(template) do
view:Update()
found = true
end
if not found then self:PackTemplate(template) end
if talentGroup == GetActiveTalentGroup(true) then
retval = template
end
end
end
return retval
end