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 < 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