View Single Post
08-08-13, 03:28 PM   #18
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Actually since you are in the same guild, you don't need to use addon comms at all. Just pick one of you to take priority. When GUILD_ROSTER_UPDATE fires, before you start the management timer, loop over the guild roster and return out if any of the other's characters are online.

Since I didn't have any work to do at work today, I couldn't stop myself from rewriting the whole thing. I gave you managing priority; if you want your wife to have priority, swap "herChars" to "myChars" and "myToons" to "herToons" in the GUILD_ROSTER_UPDATE handler. I changed it to avoid forcibly loading the GuildUI or CalendarUI, and split up your giant OnEvent handler into individual functions for each event, among other things. See the inline comments for details.

http://pastebin.com/THTFmmg9

On a side note, it wasn't clear whether the character lists were actually in the same file or not. I put them in there, but if they are actually in their own file, and you want to be able to access any of those variables from other files, you should add them to the addon's namespace table (the one you're naming "caelCore") instead of making them globals (as you were doing with the "herChars" and "myChars" variables).
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote