View Single Post
11/26/15, 04:50 AM   #3
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
@Baertram: There are easier ways to check if someone is in a group:
Lua Code:
  1. IsPlayerInGroup(characterName)
  2. IsUnitGrouped("player")

@haggen: In my SocialIndicators addon I do not directly operate on every group member event as there are a lot of things going on when a member joins that caused micro freezes in the past (and still do sometimes) without addons adding more work.
So in regard to accessing the unit frames this is what I do in my upcoming update for SocialIndicators:

Lua Code:
  1. local function ClearCallLater(id)
  2.     EVENT_MANAGER:UnregisterForUpdate("CallLaterFunction"..id)
  3. end
  4.  
  5. local function RequestUpdateGroupSocialIndicators()
  6.     if(refreshGroupIconsPending) then
  7.         ClearCallLater(refreshGroupIconsPending)
  8.         refreshGroupIconsPending = false
  9.     end
  10.     if(IsUnitGrouped("player")) then
  11.         refreshGroupIconsPending = zo_callLater(UpdateGroupSocialIndicators, 200)
  12.     end
  13. end
  14. ...
  15. -- in OnAddonLoaded:
  16.     UpdateGroupSocialIndicators()
  17.  
  18.     RegisterForEvent(EVENT_GROUP_MEMBER_JOINED, RequestUpdateGroupSocialIndicators)
  19.     RegisterForEvent(EVENT_GROUP_MEMBER_LEFT, RequestUpdateGroupSocialIndicators)
  20.     RegisterForEvent(EVENT_GROUP_TYPE_CHANGED, RequestUpdateGroupSocialIndicators)
  21.     RegisterForEvent(EVENT_GROUP_UPDATE, RequestUpdateGroupSocialIndicators)

As for the other things you need:
- I got invited
GetGroupInviteInfo()
EVENT_GROUP_INVITE_RECEIVED
EVENT_GROUP_INVITE_REMOVED

- I invited someone
Does not seem to be possible to completely track it via the api.
You will need to hook into all the methods that allow you to invite someone and remember who was invited.
GroupInvite(*string* _unitTag_)
GroupInviteByName(*string* _name_)

At least you should get an event when that invite changes: EVENT_GROUP_INVITE_RESPONSE

- I was offline and logged in already in a group
- I am in a group and reloaded the UI
- Any other possible state
See above.
  Reply With Quote