mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-23 16:16:56 +00:00
Support binding a click to a named macro
Accept "macro:<name>" in a click-cast action to run a saved macro by name via the secure `macro` attribute (leading space after the colon is trimmed). ClassicAPI dispatches it through RunMacro, so a conditional addon still evaluates the macro body.
This commit is contained in:
@@ -2152,6 +2152,9 @@ function pfUI.uf:EnableClickCast()
|
||||
self:SetAttribute(prefix .. "type" .. bid, "target")
|
||||
elseif low == "focus" then
|
||||
self:SetAttribute(prefix .. "type" .. bid, "focus")
|
||||
elseif string.find(low, "^macro:") then
|
||||
self:SetAttribute(prefix .. "type" .. bid, "macro")
|
||||
self:SetAttribute(prefix .. "macro" .. bid, string.gsub(string.sub(action, 7), "^%s+", ""))
|
||||
elseif string.find(action, "^/") then
|
||||
self:SetAttribute(prefix .. "type" .. bid, "macro")
|
||||
self:SetAttribute(prefix .. "macrotext" .. bid, action)
|
||||
|
||||
Reference in New Issue
Block a user