View Single Post
01-12-16, 06:47 PM   #19
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by SDPhantom View Post
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)
But this is pretty much the code i had in the first place, which i had the original issue with.

Here is a video about it:

https://www.youtube.com/watch?v=IgjRxkEk5TM

Last edited by Resike : 01-12-16 at 07:18 PM.
  Reply With Quote