Originally Posted by
Lybrial
This is what I use, the name of the clickable aura is TARGET_CLICK in this case.
(Trigger for the aura = always active.)
Code:
local r = WeakAuras.regions["TARGET_CLICK"].region
if r then
local b = CreateFrame("Button", "MySecureWAUnitFrameTarget", UIParent, "SecureUnitButtonTemplate")
if b then
local point1, _, relativePoint1, xOfs1, yOfs1 = r:GetPoint()
local _, _, _, xOfs2, yOfs2 = UIParent:GetPoint();
local width, height = r:GetWidth(), r:GetHeight();
b:ClearAllPoints();
b:SetPoint(point1, UIParent, relativePoint1, xOfs1-xOfs2, yOfs1 - yOfs2 );
b:SetWidth (width);
b:SetHeight(height);
b:SetFrameLevel(r:GetFrameLevel() + 2)
b:SetAttribute("unit","target")
b:SetAttribute("type","target") -- leftclick
b:SetAttribute("*type2", "togglemenu") -- rightclick
b:RegisterForClicks("AnyUp")
RegisterStateDriver(b, "visibility", "[target=target] show; hide]" );
end
end