View Single Post
09-06-09, 08:10 AM   #1156
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by p3lim View Post
source: http://github.com/p3lim/oUF_RuneBar/...UF_RuneBar.lua
Code:
local function update(self)
    for index = 1, 6 do
        self.Runes[index]:SetStatusBarColor(unpack(oUF.colors.runes[GetRuneType(index)]))
    end
end
This function is also 2nd arg in oUF:AddElement()
I'll have to correct myself, there is actually a "bug" in oUF that stops the coloring from applying at login.
A way around it atm is doing the following in the table creating of bars:
Code:
for index = 1, 6 do
    self.Runes[index] = CreateFrame('StatusBar', nil, self.Runes)
    -- creating the bars

    local mu = self.Runes[index].bg.multiplier or 1
    local r, g, b = unpack(self.colors.runes[GetRuneType(index)])
    self.Runes[index]:SetStatusBarColor(r, g, b)
    self.Runes[index].bg:SetVertexColor(r * mu, g * mu, b * mu)
end