mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 12:10:01 +00:00
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:
+17
-16
@@ -355,24 +355,25 @@ pfUI:RegisterModule("turtle-wow", function ()
|
||||
end
|
||||
end)
|
||||
|
||||
HookAddonOrVariable("Blizzard_MacroUI", function()
|
||||
if type(UpdateMacroIconFilenames) ~= "function" then return end
|
||||
function _G.UpdateMacroIconFilenames()
|
||||
wipe(MACRO_ICON_FILENAMES)
|
||||
local provider = CreateAndInitFromMixin(IconDataProviderMixin, IconDataProviderExtraType.Spellbook)
|
||||
local seen = {}
|
||||
for i = 1, provider:GetNumIcons() do
|
||||
-- uppercase, prefix-stripped basename, matching Blizzard's original
|
||||
local icon = string.gsub(string.upper(provider:GetIconByIndex(i)), "INTERFACE\\ICONS\\", "")
|
||||
if not seen[icon] then
|
||||
seen[icon] = true
|
||||
table.insert(MACRO_ICON_FILENAMES, icon)
|
||||
if C.disabled["macroicons"] == "1" then
|
||||
HookAddonOrVariable("Blizzard_MacroUI", function()
|
||||
if type(UpdateMacroIconFilenames) ~= "function" then return end
|
||||
function _G.UpdateMacroIconFilenames()
|
||||
wipe(MACRO_ICON_FILENAMES)
|
||||
local provider = CreateAndInitFromMixin(IconDataProviderMixin, IconDataProviderExtraType.Spellbook)
|
||||
local seen = {}
|
||||
for i = 1, provider:GetNumIcons() do
|
||||
-- uppercase, prefix-stripped basename, matching Blizzard's original
|
||||
local icon = string.gsub(string.upper(provider:GetIconByIndex(i)), "INTERFACE\\ICONS\\", "")
|
||||
if not seen[icon] then
|
||||
seen[icon] = true
|
||||
table.insert(MACRO_ICON_FILENAMES, icon)
|
||||
end
|
||||
end
|
||||
provider:Release()
|
||||
end
|
||||
provider:Release()
|
||||
end
|
||||
end)
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
-- add turtle-wow sell values
|
||||
pfSellData = {
|
||||
|
||||
Reference in New Issue
Block a user