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
+1
View File
@@ -518,6 +518,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("bars", nil, "animation", "zoomfade")
pfUI:UpdateConfig("bars", nil, "animmode", "keypress")
pfUI:UpdateConfig("bars", nil, "animalways", "0")
pfUI:UpdateConfig("bars", nil, "macroscan", "1")
pfUI:UpdateConfig("bars", nil, "reagents", "1")
pfUI:UpdateConfig("bars", nil, "hunterbar", "0")
pfUI:UpdateConfig("bars", nil, "pagemaster", "0")
+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) }
+1
View File
@@ -1942,6 +1942,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U["bars"], T["Button Animation"], C.bars, "animation", "dropdown", pfUI.gui.dropdowns.actionbuttonanimations)
CreateConfig(U["bars"], T["Button Animation Trigger"], C.bars, "animmode", "dropdown", pfUI.gui.dropdowns.animationmode)
CreateConfig(U["bars"], T["Show Animation On Hidden Bars"], C.bars, "animalways", "checkbox")
CreateConfig(U["bars"], T["Scan Macros For Spells"], C.bars, "macroscan", "checkbox", nil, nil, nil, nil, "vanilla")
CreateConfig(U["bars"], T["Show Reagent Count"], C.bars, "reagents", "checkbox")
CreateConfig(U["bars"], T["Highlight Equipped Items"], C.bars, "showequipped", "checkbox")
CreateConfig(U["bars"], T["Equipped Item Color"], C.bars, "eqcolor", "color")