mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-13 08:50:50 +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
|
||||||
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 = {
|
||||||
|
|||||||
Reference in New Issue
Block a user