Hello. I made a small script so my minimap border turns red when I have pending invites, green when I have new mail, orange when both, and black when none of them.
Code:
local f=CreateFrame("Frame")
f:SetScript("OnEvent", function(self, event, ...)
local inv = CalendarGetNumPendingInvites()
if inv > 0 then
if HasNewMail() then
CreateBG(Minimap):SetTexture(1, .5, 0)
else
CreateBG(Minimap):SetTexture(1, 30/255, 60/255)
end
else
if HasNewMail() then
CreateBG(Minimap):SetTexture(0, 1, 0)
else
CreateBG(Minimap):SetTexture(0, 0, 0)
end
end
end)
The problem is though, it only updated on a reloadui. How can I make this update on its own?