@@ -183,6 +183,69 @@ local function JournalScrollButtons(frame)
183
183
end
184
184
end
185
185
186
+ local function ToySpellButtonUpdateButton (button )
187
+ if button .itemID and PlayerHasToy (button .itemID ) then
188
+ local _ , _ , quality = GetItemInfo (button .itemID )
189
+ if quality then
190
+ local r , g , b = GetItemQualityColor (quality )
191
+ button .backdrop :SetBackdropBorderColor (r , g , b )
192
+ else
193
+ button .backdrop :SetBackdropBorderColor (0.9 , 0.9 , 0.9 )
194
+ end
195
+ else
196
+ local r , g , b = unpack (E .media .bordercolor )
197
+ button .backdrop :SetBackdropBorderColor (r , g , b )
198
+ end
199
+ end
200
+
201
+ local function HeirloomsJournalUpdateButton (_ , button )
202
+ if not button .IsSkinned then
203
+ S :HandleItemButton (button , true )
204
+
205
+ button .iconTextureUncollected :SetTexCoord (unpack (E .TexCoords ))
206
+ button .iconTextureUncollected :SetInside (button )
207
+ button .iconTexture :SetDrawLayer (' ARTWORK' )
208
+ button .hover :SetAllPoints (button .iconTexture )
209
+ button .slotFrameCollected :SetAlpha (0 )
210
+ button .slotFrameUncollected :SetAlpha (0 )
211
+ button .special :SetJustifyH (' RIGHT' )
212
+ button .special :ClearAllPoints ()
213
+
214
+ button .cooldown :SetAllPoints (button .iconTexture )
215
+ E :RegisterCooldown (button .cooldown )
216
+
217
+ button .IsSkinned = true
218
+ end
219
+
220
+ button .levelBackground :SetTexture ()
221
+
222
+ button .name :Point (' LEFT' , button , ' RIGHT' , 4 , 8 )
223
+ button .level :Point (' TOPLEFT' , button .levelBackground ,' TOPLEFT' , 25 , 2 )
224
+
225
+ if C_Heirloom_PlayerHasHeirloom (button .itemID ) then
226
+ button .name :SetTextColor (0.9 , 0.9 , 0.9 )
227
+ button .level :SetTextColor (0.9 , 0.9 , 0.9 )
228
+ button .special :SetTextColor (1 , .82 , 0 )
229
+ button .backdrop :SetBackdropBorderColor (QUALITY_7_R , QUALITY_7_G , QUALITY_7_B )
230
+ else
231
+ button .name :SetTextColor (0.4 , 0.4 , 0.4 )
232
+ button .level :SetTextColor (0.4 , 0.4 , 0.4 )
233
+ button .special :SetTextColor (0.4 , 0.4 , 0.4 )
234
+ button .backdrop :SetBackdropBorderColor (unpack (E .media .bordercolor ))
235
+ end
236
+ end
237
+
238
+ local function HeirloomsJournalLayoutCurrentPage ()
239
+ local headers = _G .HeirloomsJournal .heirloomHeaderFrames
240
+ if headers and next (headers ) then
241
+ for _ , header in next , headers do
242
+ header :StripTextures ()
243
+ header .text :FontTemplate (nil , 15 , ' SHADOW' )
244
+ header .text :SetTextColor (0.9 , 0.9 , 0.9 )
245
+ end
246
+ end
247
+ end
248
+
186
249
local function SkinMountFrame ()
187
250
S :HandleItemButton (_G .MountJournalSummonRandomFavoriteButton )
188
251
S :HandleButton (_G .MountJournalFilterButton )
@@ -375,19 +438,7 @@ local function SkinToyFrame()
375
438
E :RegisterCooldown (button .cooldown )
376
439
end
377
440
378
- hooksecurefunc (' ToySpellButton_UpdateButton' , function (button )
379
- if button .itemID and PlayerHasToy (button .itemID ) then
380
- local _ , _ , quality = GetItemInfo (button .itemID )
381
- if quality then
382
- local r , g , b = GetItemQualityColor (quality )
383
- button .backdrop :SetBackdropBorderColor (r , g , b )
384
- else
385
- button .backdrop :SetBackdropBorderColor (0.9 , 0.9 , 0.9 )
386
- end
387
- else
388
- button .backdrop :SetBackdropBorderColor (unpack (E .media .bordercolor ))
389
- end
390
- end )
441
+ hooksecurefunc (' ToySpellButton_UpdateButton' , ToySpellButtonUpdateButton )
391
442
end
392
443
393
444
local function SkinHeirloomFrame ()
@@ -410,51 +461,8 @@ local function SkinHeirloomFrame()
410
461
HeirloomsJournal .progressBar :CreateBackdrop ()
411
462
E :RegisterStatusBar (HeirloomsJournal .progressBar )
412
463
413
- hooksecurefunc (HeirloomsJournal , ' UpdateButton' , function (_ , button )
414
- if not button .IsSkinned then
415
- S :HandleItemButton (button , true )
416
-
417
- button .iconTextureUncollected :SetTexCoord (unpack (E .TexCoords ))
418
- button .iconTextureUncollected :SetInside (button )
419
- button .iconTexture :SetDrawLayer (' ARTWORK' )
420
- button .hover :SetAllPoints (button .iconTexture )
421
- button .slotFrameCollected :SetAlpha (0 )
422
- button .slotFrameUncollected :SetAlpha (0 )
423
- button .special :SetJustifyH (' RIGHT' )
424
- button .special :ClearAllPoints ()
425
-
426
- button .cooldown :SetAllPoints (button .iconTexture )
427
- E :RegisterCooldown (button .cooldown )
428
-
429
- button .IsSkinned = true
430
- end
431
-
432
- button .levelBackground :SetTexture ()
433
-
434
- button .name :Point (' LEFT' , button , ' RIGHT' , 4 , 8 )
435
- button .level :Point (' TOPLEFT' , button .levelBackground ,' TOPLEFT' , 25 , 2 )
436
-
437
- if C_Heirloom_PlayerHasHeirloom (button .itemID ) then
438
- button .name :SetTextColor (0.9 , 0.9 , 0.9 )
439
- button .level :SetTextColor (0.9 , 0.9 , 0.9 )
440
- button .special :SetTextColor (1 , .82 , 0 )
441
- button .backdrop :SetBackdropBorderColor (QUALITY_7_R , QUALITY_7_G , QUALITY_7_B )
442
- else
443
- button .name :SetTextColor (0.4 , 0.4 , 0.4 )
444
- button .level :SetTextColor (0.4 , 0.4 , 0.4 )
445
- button .special :SetTextColor (0.4 , 0.4 , 0.4 )
446
- button .backdrop :SetBackdropBorderColor (unpack (E .media .bordercolor ))
447
- end
448
- end )
449
-
450
- hooksecurefunc (HeirloomsJournal , ' LayoutCurrentPage' , function ()
451
- for i = 1 , # HeirloomsJournal .heirloomHeaderFrames do
452
- local header = HeirloomsJournal .heirloomHeaderFrames [i ]
453
- header :StripTextures ()
454
- header .text :FontTemplate (nil , 15 , ' SHADOW' )
455
- header .text :SetTextColor (0.9 , 0.9 , 0.9 )
456
- end
457
- end )
464
+ hooksecurefunc (HeirloomsJournal , ' UpdateButton' , HeirloomsJournalUpdateButton )
465
+ hooksecurefunc (HeirloomsJournal , ' LayoutCurrentPage' , HeirloomsJournalLayoutCurrentPage )
458
466
end
459
467
460
468
local function SkinTransmogFrames ()
0 commit comments