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:
Brues
2026-10-22 18:41:47 -05:00
parent 471c5713c5
commit 1600ec333b
4 changed files with 13 additions and 32 deletions
+11 -15
View File
@@ -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)