View Single Post
09-05-19, 01:01 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Try using SecureUnitButtonTemplate. Your frame needs to be of type Button like this.
Code:
<Button name="SUF_PlayerFrame" parent="UIParent" inherits="SecureUnitButtonTemplate" movable="true">

In your OnLoad script, you need to add these. (Note: You should pass self to your OnLoad handler and use that.)
Code:
self:RegisterForClicks("AnyUp");
self:SetAttribute("unit","player");
self:SetAttribute("type1","target");
self:SetAttribute("type2","togglemenu");
This sets up the necessary attributes to mimic what the default PlayerFrame does.
__________________
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)
  Reply With Quote