Hi,
I have a druid mana bar working in my layout, the update is handled this way:
Code:
local function PreUpdatePower(self, event, unit)
if (self ~= oUF_player) then return end
local _,class = UnitClass('player')
if (class ~= "DRUID") then return end
local p = UnitPowerType('player')
local min,max = UnitPower('player', SPELL_POWER_MANA), UnitPowerMax('player', SPELL_POWER_MANA)
if (min ~= max) then
self.DruidManaText:SetFormattedText("|cff8080ff%s|r", number(min))
self.Power.value:SetPoint("LEFT", self.Health, "LEFT", 2, 5)
else
self.DruidManaText:SetText()
end
self.DruidMana:SetMinMaxValues(0, max)
self.DruidMana:SetValue(min)
self.DruidMana:SetAlpha((p ~= 0) and 1 or 0)
self.DruidManaText:SetAlpha((p ~= 0) and 1 or 0)
if (p==0) then
self.Power.value:SetPoint("LEFT", self.Health, "LEFT", 2, 0)
end
end
Now this is working great, but if the shapeshifted powertype of the druid stops updating (power full or rage empty), the druid mana is not updating anymore either.
So is there anything I can do about that?
so long,
luzzi.
**edit: It's working correctly if I disable frequentUpdates, but that is something I explicitly do not want.