View Single Post
09-09-12, 01:34 PM   #4
Senit24
A Fallenroot Satyr
AddOn Compiler - Click to view compilations
Join Date: Jul 2012
Posts: 28
After hours of coding, I am more confused than I was to begin with. (Trying to create Warlock Power Bars).
What I wrote for soul shards seems to work:
Lua Code:
  1. UpdateShards = function(self, event, unit, powerType)
  2.     if(self.unit ~= unit or (powerType and powerType ~= 'SOUL_SHARDS')) and (GetSpecialization() ~= SPEC_WARLOCK_AFFLICTION) then return end
  3.         local maxshards = 3
  4.             for i = 1, GetNumGlyphSockets() do
  5.             local glyphID = select(4, GetGlyphSocketInfo(i))
  6.                 if glyphID == 63302 then maxshards = 4 end 
  7.        
  8.             local num = UnitPower(unit, SPELL_POWER_SOUL_SHARDS)
  9.             for i = 1, maxshards do
  10.                 if(i <= num) then
  11.                     self.SoulShards[i]:SetAlpha(1)
  12.                 else
  13.                     self.SoulShards[i]:SetAlpha(0)
  14.                 end    
  15.             end
  16.     end
  17. end

I tried doing the same thing for burning embers, but with no success. Does this function only work because self.SoulShards is predefined in oUF elements? Does this mean I need to write a new element for Embers/Fury/ShadowOrbs/Monks etc?

Last edited by Senit24 : 09-09-12 at 07:59 PM.
  Reply With Quote