The parent frame must actually be a
frame. You are currently passing
ClassIcons, which is a
table, not a frame. Similarly, you cannot use
SetPoint to position things relative to a table, because a table does not have any position or of the other "physical" attributes a frame has.
The easiest solution would be to make
ClassIcons a frame, like the combo point holder is:
Code:
local noop = function() return end
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
-- Optional, to match the combo points:
bars:SetBackdrop(backdrop)
bars:SetBackdropBorderColor(0,0,0,0)
bars:SetBackdropColor(0,0,0,0)
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.PostUpdate = HolyPostUpdate
self.ClassIcons = ClassIcons
end