View Single Post
09-05-19, 03:01 PM   #6
mathias234
A Murloc Raider
Join Date: Sep 2019
Posts: 4
Originally Posted by SDPhantom View Post
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.
Thanks this seems to be working correctly
  Reply With Quote