Player frame health bar bugged when entering vehicles
Xaero252 opened this issue ยท 4 comments
This is due to the BlizzardInterfaceCode no longer calling PlayerFrameHealthBar:SetHeight() on entering a vehicle. Since we've modified the height and they aren't modifying it back anymore, this leads to the healthbar escaping the bounds of the vehicle frame.
Solution is simple, add event handling for UNIT_ENTERED_VEHICLE and call PlayerFrameHealthBar:SetHeight() there to an appropriate value. I'm testing with 13 currently, to see if that fits things correclty.
This needs someone with more depth of knowledge to look at fixing. When entering a vehicle in Ulduar (great place for testing, btw) you'll see the error occur. The change I've suggested above fixes it in this particular case. Unfortunately, In Seething Shore (for example) the player gains the Vehicle UI bars, triggering the UNIT_ENTERED_VEHICLE event, but the PlayerFrame does not get a Vehicle texture, meaning that the resized bar doesn't fit the regular player bar. I'll play with it more as I have time, perhaps checking to see if the texture is changed somehow?
Here's a screenshot of the issue:
https://imgur.com/a/plheJiR
As you can see the text is aligned correctly, but the size of it, and hte heatlhbar itself completely escape the bounds of the vehicle unitframes. I am using a dark-recolor of the frames but the dimensions are identical to the original frames.
Also note the micromenu bug visible here, I'll probably just forcibly hide it as I have another menu I use instead. Simply resizing/positioning on UNIT_ENTERED_VEHICLE doesn't work due to the issue mentioned above with situations like that found in Seething Shore where the UNIT_ENTERED_VEHICLE event fires, but the unitframe texture remains untouched.
I've added another picture showing what the status of the unitframe is after leaving a vehicle.