Originally Posted by Kygo
... 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.