I know this question has been raised a lot lately but I've been trying to update my UI to late oUF and WoW API changes and I'm now trying to update to the new ClassIcons function of oUF.
I started with Monk and now Paladin but both are giving me the same problem. The bars get shown at like they were maxed but never disappear from the screen nor they are updated.
I took my previous implementation of HolyPower and just changed the element to ClassIcons and I get the behavior I just described above.
This is my code now for ClassIcons for the Paladin Holy Power:
lua Code:
-- Paladin Holy Power with StatusBar
local PaladinHolyPower = function(self)
if(cfg.show_PL_HolyPower and PlayerClass == "PALADIN") then
local HolyPower = CreateFrame("Frame", nil, self)
local max = UnitPowerMax("player", SPELL_POWER_HOLY_POWER)
for i = 1, max do
HolyPower[i] = CreateFrame("StatusBar", self:GetName().."_Shards"..i, self)
HolyPower[i]:SetHeight(cfg.PL_hp_height)
HolyPower[i]:SetWidth(cfg.PL_hp_width)
HolyPower[i]:SetStatusBarTexture(fill_texture)
--local color = self.colors.power["HOLY_POWER"]
--HolyPower[i]:SetStatusBarColor(color[1], color[2], color[3])
HolyPower[i]:SetStatusBarColor(245/255, 102/255, 165/255)
SetBackdrop(HolyPower[i], 2, 2, 2, 2)
if (i == 1) then
HolyPower[i]:SetPoint('LEFT', self, 'RIGHT', cfg.PL_hp_x or ((cfg.target_frame_x_from_player/2) - (((cfg.PL_hp_width + cfg.PL_hp_spacing) * 1.5) - (cfg.PL_hp_spacing/2))), cfg.PL_hp_y or 0)
else
HolyPower[i]:SetPoint('TOPLEFT', HolyPower[i-1], "TOPRIGHT", cfg.PL_hp_spacing, 0)
end
end
end
self.ClassIcons = HolyPower
end
Dunno what is wrong since the element is not being updated.