WoWInterface - View Single Post - Executing secure code on a RaidFrame click
View Single Post
05-21-20, 02:08 AM   #1
A Fallenroot Satyr
Spyro's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2011
Posts: 23
Question Executing secure code on a RaidFrame click


I want to execute secure code (do a SetAttribute() on my own secure frame while In Combat) when the user clicks on a raid member on Blizzard's raid frames. The goal is to save on my secure frame the UnitID of the party/raid member that the user has targeted with his click.

My initial idea was to do something like:

Lua Code:
  1. MyTestXD = CreateFrame("Button", "MyTestXD", nil, "SecureHandlerClickTemplate")
  2. CompactRaidFrame1:SetFrameRef("Test", MyTestXD)
  4. MyTestXD:WrapScript(CompactRaidFrame1, "PostClick", [[
  5.   local Test = self:GetFrameRef("Test")
  6.   Test:SetAttribute("UnitID", self:GetAttribute("unit"))
  7.   print("Unit targeted saved:", Test:GetAttribute("UnitID"))
  8. ]])

But trying it I have seen that CompactRaidFrames don't have SetFrameRef() method, so this approach is not possible.

Any ideas on how to do it?
  Reply With Quote