View Single Post
09-12-12, 09:03 PM   #7
Senit24
A Fallenroot Satyr
AddOn Compiler - Click to view compilations
Join Date: Jul 2012
Posts: 28
Okay -- I finally had a chance to look this over and this was my result for holy power (not working):
lua Code:
  1. lib.genHoly = function(self)
  2.     if select(2, UnitClass("player")) ~= "PALADIN" then return end
  3.     local ClassIcons = {}
  4.     for i = 1, 3 do
  5.         local Icon = CreateFrame("StatusBar", nil, ClassIcons)
  6.         Icon:SetSize(20, 20)
  7.         Icon:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, 7)
  8.         Icon:SetStatusBarTexture(config.statusbar_texture)
  9.         Icon:GetStatusBarTexture():SetHorizTile(false)
  10.         Icon:SetBackdrop(backdrop)
  11.         Icon:SetBackdropColor(0,0,0,1)
  12.         if i == 1 then
  13.             ClassIcons[i]:SetPoint("LEFT", ClassIcons)
  14.         else
  15.             ClassIcons[i]:SetPoint("LEFT", ClassIcons[i-1], "RIGHT", 10, 0)
  16.         end
  17.         ClassIcons[i] = Icon
  18.     end
  19.      
  20.     ClassIcons[1]:SetStatusBarColor(0.69, 0.31, 0.31)
  21.     ClassIcons[2]:SetStatusBarColor(0.69, 0.31, 0.31)
  22.     ClassIcons[3]:SetStatusBarColor(0.65, 0.63, 0.35)
  23.  
  24.    self.ClassIcons = ClassIcons
  25. end

I feel like it's still over complicated, but I'm not sure where to put the frame options in the example given. I must be functionally retarded. How do!?
  Reply With Quote