Thread: ClassIcons
View Single Post
10-06-12, 10:14 AM   #1
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
ClassIcons

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:
  1. -- Paladin Holy Power with StatusBar
  2.     local PaladinHolyPower = function(self)
  3.    
  4.         if(cfg.show_PL_HolyPower and PlayerClass == "PALADIN") then
  5.             local HolyPower = CreateFrame("Frame", nil, self)
  6.  
  7.             local max = UnitPowerMax("player", SPELL_POWER_HOLY_POWER)
  8.            
  9.             for i = 1, max do
  10.                 HolyPower[i] = CreateFrame("StatusBar", self:GetName().."_Shards"..i, self)
  11.                 HolyPower[i]:SetHeight(cfg.PL_hp_height)
  12.                 HolyPower[i]:SetWidth(cfg.PL_hp_width)
  13.                
  14.                 HolyPower[i]:SetStatusBarTexture(fill_texture)
  15.                 --local color = self.colors.power["HOLY_POWER"]
  16.                 --HolyPower[i]:SetStatusBarColor(color[1], color[2], color[3])
  17.                 HolyPower[i]:SetStatusBarColor(245/255, 102/255, 165/255)
  18.                 SetBackdrop(HolyPower[i], 2, 2, 2, 2)
  19.                 if (i == 1) then
  20.                     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)
  21.                 else
  22.                     HolyPower[i]:SetPoint('TOPLEFT', HolyPower[i-1], "TOPRIGHT", cfg.PL_hp_spacing, 0)
  23.                 end
  24.             end
  25.         end
  26.        
  27.         self.ClassIcons = HolyPower
  28.     end

Dunno what is wrong since the element is not being updated.

__________________
My oUF Layout: oUF Lumen

Last edited by neverg : 10-06-12 at 10:51 AM.
  Reply With Quote