mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-24 13:00:50 +00:00
game_menu: skin every menu button dynamically
Scan GameMenuFrame's children on load and on each show instead of a hardcoded list, so buttons added by other addons (ClassicAPI AddOn Options, MoveAnything, MCP, SuperMacro, HardcoreDeath, Turtle shop) get skinned without per-addon calls.
This commit is contained in:
@@ -19,24 +19,20 @@ pfUI:RegisterSkin("Game Menu", function ()
|
||||
pfUI.gui:Show()
|
||||
HideUIPanel(GameMenuFrame)
|
||||
end)
|
||||
SkinButton(pfUIButton)
|
||||
|
||||
local point, relativeTo, relativePoint, xOffset, yOffset = GameMenuButtonOptions:GetPoint()
|
||||
GameMenuButtonOptions:SetPoint(point, relativeTo, relativePoint, xOffset, yOffset - 22)
|
||||
|
||||
local buttons = {
|
||||
GameMenuButtonOptions,
|
||||
GameMenuButtonSoundOptions,
|
||||
GameMenuButtonUIOptions,
|
||||
GameMenuButtonKeybindings,
|
||||
GameMenuButtonMacros,
|
||||
GameMenuButtonRatings,
|
||||
GameMenuButtonLogout,
|
||||
GameMenuButtonQuit,
|
||||
GameMenuButtonContinue,
|
||||
}
|
||||
|
||||
for _, button in pairs(buttons) do
|
||||
if button then SkinButton(button) end
|
||||
-- skin every button on the menu, including ones other addons add later
|
||||
local function SkinMenuButtons()
|
||||
for _, child in pairs({GameMenuFrame:GetChildren()}) do
|
||||
if child:GetFrameType() == "Button" and not child._pfMenuSkinned then
|
||||
SkinButton(child)
|
||||
child._pfMenuSkinned = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
SkinMenuButtons()
|
||||
GameMenuFrame:HookScript("OnShow", SkinMenuButtons)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user