-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathInspectUnitSpecialization.lua
More file actions
39 lines (37 loc) · 1.44 KB
/
InspectUnitSpecialization.lua
File metadata and controls
39 lines (37 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-------------------------------------
-- 顯示天賦信息
-- @Author: M
-- @DepandsOn: InspectUnit.lua
-------------------------------------
hooksecurefunc("ShowInspectItemListFrame", function(unit, parent, itemLevel, maxLevel)
local frame = parent.inspectFrame
if (not frame) then return end
if (not frame.specicon) then
frame.specicon = frame:CreateTexture(nil, "BORDER")
frame.specicon:SetSize(42, 42)
frame.specicon:SetPoint("TOPRIGHT", -6, -6)
frame.specicon:SetAlpha(0.4)
frame.specicon:SetMask("Interface\\Minimap\\UI-Minimap-Background")
frame.spectext = frame:CreateFontString(nil, "BORDER")
frame.spectext:SetFont(SystemFont_Outline_Small:GetFont(), 10, "OUTLINE")
frame.spectext:SetPoint("BOTTOM", frame.specicon, "BOTTOM")
frame.spectext:SetJustifyH("CENTER")
frame.spectext:SetAlpha(0.5)
end
local _, specID, specName, specIcon
if (unit == "player") then
specID = C_SpecializationInfo.GetSpecialization()
_, specName, _, specIcon = C_SpecializationInfo.GetSpecializationInfo(specID)
else
specID = GetInspectSpecialization(unit)
_, specName, _, specIcon = GetSpecializationInfoByID(specID)
end
if (specIcon) then
frame.spectext:SetText(specName)
frame.specicon:SetTexture(specIcon)
frame.specicon:Show()
else
frame.spectext:SetText("")
frame.specicon:Hide()
end
end)