Skip to content

Commit

Permalink
A bit dirty way to handle game menu buttons skins.
Browse files Browse the repository at this point in the history
Not sure if setting a value in the button like .elvuiSkined will be better than keeping a table of those.
  • Loading branch information
DarthPredator committed Apr 23, 2024
1 parent cb677aa commit 12a09ef
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ElvUI/Mainline/Modules/Skins/Misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local S = E:GetModule('Skins')
local _G = _G
local next = next
local unpack = unpack
local pairs = pairs

local UnitIsUnit = UnitIsUnit
local CreateFrame = CreateFrame
Expand Down Expand Up @@ -65,11 +66,16 @@ function S:BlizzardMiscFrames()

-- reskin all esc/menu buttons
if not E:IsAddOnEnabled('ConsolePortUI_Menu') then
for _, Button in next, { _G.GameMenuFrame:GetChildren() } do
if Button.IsObjectType and Button:IsObjectType('Button') then
S:HandleButton(Button)
local skinnedButtons = {}
hooksecurefunc(GameMenuFrame, 'InitButtons', function(self)
local tableData = self.buttonPool.activeObjects
for obj in pairs(tableData) do
if not skinnedButtons[obj] then
S:HandleButton(obj, nil, nil, nil, true)
skinnedButtons[obj] = true
end
end
end
end)

_G.GameMenuFrame:StripTextures()
_G.GameMenuFrame:SetTemplate('Transparent')
Expand Down

0 comments on commit 12a09ef

Please sign in to comment.