View Single Post
08-19-15, 04:54 PM   #9
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Scanning EnumerateFrames() can be very taxing on the system considering the default UI alone creates hundreds of frames. Trying to "hack" your way to get access to a local frame is customized to that specific frame. One way I can think of that would be much easier on the system is to use GetFramesRegisteredForEvent("CANCEL_LOOT_ROLL") and cross-check the taint record of any existing index.

Lua Code:
  1. local function GetTeksRollFrame()
  2.     local list={GetFramesRegisteredForEvent("CANCEL_LOOT_ROLL")};
  3.     for i,j in ipairs(list) do
  4.         if j.button and select(2,issecurevariable(j,"button"))=="teksLoot" then
  5.             return j;
  6.         end
  7.     end
  8. end

Hacking these frames isn't always going to be easy and it takes a lot of understanding with the environment they exist in. Not only the function creating a frame, but every function that takes the frame in as an argument is a possible point of entry to capture it. Scanning methods like the ones posted here are a last resort if you can't find a viable point of entry to get direct access.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-19-15 at 04:56 PM.
  Reply With Quote