View Single Post
03/10/23, 03:03 PM   #8
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,913
The library provides you the "entry" (a hook into vanilla code), via acallback function with fixed parameter (rowData) which is fired as the context menu is build by vanilla code.
You "Register" your callback function, just like you register your callback for an event or register a callback for a CALLBACK_MANAGER:FireCallbacks(.. function trigger.
And then this function is executed as the vanilla code runs, and assists you with compatibility for addons, and vanilla code, and an easy way to add your own entries to the context menu.

So yes, inside your callback you need to add a custom menu entyr IF this is your goal in the end.
The callback function func(rowData) should be usedto do so and you have the benefit of already knowing rowData and it's values so you could add teh contexmenu entry based on that rowData information, e.g.

Code:
if rowData.displayName and rowData.displayName == GetDisplayName() then do something for your own user else do something for another user end

Attention: Do not call ClearMenu() inside that callback as else it will clear the total ZO_Menu and all vanilla and other addon context meneu entries will be gone!
  Reply With Quote