Thursday, April 19, 2012

Leave Group/Party Event?

OK, I may be just missing it, but is there an event that fires when you leave a group/raid. I'm trying my hand at addon messages, starting out easy with a simple version check. I have a method to send the request, and a method to process it (and any others I may add). The way I see it, because more than one person will answer, I've created a list of strings, which the method will add to as each person sends a response. Only problem is I need to empty the list when a group is left so I don't see a list of every single person who I've ever grouped with. Any help is appreciated, sorry if I'm confusing.

P.S. Addon messages aren't seen in the chat window, right? Seeing 40 chat messages requesting version info would not be good in raid chat :D.|||http://www.wowwiki.com/World_of_Warc...roup_Functions should give you the general idea.|||In the event "RAID_ROSTER_UPDATE", get number of party/raid members with GetNumRaidMembers() and/or GetNumPartyMembers() and compare with previous value to determine if you're leaving or joining.

You will probably have to initialize the number outside of this event, like in "PLAYER_ENTERING_WORLD", as "RAID_ROSTER_UPDATE" doesn't fire when you log in raid.|||Thanks for the help guys, Ill give it a shot.|||OK, I got it. I have one other thing in regard to outputting the data I receive from the addon messages, but I didn't want to flood the board so hopefully it gets seen here. What I've tried so far is to create a small frame with only one Fontstring to hold all the data. For example:

Name1 v1.0

Name2 v1.2

Name3 v1.1

The problem is as the list gets longer, the string gets long (possibly to long) and I am getting a stack overflow error, which I'm guessing either means the Fontstring has reached maximum capacity, or the string itself. The problem gets even worse when I check for status. I was wondering if it's possible to dynamically create a new Fontstring underneath the previous item in the list, or a way to get rid of the stack overflow error lol. Sorry if this is asking alot, not sure what I'm up against yet.|||The stack overflow error is usually an infinite recursion and has nothing to do with fontstrings. Look at the calling stacks (using BugGrabber for exemple) and the code involved to get a clue|||Quote:








The stack overflow error is usually an infinite recursion and has nothing to do with fontstrings. Look at the calling stacks (using BugGrabber for exemple) and the code involved to get a clue




Thanks, probably shoulda figured that out from Java. The stack overflow error isn't exactly helpful tho either lol.|||Quote:








I was wondering if it's possible to dynamically create a new Fontstring underneath the previous item in the list, or a way to get rid of the stack overflow error lol.




I don't know why the overflow error is occuring since I don't have any of your code, but I highly doubt that it is the Fontstring becoming overloaded.



I wanted to post this anyways. It is definitely possible to create a new fontstring object (or any other object) on the fly using lua code. In fact, many addon authors prefer to use 100% lua without xml.



Check out http://www.wowwiki.com/World_of_Warc...ame_Management for more information.



The API call
Code:
newFrame = CreateFrame("frameType", "frameName", parentFrame[, "inheritsFrame"]);

should have no problem creating a FontString object. Remember - all objects in the WoW widget interface are essentially frames (this includes buttons, text boxes, artwork, fontstrings, etc....).

No comments:

Post a Comment