Skip to content

Commit 12a09ef

Browse files
committed
A bit dirty way to handle game menu buttons skins.
Not sure if setting a value in the button like .elvuiSkined will be better than keeping a table of those.
1 parent cb677aa commit 12a09ef

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

ElvUI/Mainline/Modules/Skins/Misc.lua

+10-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local S = E:GetModule('Skins')
44
local _G = _G
55
local next = next
66
local unpack = unpack
7+
local pairs = pairs
78

89
local UnitIsUnit = UnitIsUnit
910
local CreateFrame = CreateFrame
@@ -65,11 +66,16 @@ function S:BlizzardMiscFrames()
6566

6667
-- reskin all esc/menu buttons
6768
if not E:IsAddOnEnabled('ConsolePortUI_Menu') then
68-
for _, Button in next, { _G.GameMenuFrame:GetChildren() } do
69-
if Button.IsObjectType and Button:IsObjectType('Button') then
70-
S:HandleButton(Button)
69+
local skinnedButtons = {}
70+
hooksecurefunc(GameMenuFrame, 'InitButtons', function(self)
71+
local tableData = self.buttonPool.activeObjects
72+
for obj in pairs(tableData) do
73+
if not skinnedButtons[obj] then
74+
S:HandleButton(obj, nil, nil, nil, true)
75+
skinnedButtons[obj] = true
76+
end
7177
end
72-
end
78+
end)
7379

7480
_G.GameMenuFrame:StripTextures()
7581
_G.GameMenuFrame:SetTemplate('Transparent')

0 commit comments

Comments
 (0)