Erm, I have no idea why you're defining that
ComboDisplay function and using it as an element Override, when it's functionally identical to oUF's standard combo point update function, but contains a lot of unnecessary redundancy. You set the alpha to 15% and then hide the frame, instead of just hiding it, for example. Try getting rid of the Override and see if it works then.
I also don't understand what you're trying to do with the
bars.FrameBackdrop section at the end of the block you posted. It's just an extra frame, attached to the
bars frame, with no visible anything, since you call SetBackdrop on
bars instead of
bars.FrameBackdrop, and anyway you're setting the same backdrop that you already set on
bars, so even if you did set it on the
bars.FrameBackdrop frame, you'd only see 1 pixel of it around the edges since the frames are stacked on top of each other. I'd suggest just getting rid of the whole thing. If you want a 1px border on the
bars frame, just change its backdrop to include a 1px border, eg:
Lua Code:
local backdrop = {
bgFile = "Interface\\BUTTONS\\WHITE8X8", tile = true, tileSize = 8,
edgeFIle = "Interface\\BUTTONS\\WHITE8X8", edgeSize = 1,
insets = { left = 1, right = 1, top = 1, bottom = 1 },
}
Finally, your
genCPoints function parents
bars to
self, but anchors it to
oUF_Player. If multiple frames call
genCpoints, you'll end up with multiple objects piled on top of each other. I'd also suggest combo points be attached to the target frame, rather than the player frame. Not only does that give you more room on the player frame for class powers, but combo points also logically belong on the target, at least for druids, who can have different numbers of combo points on different targets at the same time.
Try this:
Lua Code:
lib.genCPoints = function(self)
local bars = CreateFrame("Frame", nil, self)
bars:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, 7)
-- ^^^ Attach to self, and then just call this function from the
-- frame you actually want it attached to, probably target.
bars:SetWidth(210)
bars:SetHeight(2)
bars:SetBackdrop(backdrop)
bars:SetBackdropBorderColor(0,0,0,0)
bars:SetBackdropColor(0,0,0,0)
for i = 1, 5 do
bars[i] = CreateFrame("StatusBar", nil, bars)
-- ^^^ No reason to give this a global name.
bars[i]:SetWidth(41.2) -- (210 - 4) / 5
-- ^^^ No need to do the math on the fly since it isn't dynamic.
bars[i]:SetHeight(20)
bars[i]:SetStatusBarTexture(config.statusbar_texture)
bars[i]:GetStatusBarTexture():SetHorizTile(false)
if i == 1 then
bars[i]:SetPoint("LEFT", bars)
else
bars[i]:SetPoint("LEFT", bars[i-1], "RIGHT", 1, 0)
end
end
bars[1]:SetStatusBarColor(0.69, 0.31, 0.31)
bars[2]:SetStatusBarColor(0.69, 0.31, 0.31)
bars[3]:SetStatusBarColor(0.65, 0.63, 0.35)
bars[4]:SetStatusBarColor(0.65, 0.63, 0.35)
bars[5]:SetStatusBarColor(0.33, 0.59, 0.33)
self.CPoints = bars
end