View Single Post
09-21-12, 09:04 AM   #22
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by Phanx View Post
The Blizzard UI is just Lua/XML code like addons. If information is available to the Blizzard UI, it is also available to addons, though the exact same API.

See:
http://wowprogramming.com/utils/xmlb...L/GameTime.lua

The following events are relevant:
- PLAYER_ENTERING_WORLD
- CALENDAR_UPDATE_PENDING_INVITES
- CALENDAR_EVENT_ALARM

See the "GameTimeFrame_OnEvent" function to see which API functions are called to determine if there is a calendar invite pending. There's nothing magical going on there. You can even just copy/paste the code directly into your addon if you want.
I fixed some of the stuff from this post but i want to clarify some things since it seems people are still finding this post helpful. Also to clarify what i meant to Phanx

The issue with both guild and the calendar is that the data is in fact NOT available to me or blizzard or anything until you actually click the button for the calendar or click on the guild button. The guild and calendar buttons are actually LOD triggers because the guild window and the calendar data only load for use if you click those buttons. Once they are clicked the data is loaded for the rest of your session but when you first log in that data is not available. Go try it...

Its the same long standing issue that there has been with all the mail addons. You can not make your own mail monitoring system that functions properly without the player opening the mail box or doing as i did by linking the bliz functions to my own stuff. Blizzard has magic access to pending mail when the player doesnt and there is a "magic" tooltip for the mail button that shows data that blizzard magicaly knows but if you try to do a print on the pending mail using data and get functions available on login, it will come back nil until you open the mail box, even though blizzards magic tooltip somehow knows it without you going to a mailbox. Once again its because the mail is a magic blizzard LOD.

Data for mail is not available to the player until the mailbox is opened. Data for the calendar is not available to the player until the calendar is opened and same for guild data. Even though blizzard tooltips and other such stuff functions correctly on login. Such as the pending mail tooltip showing the pending mail even though if you do a print it will return nil.

go do prints on guild xp right after you log in without opening the guild window... its going to come back as nil, then open the guild window and it will come back proper.

The easy fix is to have your addon open and close those windows upon login so the data is available. This of course does not work for the mail because it requires the mailbox be opened.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 09-21-12 at 09:20 AM.
  Reply With Quote