Skip to content

Commit 66cb777

Browse files
committed
Same as previous
1 parent 386d203 commit 66cb777

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

ElvUI/Mainline/Modules/Skins/SpellBook.lua

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ local S = E:GetModule('Skins')
44
local _G = _G
55
local next = next
66

7+
local C_SpellBook_GetSpellBookItemInfo = C_SpellBook.GetSpellBookItemInfo
8+
79
local function clearBackdrop(self)
810
self:SetBackdropColor(0, 0, 0, 1)
911
end
@@ -95,6 +97,44 @@ function S:Blizzard_ProfessionsBook()
9597
S:HandleIcon(button.iconTexture, true)
9698
end
9799
end
100+
101+
-- Some Texture Magic
102+
hooksecurefunc('FormatProfession', function(frame, id)
103+
if not (id and frame and frame.icon) then return end
104+
105+
local texture = select(2, GetProfessionInfo(id))
106+
if texture then frame.icon:SetTexture(texture) end
107+
end)
108+
109+
-- FIX ME 11.0
110+
hooksecurefunc(_G.ProfessionSpellButtonMixin, 'UpdateButton', function(button)
111+
local parent = button:GetParent()
112+
if not parent or not parent.spellOffset then return end
113+
114+
local activeSpellBank = Enum.SpellBookSpellBank.Player
115+
local spellIndex = button:GetID() + parent.spellOffset
116+
local spellBookItemInfo = C_SpellBook_GetSpellBookItemInfo(spellIndex, activeSpellBank)
117+
if spellBookItemInfo.isPassive then
118+
button.highlightTexture:SetColorTexture(1, 1, 1, 0)
119+
else
120+
button.highlightTexture:SetColorTexture(1, 1, 1, .25)
121+
end
122+
123+
if E.private.skins.parchmentRemoverEnable then
124+
if button.spellString then
125+
button.spellString:SetTextColor(1, 1, 1)
126+
end
127+
if button.subSpellString then
128+
button.subSpellString:SetTextColor(1, 1, 1)
129+
end
130+
if button.SpellName then
131+
button.SpellName:SetTextColor(1, 1, 1)
132+
end
133+
if button.SpellSubName then
134+
button.SpellSubName:SetTextColor(1, 1, 1)
135+
end
136+
end
137+
end)
98138
end
99139

100140
S:AddCallbackForAddon('Blizzard_ProfessionsBook')

0 commit comments

Comments
 (0)