Gate the macro icon hook behind a config flag

Run the Blizzard_MacroUI hook only when C.disabled["macroicons"] is
"1".
This commit is contained in:
Brues
2026-08-05 21:43:51 -05:00
parent 76927c2c18
commit 0cc9cf4165
+17 -16
View File
@@ -355,24 +355,25 @@ pfUI:RegisterModule("turtle-wow", function ()
end end
end) end)
HookAddonOrVariable("Blizzard_MacroUI", function() if C.disabled["macroicons"] == "1" then
if type(UpdateMacroIconFilenames) ~= "function" then return end HookAddonOrVariable("Blizzard_MacroUI", function()
function _G.UpdateMacroIconFilenames() if type(UpdateMacroIconFilenames) ~= "function" then return end
wipe(MACRO_ICON_FILENAMES) function _G.UpdateMacroIconFilenames()
local provider = CreateAndInitFromMixin(IconDataProviderMixin, IconDataProviderExtraType.Spellbook) wipe(MACRO_ICON_FILENAMES)
local seen = {} local provider = CreateAndInitFromMixin(IconDataProviderMixin, IconDataProviderExtraType.Spellbook)
for i = 1, provider:GetNumIcons() do local seen = {}
-- uppercase, prefix-stripped basename, matching Blizzard's original for i = 1, provider:GetNumIcons() do
local icon = string.gsub(string.upper(provider:GetIconByIndex(i)), "INTERFACE\\ICONS\\", "") -- uppercase, prefix-stripped basename, matching Blizzard's original
if not seen[icon] then local icon = string.gsub(string.upper(provider:GetIconByIndex(i)), "INTERFACE\\ICONS\\", "")
seen[icon] = true if not seen[icon] then
table.insert(MACRO_ICON_FILENAMES, icon) seen[icon] = true
table.insert(MACRO_ICON_FILENAMES, icon)
end
end end
provider:Release()
end end
provider:Release() end)
end end
end)
-- add turtle-wow sell values -- add turtle-wow sell values
pfSellData = { pfSellData = {