@@ -2,6 +2,8 @@ local E, L, V, P, G = unpack(ElvUI)
2
2
local S = E :GetModule (' Skins' )
3
3
4
4
local _G = _G
5
+ local next = next
6
+ local unpack = unpack
5
7
local CreateFrame = CreateFrame
6
8
7
9
function S :SkinPVPFrame ()
@@ -20,26 +22,30 @@ function S:SkinPVPFrame()
20
22
' PVPBannerFrameAcceptButton'
21
23
}
22
24
23
- for i = 1 , # buttons do
24
- local button = _G [buttons [i ]]
25
-
26
- button :StripTextures ()
27
- S :HandleButton (button )
25
+ for _ , name in next , buttons do
26
+ local button = _G [name ]
27
+ if button then
28
+ button :StripTextures ()
29
+ S :HandleButton (button )
30
+ end
28
31
end
29
32
30
- local Strip = {
33
+ local stripTextures = {
31
34
' PVPFrameInset' ,
32
35
' PVPHonorFrame' ,
33
36
' PVPFrameTopInset' ,
34
37
' PVPConquestFrame'
35
38
}
36
39
37
- for _ , strip in pairs (Strip ) do
38
- _G [strip ]:StripTextures ()
40
+ for _ , name in next , stripTextures do
41
+ local button = _G [name ]
42
+ if button then
43
+ button :StripTextures ()
44
+ end
39
45
end
40
46
41
47
-- Tons of leftover texture crap
42
- local KillTextures = {
48
+ local killTextures = {
43
49
' PVPHonorFrameBGTex' ,
44
50
' PVPHonorFrameInfoScrollFrameScrollBar' ,
45
51
' PVPConquestFrameInfoButtonInfoBG' ,
@@ -52,8 +58,11 @@ function S:SkinPVPFrame()
52
58
' PVPFrameConquestBarShadow'
53
59
}
54
60
55
- for _ , texture in pairs (KillTextures ) do
56
- _G [texture ]:Kill ()
61
+ for _ , name in next , killTextures do
62
+ local button = _G [name ]
63
+ if button then
64
+ button :Kill ()
65
+ end
57
66
end
58
67
59
68
_G .PVPHonorFrameInfoScrollFrameChildFrameDescription :SetTextColor (1 , 1 , 1 )
@@ -95,6 +104,9 @@ function S:SkinPVPFrame()
95
104
PVPFrameLowLevelFrame .backdrop :Point (' TOPLEFT' , - 2 , - 40 )
96
105
PVPFrameLowLevelFrame .backdrop :Point (' BOTTOMRIGHT' , 5 , 80 )
97
106
107
+ local honorTexture = [[ Interface\Icons\PVPCurrency-Honor-]] .. E .myfaction
108
+ local conquestTexture = [[ Interface\Icons\PVPCurrency-Conquest-]] .. E .myfaction
109
+
98
110
-- PvP Icon
99
111
if _G .PVPFrameCurrency then
100
112
local PVPFrameCurrency = _G .PVPFrameCurrency
@@ -103,7 +115,7 @@ function S:SkinPVPFrame()
103
115
PVPFrameCurrency :Point (' TOP' , 0 , - 26 )
104
116
105
117
local PVPFrameCurrencyIcon = _G .PVPFrameCurrencyIcon
106
- PVPFrameCurrencyIcon :SetTexture (' Interface \\ Icons \\ PVPCurrency-Honor- ' .. E . myfaction )
118
+ PVPFrameCurrencyIcon :SetTexture (honorTexture )
107
119
PVPFrameCurrencyIcon .SetTexture = E .noop
108
120
PVPFrameCurrencyIcon :SetTexCoord (unpack (E .TexCoords ))
109
121
PVPFrameCurrencyIcon :SetInside (PVPFrameCurrency .backdrop )
@@ -113,28 +125,34 @@ function S:SkinPVPFrame()
113
125
end
114
126
115
127
-- Rewards
116
- for _ , frame in pairs ({' PVPHonorFrameInfoScrollFrameChildFrameRewardsInfoWinReward' , ' PVPHonorFrameInfoScrollFrameChildFrameRewardsInfoLossReward' , ' PVPConquestFrameWinReward' }) do
117
- local background = _G [frame ]:GetRegions ()
128
+ for _ , name in next , { ' PVPHonorFrameInfoScrollFrameChildFrameRewardsInfoWinReward' , ' PVPHonorFrameInfoScrollFrameChildFrameRewardsInfoLossReward' , ' PVPConquestFrameWinReward' } do
129
+ local frame = _G [name ]
130
+
131
+ local background = frame :GetRegions ()
118
132
background :SetTexture (E .Media .Textures .Highlight )
119
- if _G [ frame ] == PVPHonorFrameInfoScrollFrameChildFrameRewardsInfoWinReward or _G [ frame ] == PVPConquestFrameWinReward then
133
+ if frame == _G . PVPHonorFrameInfoScrollFrameChildFrameRewardsInfoWinReward or frame == _G . PVPConquestFrameWinReward then
120
134
background :SetVertexColor (0 , 0.439 , 0 , 0.5 )
121
135
else
122
136
background :SetVertexColor (0.5608 , 0 , 0 , 0.5 )
123
137
end
124
138
125
- if _G [ frame ] ~= PVPConquestFrameWinReward then
139
+ if frame ~= _G . PVPConquestFrameWinReward then
126
140
local honor = _G [frame .. ' HonorSymbol' ]
127
- honor :SetTexture (' Interface\\ Icons\\ PVPCurrency-Honor-' .. E .myfaction )
128
- honor .SetTexture = E .noop
129
- honor :SetTexCoord (unpack (E .TexCoords ))
130
- honor :Size (30 )
141
+ if honor then
142
+ honor :SetTexture (honorTexture )
143
+ honor .SetTexture = E .noop
144
+ honor :SetTexCoord (unpack (E .TexCoords ))
145
+ honor :Size (30 )
146
+ end
131
147
end
132
148
133
149
local conquest = _G [frame .. ' ArenaSymbol' ]
134
- conquest :SetTexture (' Interface\\ Icons\\ PVPCurrency-Conquest-' .. E .myfaction )
135
- conquest .SetTexture = E .noop
136
- conquest :SetTexCoord (unpack (E .TexCoords ))
137
- conquest :Size (30 )
150
+ if conquest then
151
+ conquest :SetTexture (conquestTexture )
152
+ conquest .SetTexture = E .noop
153
+ conquest :SetTexCoord (unpack (E .TexCoords ))
154
+ conquest :Size (30 )
155
+ end
138
156
end
139
157
140
158
-- War Games
@@ -159,6 +177,7 @@ function S:SkinPVPFrame()
159
177
PVPBannerFrameCustomization1 .backdrop :Point (' TOPLEFT' , _G .PVPBannerFrameCustomization1LeftButton , ' TOPRIGHT' , 2 , 0 )
160
178
PVPBannerFrameCustomization1 .backdrop :Point (' BOTTOMRIGHT' , _G .PVPBannerFrameCustomization1RightButton , ' BOTTOMLEFT' , - 2 , 0 )
161
179
180
+ local PVPBannerFrameCustomization2 = _G .PVPBannerFrameCustomization2
162
181
PVPBannerFrameCustomization2 :StripTextures ()
163
182
PVPBannerFrameCustomization2 :CreateBackdrop ()
164
183
PVPBannerFrameCustomization2 .backdrop :Point (' TOPLEFT' , _G .PVPBannerFrameCustomization2LeftButton , ' TOPRIGHT' , 2 , 0 )
0 commit comments