I'm trying to add a menu item to the chat context menu for player names. I've looked up how a couple of different addons add menu items to other context menus and think I understand the concept fairly well. Using Zgoo and looking at the source code I've found what I believe to be the proper table and function to prehook. However it doesn't work. When I replace those arguments with ones from other addons that add menu items to the inventory context menu, it works, so I know my function that the prehook is calling works.
Here's the prehook function I think should work but isn't:
Code:
ZO_PreHook(ZO_ChatSystem, "ShowPlayerContextMenu", GH.ContextMenu)
GH.ContextMenu is a function that I have defined directly above the prehook call. When I replace ZO_ChatSystem and "ShowPlayerContextMenu" with "ZO_InventorySlot_DiscoverSlotActionsFromActionList" my menu item gets added no problem to the inventory context menu.
The section of the source code I am looking at is here, line 2077:
http://esodata.uesp.net/current/src/...ystem.lua.html
Also, as an additional question, once this does work how do I retrieve the player's @name that was clicked on for use in my function that the prehook calls?