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
-1
View File
@@ -9,7 +9,6 @@ pfUI:RegisterModule("addons", function ()
pfUI.addons:Show()
HideUIPanel(GameMenuFrame)
end)
SkinButton(pfUIAddonButton)
local point, relativeTo, relativePoint, xOffset, yOffset = GameMenuButtonOptions:GetPoint()
GameMenuButtonOptions:SetPoint(point, relativeTo, relativePoint, xOffset, yOffset - 22)
-12
View File
@@ -866,9 +866,6 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
if C.thirdparty.supermacro.enable == "0" then return end
if not pfUI.bars then return end
-- skin game menu button
SkinButton(GameMenuButtonSuperMacro)
-- hook events to include SuperMacro refreshs
local ButtonFullUpdate = pfUI.bars.ButtonFullUpdate
pfUI.bars.ButtonFullUpdate = function(button)
@@ -1197,16 +1194,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
HookAddonOrVariable("LunaUnitFrames", EnableHealComm)
HookAddonOrVariable("NotGrid", EnableHealComm)
HookAddonOrVariable("MoveAnything", function()
SkinButton(GameMenuButtonMoveAnything)
end)
HookAddonOrVariable("MCP", function()
SkinButton(GameMenuButtonAddOns)
end)
HookAddonOrVariable("HardcoreDeath", function()
SkinButton(GameMenuButtonHardcoreDeathLogGUI)
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 20)
end)
+2 -4
View File
@@ -98,11 +98,9 @@ pfUI:RegisterModule("turtle-wow", function ()
GameMenuButtonOptions:ClearAllPoints()
GameMenuButtonOptions:SetPoint("TOP", GameMenuButtonShop, "BOTTOM", 0, -16)
-- apply pfUI skin to the new shop button
-- match the shop button's text to the other skinned menu buttons
if pfUI.skin["Game Menu"] and pfUI_config["disabled"]["skin_Game Menu"] ~= "1" then
local font = GameMenuButtonShop:GetFontString()
font:SetTextColor(1,1,1,1)
SkinButton(GameMenuButtonShop)
GameMenuButtonShop:GetFontString():SetTextColor(1,1,1,1)
end
end
+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)