From be6b2ea036a2d27b9837b68db1f15e79bf0e90e2 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Wed, 12 Aug 2026 00:33:49 -0500 Subject: [PATCH] Support binding a click to a named macro Accept "macro:" 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. --- api/unitframes.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/unitframes.lua b/api/unitframes.lua index a9f3185d..2bca3930 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -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)