From 1600ec333b404c2a327274b9e9530c0645fb9b43 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Thu, 22 Oct 2026 18:41:47 -0500 Subject: [PATCH] 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. --- modules/addons.lua | 1 - modules/thirdparty-vanilla.lua | 12 ------------ modules/turtle-wow.lua | 6 ++---- skins/blizzard/game_menu.lua | 26 +++++++++++--------------- 4 files changed, 13 insertions(+), 32 deletions(-) diff --git a/modules/addons.lua b/modules/addons.lua index 2ee4f967..28eb82ee 100644 --- a/modules/addons.lua +++ b/modules/addons.lua @@ -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) diff --git a/modules/thirdparty-vanilla.lua b/modules/thirdparty-vanilla.lua index 95e6de00..da1c195e 100644 --- a/modules/thirdparty-vanilla.lua +++ b/modules/thirdparty-vanilla.lua @@ -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) diff --git a/modules/turtle-wow.lua b/modules/turtle-wow.lua index 7024de4c..e2b1dded 100644 --- a/modules/turtle-wow.lua +++ b/modules/turtle-wow.lua @@ -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 diff --git a/skins/blizzard/game_menu.lua b/skins/blizzard/game_menu.lua index 4f1f6b79..e9f030bd 100644 --- a/skins/blizzard/game_menu.lua +++ b/skins/blizzard/game_menu.lua @@ -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)