View Single Post
06-07-20, 01:55 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
You need to set the frame's event handler.

Example:
Lua Code:
  1. GuildLeader:SetScript("OnEvent",function(self,event)
  2.     if event=="WHO_LIST_UPDATE" then
  3.         for i=1,C_FriendList.GetNumWhoResults() do
  4.             local info=C_FriendList.GetWhoInfo(i);
  5. --          Do something with character data in table "info"
  6.         end
  7.  
  8. --      Be nice and re-register the event so "/who" still works
  9.         FriendsFrame:RegisterEvent("WHO_LIST_UPDATE")
  10.     end
  11. end);
See C_FriendList.GetWhoInfo() for the structure of the table returned containing character data.



As a side note, there are a couple misconceptions.
C_FriendList.SetWhoToUI() expects a boolean value, you're giving it a number.
GuildLeader:RegisterEvent() only takes one argument, the event you're registering.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 06-07-20 at 02:05 PM.
  Reply With Quote