View Single Post
06-21-21, 10:25 AM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
I've inserted the suggested code where it is likely to do what you want. Give that a go. This link points out the similarities between SetFormattedText and string.format. https://wowpedia.fandom.com/wiki/API...tFormattedText

Originally Posted by rulezyx View Post
Ok, I tried to find a code for the default buff/debuff frames to put it together.

Found this:

Code:
function AuraButton_UpdateDuration(auraButton, timeLeft)
	local duration = auraButton.duration;
	if ( SHOW_BUFF_DURATIONS == "1" and timeLeft ) then
		duration:SetFormattedText(SecondsToTimeAbbrev(timeLeft));

>>>> if (timeLeft < 1.0 ) then 
>>>>     duration:SetFormattedTextstring("%.1f", timeLeft)
>>>> end

		if ( timeLeft < BUFF_DURATION_WARNING_TIME ) then
			duration:SetVertexColor(1,1,1);
		else
			duration:SetVertexColor(1,1,1);
		end
		duration:Show();
	else
		duration:Hide();
	end
end
I am unsure how to use string.format in this case.

Blizz-Code:https://github.com/tomrus88/Blizzard.../BuffFrame.lua
__________________
  Reply With Quote