Thread Tools Display Modes
04/01/17, 08:03 AM   #1
msfighter
Join Date: Apr 2017
Posts: 2
Add Menu Item

Hi Iīm very new to ESO UI Development.

Just a short question:

How can i add an entry to i.e. the guild memberlist context menu?

Thanks for your help.
  Reply With Quote
04/01/17, 08:26 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
Hi msfighter. Welcome to ESOUI!

In order to add new context menu items you first need to find a hook point where you can run your addon's code. The guild context menu is generated in guildroster_keyboard.lua starting from line 181. In the last line you can see that self:ShowMenu(control) is called. Which means you can prehook that method and then add your entries inbetween the ingame code's creation of menu entries and the actual code to show the menu like this:

Lua Code:
  1. ZO_PreHook(GUILD_ROSTER_KEYBOARD, "ShowMenu", function()
  2.     -- add your entry here like this:
  3.     AddCustomMenuItem("MyLabel", function()
  4.         -- the click handler
  5.     end)
  6. end)

Instead of calling AddMenuItem directly, you should always use the method AddCustomMenuItem provided by LibCustomMenu in order to prevent seemingly unrelated "secure code violation" errors in other parts of the UI.
  Reply With Quote
04/03/17, 01:07 AM   #3
msfighter
Join Date: Apr 2017
Posts: 2
Thanks, that worked fine...

And is there some kinde of help or API to see what entry Point i should start like "GUILD_ROSTER_KEYBOARD" :-) Itīs hard to find out myself.

So what do i Need to get guild bank Information for guildmember or information on selled items by the guildmerchant.

Thanks in advance and Kind regards.
  Reply With Quote
04/03/17, 06:14 AM   #4
AssemblerManiac
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 51
Originally Posted by msfighter View Post
Thanks, that worked fine...

And is there some kinde of help or API to see what entry Point i should start like "GUILD_ROSTER_KEYBOARD" :-) Itīs hard to find out myself.

So what do i Need to get guild bank Information for guildmember or information on selled items by the guildmerchant.

Thanks in advance and Kind regards.
Have a look at MasterMerchant if you want to scrape info from sales.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Add Menu Item

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off