Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-14-10, 08:11 AM   #1
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Updating mail/calendar invites

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?
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Updating mail/calendar invites


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off