View Single Post
03/11/23, 05:43 AM   #15
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,979
if you get something like table:000023908713BHS&HS then it means your are passing in the total table and not 1 value of that table, e.g. you pass in rowData and not rowData.subVariableInThatTable.

As I said, add the rowDate in your callback function to your global addon table like

myAddon._rowdata = rowdata

Then use an addon like merTorchbug or zgoo and inspect your global variable myAddon
via slash command /tb myAddon
or /zgoo myAddon

You will see all values of that table (myAddon) that way and can click on the _rowData subtable to see what it contains.
In there you might find something like characterName or memberIndex or similar whch was provided by the callback function of the guildRoster context menu and that way you can use the memberIndex or something that was provided in that rowData table to use for your usecase, like get the name of the clicked row etc.


And you also need to pay attention if the signaure of the callback functions you pass in to RegisterGuildRosterContextMenu and RegisterPlayerContextMenu (I meant the first parameter, your callback function "MyAddon.AddMenuContext") is the same, if it uses the same parameters. Maybe 1 got rowData of the guildMember you right clicked on and the other one got no rowData table but just a string with the chat name you clicked on?
Check it inside the LibCustomMenu.lua file, where the RegisterGuildRosterContextMenu and RegisterGuildRosterContextMenu functions are called OR at the description of the addon!


About friendsList I'm not sure if LibCustomMenu provides that already or not. if the description lacks that info I doubt it's in there until now and must be added. But maybe it's in the code of the lib already, so check the lua file of LibCustomMenu for "friend" or similar, and maybe you can find the API function to register a context menu that way.
Edit: I briefly scanned the code and it does not look like it supports the friendslist until now.
Maybe raise a request at the addon comments of LibCustomMenu for that:
lib:RegisterFriendsListContextMenu(func, category, ...)

Last edited by Baertram : 03/11/23 at 05:49 AM.
  Reply With Quote