@@ -120,18 +120,23 @@ local function JournalScrollButtons(frame)
120120
121121 for _ , bu in next , { frame .ScrollTarget :GetChildren () } do
122122 if not bu .IsSkinned then
123- bu :StripTextures ()
124- bu :CreateBackdrop (' Transparent' , nil , nil , true )
125- bu .backdrop :ClearAllPoints ()
126- bu .backdrop :Point (' TOPLEFT' , bu , 0 , - 2 )
127- bu .backdrop :Point (' BOTTOMRIGHT' , bu , 0 , 2 )
128-
129123 local icon = bu .icon or bu .Icon
124+ local savedIconTexture = icon :GetTexture ()
130125 icon :Size (40 )
131126 icon :Point (' LEFT' , - 43 , 0 )
132127 icon :SetTexCoord (unpack (E .TexCoords ))
133128 icon :CreateBackdrop (' Transparent' , nil , nil , true )
134129
130+ local savedPetTypeTexture = bu .petTypeIcon and bu .petTypeIcon :GetTexture ()
131+ local savedFactionAtlas = bu .factionIcon and bu .factionIcon :GetAtlas ()
132+
133+ bu :StripTextures ()
134+ bu :CreateBackdrop (' Transparent' , nil , nil , true )
135+ bu .backdrop :ClearAllPoints ()
136+ bu .backdrop :Point (' TOPLEFT' , bu , 0 , - 2 )
137+ bu .backdrop :Point (' BOTTOMRIGHT' , bu , 0 , 2 )
138+ icon :SetTexture (savedIconTexture ) -- restore the texture
139+
135140 bu :HookScript (' OnEnter' , buttonOnEnter )
136141 bu :HookScript (' OnLeave' , buttonOnLeave )
137142
@@ -140,7 +145,8 @@ local function JournalScrollButtons(frame)
140145 bu .ProgressBar :SetVertexColor (0.251 , 0.753 , 0.251 , 1 ) -- 0.0118, 0.247, 0.00392
141146 end
142147
143- if frame :GetParent () == _G .WardrobeCollectionFrame .SetsCollectionFrame then
148+ local parent = frame :GetParent ()
149+ if parent == _G .WardrobeCollectionFrame .SetsCollectionFrame then
144150 bu .Favorite :SetAtlas (' PetJournal-FavoritesIcon' , true )
145151 bu .Favorite :Point (' TOPLEFT' , bu .Icon , ' TOPLEFT' , - 8 , 8 )
146152
@@ -150,8 +156,9 @@ local function JournalScrollButtons(frame)
150156 hooksecurefunc (bu .selectedTexture , ' Show' , selectedTextureShow )
151157 hooksecurefunc (bu .selectedTexture , ' Hide' , selectedTextureHide )
152158
153- if frame : GetParent () == _G .PetJournal then
159+ if parent == _G .PetJournal then
154160 bu .petList = true
161+ bu .petTypeIcon :SetTexture (savedPetTypeTexture )
155162 bu .petTypeIcon :Point (' TOPRIGHT' , - 1 , - 1 )
156163 bu .petTypeIcon :Point (' BOTTOMRIGHT' , - 1 , 1 )
157164
@@ -160,8 +167,9 @@ local function JournalScrollButtons(frame)
160167 bu .dragButton .levelBG :SetTexture ()
161168
162169 S :HandleIconBorder (bu .iconBorder , nil , petNameColor )
163- elseif frame : GetParent () == _G .MountJournal then
170+ elseif parent == _G .MountJournal then
164171 bu .mountList = true
172+ bu .factionIcon :SetAtlas (savedFactionAtlas )
165173 bu .factionIcon :SetDrawLayer (' OVERLAY' )
166174 bu .factionIcon :Point (' TOPRIGHT' , - 1 , - 1 )
167175 bu .factionIcon :Point (' BOTTOMRIGHT' , - 1 , 1 )
@@ -183,6 +191,108 @@ local function JournalScrollButtons(frame)
183191 end
184192end
185193
194+ local function ToySpellButtonUpdateButton (button )
195+ if button .itemID and PlayerHasToy (button .itemID ) then
196+ local _ , _ , quality = GetItemInfo (button .itemID )
197+ if quality then
198+ local r , g , b = GetItemQualityColor (quality )
199+ button .backdrop :SetBackdropBorderColor (r , g , b )
200+ else
201+ button .backdrop :SetBackdropBorderColor (0.9 , 0.9 , 0.9 )
202+ end
203+ else
204+ local r , g , b = unpack (E .media .bordercolor )
205+ button .backdrop :SetBackdropBorderColor (r , g , b )
206+ end
207+ end
208+
209+ local function HeirloomsJournalUpdateButton (_ , button )
210+ if not button .IsSkinned then
211+ S :HandleItemButton (button , true )
212+
213+ button .iconTextureUncollected :SetTexCoord (unpack (E .TexCoords ))
214+ button .iconTextureUncollected :SetInside (button )
215+ button .iconTexture :SetDrawLayer (' ARTWORK' )
216+ button .hover :SetAllPoints (button .iconTexture )
217+ button .slotFrameCollected :SetAlpha (0 )
218+ button .slotFrameUncollected :SetAlpha (0 )
219+ button .special :SetJustifyH (' RIGHT' )
220+ button .special :ClearAllPoints ()
221+
222+ button .cooldown :SetAllPoints (button .iconTexture )
223+ E :RegisterCooldown (button .cooldown )
224+
225+ button .IsSkinned = true
226+ end
227+
228+ button .levelBackground :SetTexture ()
229+
230+ button .name :Point (' LEFT' , button , ' RIGHT' , 4 , 8 )
231+ button .level :Point (' TOPLEFT' , button .levelBackground ,' TOPLEFT' , 25 , 2 )
232+
233+ if C_Heirloom_PlayerHasHeirloom (button .itemID ) then
234+ button .name :SetTextColor (0.9 , 0.9 , 0.9 )
235+ button .level :SetTextColor (0.9 , 0.9 , 0.9 )
236+ button .special :SetTextColor (1 , .82 , 0 )
237+ button .backdrop :SetBackdropBorderColor (QUALITY_7_R , QUALITY_7_G , QUALITY_7_B )
238+ else
239+ button .name :SetTextColor (0.4 , 0.4 , 0.4 )
240+ button .level :SetTextColor (0.4 , 0.4 , 0.4 )
241+ button .special :SetTextColor (0.4 , 0.4 , 0.4 )
242+ button .backdrop :SetBackdropBorderColor (unpack (E .media .bordercolor ))
243+ end
244+ end
245+
246+ local function HeirloomsJournalLayoutCurrentPage ()
247+ local headers = _G .HeirloomsJournal .heirloomHeaderFrames
248+ if headers and next (headers ) then
249+ for _ , header in next , headers do
250+ header :StripTextures ()
251+ header .text :FontTemplate (nil , 15 , ' SHADOW' )
252+ header .text :SetTextColor (0.9 , 0.9 , 0.9 )
253+ end
254+ end
255+ end
256+
257+ local function SetsFrame_ScrollBoxUpdate (button )
258+ for _ , child in next , { button .ScrollTarget :GetChildren () } do
259+ if not child .IsSkinned then
260+ child .Background :Hide ()
261+ child .HighlightTexture :SetTexture (E .ClearTexture )
262+ child .Icon :SetSize (42 , 42 )
263+ S :HandleIcon (child .Icon )
264+ child .IconCover :SetOutside (child .Icon )
265+
266+ child .SelectedTexture :SetDrawLayer (' BACKGROUND' )
267+ child .SelectedTexture :SetColorTexture (1 , 1 , 1 , .25 )
268+ child .SelectedTexture :ClearAllPoints ()
269+ child .SelectedTexture :Point (' TOPLEFT' , 4 , - 2 )
270+ child .SelectedTexture :Point (' BOTTOMRIGHT' , - 1 , 2 )
271+ child .SelectedTexture :CreateBackdrop (' Transparent' )
272+
273+ child .IsSkinned = true
274+ end
275+ end
276+ end
277+
278+ local function SetsFrame_SetItemFrameQuality (_ , itemFrame )
279+ local icon = itemFrame .Icon
280+ if not icon .backdrop then
281+ icon :CreateBackdrop ()
282+ icon :SetTexCoord (unpack (E .TexCoords ))
283+ itemFrame .IconBorder :Hide ()
284+ end
285+
286+ if itemFrame .collected then
287+ local quality = C_TransmogCollection_GetSourceInfo (itemFrame .sourceID ).quality
288+ local color = BAG_ITEM_QUALITY_COLORS [quality or 1 ]
289+ icon .backdrop :SetBackdropBorderColor (color .r , color .g , color .b )
290+ else
291+ local r , g , b = unpack (E .media .bordercolor )
292+ icon .backdrop :SetBackdropBorderColor (r , g , b )
293+ end
294+ end
295+
186296local function SkinMountFrame ()
187297 S :HandleItemButton (_G .MountJournalSummonRandomFavoriteButton )
188298 S :HandleButton (_G .MountJournalFilterButton )
@@ -375,19 +485,7 @@ local function SkinToyFrame()
375485 E :RegisterCooldown (button .cooldown )
376486 end
377487
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 )
488+ hooksecurefunc (' ToySpellButton_UpdateButton' , ToySpellButtonUpdateButton )
391489end
392490
393491local function SkinHeirloomFrame ()
@@ -410,51 +508,8 @@ local function SkinHeirloomFrame()
410508 HeirloomsJournal .progressBar :CreateBackdrop ()
411509 E :RegisterStatusBar (HeirloomsJournal .progressBar )
412510
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 )
511+ hooksecurefunc (HeirloomsJournal , ' UpdateButton' , HeirloomsJournalUpdateButton )
512+ hooksecurefunc (HeirloomsJournal , ' LayoutCurrentPage' , HeirloomsJournalLayoutCurrentPage )
458513end
459514
460515local function SkinTransmogFrames ()
@@ -559,26 +614,7 @@ local function SkinTransmogFrames()
559614 SetsCollectionFrame .LeftInset :StripTextures ()
560615 S :HandleTrimScrollBar (SetsCollectionFrame .ListContainer .ScrollBar )
561616
562- hooksecurefunc (SetsCollectionFrame .ListContainer .ScrollBox , ' Update' , function (button )
563- for _ , child in next , { button .ScrollTarget :GetChildren () } do
564- if not child .IsSkinned then
565- child .Background :Hide ()
566- child .HighlightTexture :SetTexture (E .ClearTexture )
567- child .Icon :SetSize (42 , 42 )
568- S :HandleIcon (child .Icon )
569- child .IconCover :SetOutside (child .Icon )
570-
571- child .SelectedTexture :SetDrawLayer (' BACKGROUND' )
572- child .SelectedTexture :SetColorTexture (1 , 1 , 1 , .25 )
573- child .SelectedTexture :ClearAllPoints ()
574- child .SelectedTexture :Point (' TOPLEFT' , 4 , - 2 )
575- child .SelectedTexture :Point (' BOTTOMRIGHT' , - 1 , 2 )
576- child .SelectedTexture :CreateBackdrop (' Transparent' )
577-
578- child .IsSkinned = true
579- end
580- end
581- end )
617+ hooksecurefunc (SetsCollectionFrame .ListContainer .ScrollBox , ' Update' , SetsFrame_ScrollBoxUpdate )
582618
583619 local DetailsFrame = SetsCollectionFrame .DetailsFrame
584620 DetailsFrame .ModelFadeTexture :Hide ()
@@ -587,22 +623,7 @@ local function SkinTransmogFrames()
587623 DetailsFrame .LongName :FontTemplate (nil , 16 )
588624 S :HandleButton (DetailsFrame .VariantSetsButton )
589625
590- hooksecurefunc (SetsCollectionFrame , ' SetItemFrameQuality' , function (_ , itemFrame )
591- local icon = itemFrame .Icon
592- if not icon .backdrop then
593- icon :CreateBackdrop ()
594- icon :SetTexCoord (unpack (E .TexCoords ))
595- itemFrame .IconBorder :Hide ()
596- end
597-
598- if itemFrame .collected then
599- local quality = C_TransmogCollection_GetSourceInfo (itemFrame .sourceID ).quality
600- local color = BAG_ITEM_QUALITY_COLORS [quality or 1 ]
601- icon .backdrop :SetBackdropBorderColor (color .r , color .g , color .b )
602- else
603- icon .backdrop :SetBackdropBorderColor (unpack (E .media .bordercolor ))
604- end
605- end )
626+ hooksecurefunc (SetsCollectionFrame , ' SetItemFrameQuality' , SetsFrame_SetItemFrameQuality )
606627
607628 _G .WardrobeSetsCollectionVariantSetsButton .Icon :SetTexture (E .Media .Textures .ArrowUp )
608629 _G .WardrobeSetsCollectionVariantSetsButton .Icon :SetRotation (S .ArrowRotation .down )
0 commit comments