actionbar: add option to disable macro scans

macro scans can now be globally disabled via the
"Scan Macros For Spells" option or individually
by adding "#showtooltip disable" to the top of the macro.
This commit is contained in:
shagu
2023-04-13 10:43:01 +02:00
parent 337a1b9519
commit 09e5ad1e8f
3 changed files with 15 additions and 0 deletions
+13
View File
@@ -379,6 +379,7 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
local function ButtonMacroScan(self)
if self.bar > 10 then return end
if not self.scanmacro then return end
local macro = GetActionText(self.id)
self.spellslot = nil
@@ -404,6 +405,11 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
return
end
-- allow the user to disable the scan
if match and strfind(match, "disable") then
return
end
if not match then
-- add support to specify custom tooltips via:
-- /run --showtooltip SPELLNAME
@@ -1170,6 +1176,13 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
f.count:SetJustifyH("RIGHT")
f.count:SetJustifyV("BOTTOM")
-- macro spell scan
if C.bars.macroscan == "0" then
f.scanmacro, f.spellslot, f.booktype = nil, nil, nil
else
f.scanmacro = true
end
-- range glow color
f.rangeColor = { strsplit(",", C.bars.rangecolor) }