Originally Posted by Paopao001
In some quests like Unyielding Fists: Trial of Bamboo,the player get into a vehicle but got altpower itself.
That is, UnitPower("player", ALTERNATE_POWER_INDEX) returns the value while UnitPower("vehicle", ALTERNATE_POWER_INDEX) returns nil.
But the unit of player frame is vehicle, not player. so the power bar alt don't show up in these cases.
Here's my solution. I wonder if anybody have a better solution.
https://github.com/Paojy/Altz-UI/com...dc836bd773df9b
|
A better solution would be something along these lines:
Lua Code:
if powerType == "ALTERNATE" then
if self.unit ~= PlayerPowerBarAlt.unit then -- PlayerPowerBarAlt is the blizzard frame which will always have the correct unit associated with it.
self.unit = PlayerPowerBarAlt.unit
end
if self.unit ~= unit then
return
end
else
return
end