View Single Post
09-16-12, 11:44 AM   #19
Senit24
A Fallenroot Satyr
AddOn Compiler - Click to view compilations
Join Date: Jul 2012
Posts: 28
Thanks so much Phanx, it's working again! I made a couple modifications. Also got rid of the post update entirely.
Code:
lib.genHoly = function(self)
	if select(2, UnitClass("player")) ~= "PALADIN" then return end

	local ClassIcons = CreateFrame("Frame", nil, self)
	ClassIcons:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, 7)
	ClassIcons:SetSize(140, 20) -- 5 icons * 20 width + 4 spaces * 10 width
	
	for i = 1, 5 do
		local Icon = CreateFrame("StatusBar", nil, ClassIcons)
		Icon:SetSize(20, 20)

		-- You do not need a SetPoint line here, because you have some
		-- later that just override the one that was here.	

		Icon:SetStatusBarTexture(config.statusbar_texture)
		Icon:GetStatusBarTexture():SetHorizTile(false)

		Icon:SetBackdrop(backdrop)
		Icon:SetBackdropColor(0,0,0,1)

		-- Map the method oUF tries to call to one that actually exists:
		Icon.SetVertexColor = noop

		if i == 1 then
			Icon:SetPoint("LEFT", ClassIcons)
		else
			Icon:SetPoint("LEFT", ClassIcons[i-1], "RIGHT", 10, 0)
		end
		ClassIcons[i] = Icon
	end

	ClassIcons[1]:SetStatusBarColor(0.69, 0.31, 0.31)
    ClassIcons[2]:SetStatusBarColor(0.69, 0.31, 0.31)
    ClassIcons[3]:SetStatusBarColor(0.65, 0.63, 0.35)
    ClassIcons[4]:SetStatusBarColor(0.69, 0.31, 0.31)
    ClassIcons[5]:SetStatusBarColor(0.65, 0.63, 0.35)
	
	--ClassIcons.PostUpdate = HolyPostUpdate
	self.ClassIcons = ClassIcons
end
  Reply With Quote