View Single Post
01-12-16, 04:45 PM   #18
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,327
RegisterAttributeDriver() is just handling what unit is selected when you click on the frame and should handle RegisterUnitWatch() fine on its own. It's just a more direct approach to what you were already doing. The display code, you can do whatever you want and it isn't going to hurt the SecureUnitFrame. The problem is still located there. Try taking the code back to the basics and replace the 4 vehicle event blocks with this. Don't forget to unregister UNIT_ENTERING_VEHICLE and UNIT_EXITED_VEHICLE.
Lua Code:
  1. function Player:UNIT_ENTERED_VEHICLE(unit, showVehicleUI, arg3, vehicleType, vehicleID, arg6, vehicleGUID, arg8, arg9)
  2.     if showVehicleUI then
  3.         self.frame.unit = "player"
  4.         self:UpdateDisplay()
  5.     end
  6. end
  7.  
  8. function Player:UNIT_EXITING_VEHICLE()
  9.     if self.frame.unit ~= "pet" then
  10.         self.frame.unit = "pet"
  11.         self:UpdateDisplay()
  12.     end
  13. end
(Code taken from Player.lua and modified)
__________________
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 : 01-12-16 at 04:53 PM.
  Reply With Quote