WoWInterface - View Single Post - oUF_AuraBars
Thread: oUF_AuraBars
View Single Post
09-19-12, 04:38 PM   #15
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:

Don't change random variable names in the module; just pass the right value from your 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.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.
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote