View Single Post
08-19-14, 08:23 PM   #51
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Kygo View Post
... how would I go around to fetch time remaning and aura name for two fontstrings?
Did some google-ing, could'nt find any real answer on how to fetch these strings
You'd get them from UnitAura. Assuming you wanted to show that info on the bars, you'd want to create the font strings in the PostCreateIcon function, something like:

Code:
	local time = bar:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
	time:SetPoint("RIGHT", -4, 0)
	bar.time = time

	local name = bar:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
	name:SetPoint("LEFT", 4, 0)
	name:SetPoint("RIGHT", time, "LEFT", -2, 0)
	bar.name = name
Then in the PostUpdateAura function, use the values you're already getting from UnitAura. Set the name font string to display the name in the same place, and for auras with no duration, make sure you clear the time text. Then, update the time text in the OnUpdate function; it'll have a lot of digits after the decimal point, so you'll want to use SetFormattedText to restrict it to the number of decimal values you actually want to show.
__________________
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