Code:
local buffName = "Mark of the Wild"
local tooltipPos = {"BOTTOMRIGHT",-10,10}
local UnitAura, UIParent = UnitAura, UIParent
local tooltip = CreateFrame("GameTooltip","BuffCheckDisplayTooltip",UIParent,"GameTooltipTemplate")
tooltip:SetPoint(unpack(tooltipPos))
function tooltip:Update()
local i=1
local aura = UnitAura("player",i)
while aura and (aura ~= buffName) do
i=i+1
aura = UnitAura("player",i)
end
if aura then
tooltip:ClearLines()
tooltip:SetOwner(UIParent,"ANCHOR_PRESERVE")
tooltip:SetUnitAura("player",i)
tooltip:Show()
else
tooltip:Hide()
end
end
CreateFrame("Frame"):SetScript("OnUpdate",function(self,elapsed) self.elapsed = (self.elapsed or 0)+elapsed if self.elapsed > 0.5 then self.elapsed = 0 tooltip:Update() end end)
How to use. First two lines are config. Don't change the rest unless you know what you're doing.