Skip to content

Commit 39a47a9

Browse files
committed
test 2
1 parent ebdfbbf commit 39a47a9

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

Diff for: ElvUI/Cata/Modules/Skins/Collectables.lua

+12-5
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,21 @@ local function JournalScrollButtons(frame)
119119
for _, bu in next, { frame.ScrollTarget:GetChildren() } do
120120
if not bu.IsSkinned then
121121
local icon = bu.icon or bu.Icon
122-
local texture = icon:GetTexture()
122+
local savedIconTexture = icon:GetTexture()
123123
icon:Size(40)
124124
icon:Point('LEFT', -43, 0)
125125
icon:SetTexCoord(unpack(E.TexCoords))
126126
icon:CreateBackdrop('Transparent', nil, nil, true)
127127

128+
local savedPetTypeIcon = bu.petTypeIcon and bu.petTypeIcon:GetTexture()
129+
local savedFactionIcon = bu.factionIcon and bu.factionIcon:GetTexture()
130+
128131
bu:StripTextures()
129132
bu:CreateBackdrop('Transparent', nil, nil, true)
130133
bu.backdrop:ClearAllPoints()
131134
bu.backdrop:Point('TOPLEFT', bu, 0, -2)
132135
bu.backdrop:Point('BOTTOMRIGHT', bu, 0, 2)
133-
icon:SetTexture(texture) -- restore the texture
136+
icon:SetTexture(savedIconTexture) -- restore the texture
134137

135138
bu:HookScript('OnEnter', buttonOnEnter)
136139
bu:HookScript('OnLeave', buttonOnLeave)
@@ -140,7 +143,8 @@ local function JournalScrollButtons(frame)
140143
bu.ProgressBar:SetVertexColor(0.251, 0.753, 0.251, 1) -- 0.0118, 0.247, 0.00392
141144
end
142145

143-
if frame:GetParent() == _G.WardrobeCollectionFrame.SetsCollectionFrame then
146+
local parent = frame:GetParent()
147+
if parent == _G.WardrobeCollectionFrame.SetsCollectionFrame then
144148
bu.Favorite:SetAtlas('PetJournal-FavoritesIcon', true)
145149
bu.Favorite:Point('TOPLEFT', bu.Icon, 'TOPLEFT', -8, 8)
146150

@@ -150,17 +154,20 @@ local function JournalScrollButtons(frame)
150154
hooksecurefunc(bu.selectedTexture, 'Show', selectedTextureShow)
151155
hooksecurefunc(bu.selectedTexture, 'Hide', selectedTextureHide)
152156

153-
if frame:GetParent() == _G.PetJournal then
157+
if parent == _G.PetJournal then
154158
bu.petList = true
159+
bu.petTypeIcon:SetTexture(savedPetTypeIcon)
155160
bu.petTypeIcon:Point('TOPRIGHT', -1, -1)
156161
bu.petTypeIcon:Point('BOTTOMRIGHT', -1, 1)
157162

158163
bu.dragButton.ActiveTexture:SetTexture(E.Media.Textures.White8x8)
159164
bu.dragButton.ActiveTexture:SetVertexColor(0.9, 0.8, 0.1, 0.3)
165+
bu.dragButton.levelBG:SetTexture()
160166

161167
S:HandleIconBorder(bu.iconBorder, nil, petNameColor)
162-
elseif frame:GetParent() == _G.MountJournal then
168+
elseif parent == _G.MountJournal then
163169
bu.mountList = true
170+
bu.factionIcon:SetTexture(savedFactionIcon)
164171
bu.factionIcon:SetDrawLayer('OVERLAY')
165172
bu.factionIcon:Point('TOPRIGHT', -1, -1)
166173
bu.factionIcon:Point('BOTTOMRIGHT', -1, 1)

Diff for: ElvUI/Mainline/Modules/Skins/Collectables.lua

+11-5
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,21 @@ local function JournalScrollButtons(frame)
121121
for _, bu in next, { frame.ScrollTarget:GetChildren() } do
122122
if not bu.IsSkinned then
123123
local icon = bu.icon or bu.Icon
124-
local texture = icon:GetTexture()
124+
local savedIconTexture = icon:GetTexture()
125125
icon:Size(40)
126126
icon:Point('LEFT', -43, 0)
127127
icon:SetTexCoord(unpack(E.TexCoords))
128128
icon:CreateBackdrop('Transparent', nil, nil, true)
129129

130+
local savedPetTypeIcon = bu.petTypeIcon and bu.petTypeIcon:GetTexture()
131+
local savedFactionIcon = bu.factionIcon and bu.factionIcon:GetTexture()
132+
130133
bu:StripTextures()
131134
bu:CreateBackdrop('Transparent', nil, nil, true)
132135
bu.backdrop:ClearAllPoints()
133136
bu.backdrop:Point('TOPLEFT', bu, 0, -2)
134137
bu.backdrop:Point('BOTTOMRIGHT', bu, 0, 2)
135-
icon:SetTexture(texture) -- restore the texture
138+
icon:SetTexture(savedIconTexture) -- restore the texture
136139

137140
bu:HookScript('OnEnter', buttonOnEnter)
138141
bu:HookScript('OnLeave', buttonOnLeave)
@@ -142,7 +145,8 @@ local function JournalScrollButtons(frame)
142145
bu.ProgressBar:SetVertexColor(0.251, 0.753, 0.251, 1) -- 0.0118, 0.247, 0.00392
143146
end
144147

145-
if frame:GetParent() == _G.WardrobeCollectionFrame.SetsCollectionFrame then
148+
local parent = frame:GetParent()
149+
if parent == _G.WardrobeCollectionFrame.SetsCollectionFrame then
146150
bu.Favorite:SetAtlas('PetJournal-FavoritesIcon', true)
147151
bu.Favorite:Point('TOPLEFT', bu.Icon, 'TOPLEFT', -8, 8)
148152

@@ -152,8 +156,9 @@ local function JournalScrollButtons(frame)
152156
hooksecurefunc(bu.selectedTexture, 'Show', selectedTextureShow)
153157
hooksecurefunc(bu.selectedTexture, 'Hide', selectedTextureHide)
154158

155-
if frame:GetParent() == _G.PetJournal then
159+
if parent == _G.PetJournal then
156160
bu.petList = true
161+
bu.petTypeIcon:SetTexture(savedPetTypeIcon)
157162
bu.petTypeIcon:Point('TOPRIGHT', -1, -1)
158163
bu.petTypeIcon:Point('BOTTOMRIGHT', -1, 1)
159164

@@ -162,8 +167,9 @@ local function JournalScrollButtons(frame)
162167
bu.dragButton.levelBG:SetTexture()
163168

164169
S:HandleIconBorder(bu.iconBorder, nil, petNameColor)
165-
elseif frame:GetParent() == _G.MountJournal then
170+
elseif parent == _G.MountJournal then
166171
bu.mountList = true
172+
bu.factionIcon:SetTexture(savedFactionIcon)
167173
bu.factionIcon:SetDrawLayer('OVERLAY')
168174
bu.factionIcon:Point('TOPRIGHT', -1, -1)
169175
bu.factionIcon:Point('BOTTOMRIGHT', -1, 1)

0 commit comments

Comments
 (0)