Thread: oUF_AuraBars
View Single Post
09-19-12, 04:38 PM   #15
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I have no idea why you changed all of the variable names in my code. Variables are not aware of their names, only their values. You only need to pass in the right value from your code. In your code, the frame object is the value of the variable named "self", so you need to pass "self" into the function. It doesn't matter if the function then refers to that value as "frame" or "kazoo". Only the order of arguments matter.

A more efficient solution to the nil count problem is to store nil counts as 1 in the first place, since that's techincally accurate; a buff with no charges effectively has 1 charge.

Finally, while I'm not really picky about being credited for stuff, I have put a lot of time into helping you with this, and does seem a little insulting that you would remove the "Rewritten by Phanx" comment from the file, when it being there has absolutely no effect on the functionality of the file because it's in a comment.

Fixed count issue:
http://www.wowace.com/paste/6276/

Don't change random variable names in the module; just pass the right value from your code:
Code:
target = function(self, ...)
	Shared(self, ...)

	local BuffBars = CreateFrame("Frame", nil, self)
	BuffBars:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 20, 10)
	BuffBars:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT", 0, 10)
	self.BuffBars = BuffBars

	BuffBars.barHeight = 15
	BuffBars.fontFile = cfg.font
	BuffBars.fontOutline = "MONOCHROMETHINOUTLINE"
	BuffBars.nameSize = 8
	BuffBars.timeSize = 9
	BuffBars.customFilter = function() return true end -- No need to catch incoming arguments and assign them to named variables when you're not using any of them.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote