@@ -12,6 +12,39 @@ local GetItemQualityColor = GetItemQualityColor
12
12
local GetSendMailItem = GetSendMailItem
13
13
local hooksecurefunc = hooksecurefunc
14
14
15
+ local function MailFrameSkin ()
16
+ for i = 1 , _G .ATTACHMENTS_MAX_SEND do
17
+ local button = _G [' SendMailAttachment' .. i ]
18
+ if not button .template then
19
+ button :StripTextures ()
20
+ button :SetTemplate (nil , true )
21
+ button :StyleButton (nil , true )
22
+ end
23
+
24
+ local name = GetSendMailItem (i )
25
+ if name then
26
+ local _ , _ , quality = GetItemInfo (name )
27
+ if quality and quality > 1 then
28
+ local r , g , b = GetItemQualityColor (quality )
29
+ button :SetBackdropBorderColor (r , g , b )
30
+ else
31
+ button :SetBackdropBorderColor (unpack (E .media .bordercolor ))
32
+ end
33
+
34
+ local icon = button :GetNormalTexture ()
35
+ if icon then
36
+ icon :SetTexCoord (unpack (E .TexCoords ))
37
+ icon :SetInside ()
38
+ end
39
+ else
40
+ button :SetBackdropBorderColor (unpack (E .media .bordercolor ))
41
+ end
42
+ end
43
+
44
+ _G .MailEditBox :SetHeight (_G .SendStationeryBackgroundLeft :GetHeight ())
45
+ _G .MailEditBox .ScrollBox .EditBox :SetTextColor (1 , 1 , 1 )
46
+ end
47
+
15
48
function S :MailFrame ()
16
49
if not (E .private .skins .blizzard .enable and E .private .skins .blizzard .mail ) then return end
17
50
@@ -106,41 +139,10 @@ function S:MailFrame()
106
139
_G .SendStationeryBackgroundRight :Hide ()
107
140
_G .MailEditBox .ScrollBox :StripTextures (true )
108
141
_G .MailEditBox .ScrollBox :SetTemplate ()
109
- _G .MailEditBox .ScrollBox .EditBox :SetTextColor (1 , 1 , 1 )
110
142
111
143
_G .SendMailTitleText :Point (' CENTER' , _G .SendMailFrame , ' TOP' , - 10 , - 17 )
112
144
113
- hooksecurefunc (' SendMailFrame_Update' , function ()
114
- for i = 1 , _G .ATTACHMENTS_MAX_SEND do
115
- local button = _G [' SendMailAttachment' .. i ]
116
- if not button .template then
117
- button :StripTextures ()
118
- button :SetTemplate (nil , true )
119
- button :StyleButton (nil , true )
120
- end
121
-
122
- local name = GetSendMailItem (i )
123
- if name then
124
- local _ , _ , quality = GetItemInfo (name )
125
- if quality and quality > 1 then
126
- local r , g , b = GetItemQualityColor (quality )
127
- button :SetBackdropBorderColor (r , g , b )
128
- else
129
- button :SetBackdropBorderColor (unpack (E .media .bordercolor ))
130
- end
131
-
132
- local icon = button :GetNormalTexture ()
133
- if icon then
134
- icon :SetTexCoord (unpack (E .TexCoords ))
135
- icon :SetInside ()
136
- end
137
- else
138
- button :SetBackdropBorderColor (unpack (E .media .bordercolor ))
139
- end
140
- end
141
-
142
- _G .MailEditBox :SetHeight (_G .SendStationeryBackgroundLeft :GetHeight ())
143
- end )
145
+ hooksecurefunc (' SendMailFrame_Update' , MailFrameSkin )
144
146
145
147
S :HandleScrollBar (_G .MailEditBoxScrollBar )
146
148
S :HandleEditBox (_G .SendMailNameEditBox )
@@ -173,7 +175,7 @@ function S:MailFrame()
173
175
174
176
-- Open Mail Frame
175
177
local OpenMailFrame = _G .OpenMailFrame
176
- OpenMailFrame :StripTextures (true ) -- stupid portrait
178
+ OpenMailFrame :StripTextures (true )
177
179
S :HandleFrame (OpenMailFrame , true )
178
180
OpenMailFrame .backdrop :Point (' TOPLEFT' , - 5 , 0 )
179
181
OpenMailFrame .backdrop :Point (' BOTTOMRIGHT' , - 2 , 0 )
0 commit comments