Skip to content

Commit 6b654b6

Browse files
committed
rework this part of the skin for alerts
1 parent 0ad3c13 commit 6b654b6

File tree

2 files changed

+30
-23
lines changed

2 files changed

+30
-23
lines changed

ElvUI/Cata/Modules/Skins/Alerts.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,21 @@ local function SkinAchievementAlert(frame)
4242
frame.Unlocked:SetTextColor(1, 1, 1)
4343
frame.Name:FontTemplate(nil, 12)
4444

45-
-- Icon
46-
frame.Icon.Texture:SetTexCoord(unpack(E.TexCoords))
47-
frame.Icon.Overlay:Kill()
48-
49-
frame.Icon.Texture:ClearAllPoints()
50-
frame.Icon.Texture:Point('LEFT', frame, 7, 0)
51-
52-
if not frame.Icon.Texture.b then
53-
frame.Icon.Texture.b = CreateFrame('Frame', nil, frame)
54-
frame.Icon.Texture.b:SetTemplate()
55-
frame.Icon.Texture.b:SetOutside(frame.Icon.Texture)
56-
frame.Icon.Texture:SetParent(frame.Icon.Texture.b)
45+
local icon = frame.Icon
46+
if icon then
47+
icon.Overlay:Kill()
48+
49+
local texture = frame.Icon.Texture
50+
if texture then
51+
texture:SetTexCoord(unpack(E.TexCoords))
52+
texture:ClearAllPoints()
53+
texture:Point('LEFT', frame, 7, 0)
54+
55+
if not icon.backdrop then
56+
icon:CreateBackdrop()
57+
icon.backdrop:SetOutside(texture)
58+
end
59+
end
5760
end
5861
end
5962

ElvUI/Mainline/Modules/Skins/Alerts.lua

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,21 @@ local function SkinAchievementAlert(frame)
4444
frame.Unlocked:SetTextColor(1, 1, 1)
4545
frame.Name:FontTemplate(nil, 12)
4646

47-
-- Icon
48-
frame.Icon.Texture:SetTexCoord(unpack(E.TexCoords))
49-
frame.Icon.Overlay:Kill()
50-
51-
frame.Icon.Texture:ClearAllPoints()
52-
frame.Icon.Texture:Point('LEFT', frame, 7, 0)
53-
54-
if not frame.Icon.Texture.b then
55-
frame.Icon.Texture.b = CreateFrame('Frame', nil, frame)
56-
frame.Icon.Texture.b:SetTemplate()
57-
frame.Icon.Texture.b:SetOutside(frame.Icon.Texture)
47+
local icon = frame.Icon
48+
if icon then
49+
icon.Overlay:Kill()
50+
51+
local texture = frame.Icon.Texture
52+
if texture then
53+
texture:SetTexCoord(unpack(E.TexCoords))
54+
texture:ClearAllPoints()
55+
texture:Point('LEFT', frame, 7, 0)
56+
57+
if not icon.backdrop then
58+
icon:CreateBackdrop()
59+
icon.backdrop:SetOutside(texture)
60+
end
61+
end
5862
end
5963
end
6064

0 commit comments

Comments
 (0)