View Single Post
01-12-16, 04:51 AM   #12
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by SDPhantom View Post
You can use RegisterAttributeDriver() to securely swap the unit of a SecureUnitFrame. Just use this to replace the entire self.frame.state block.
Code:
RegisterAttributeDriver(self.frame,"unit","[vehicleui] player; pet")


Updating the frame when this happens can be done with an OnAttributeChanged script hook. Since I highly doubt you're doing anything protected in PlayerPet:UpdateDisplay(), you can just call that.
Code:
self.frame:HookScript("OnAttributeChanged",function() PlayerPet:UpdateDisplay(); end)
Thanks, gonna try it.
  Reply With Quote