Back
The Elder Scrolls Online

LibCustomMenu

Overview

This library is for addon developers. Download it, if an addon dependency tells you so.

Info
This library is for addon developers. Download it, if an addon dependency tells you so.

Description
This library is written to overcome one way to get the "Access a private function XYZ from insecure code". But beginning with version 2.0, it does additional provide a new feature: sub menus.
Beginning with version 3.0, it does additional provide a new feature: divider.

Background
Controls, created from add-on code (as part of code path) are marked as "insecure/compromissed".
Functions, which have no problem with been called from "insecure" controls, are still working perfectly.
Like those of add-ons or Show On Map, Link in Chat or Get Help.
But "secured" functions like UseItem, InitiateDestroy, PickupInventoryItem raising the error message from above.
Once you hook AddMenuItem ALL controls created for the context-menu are "insecure".

Prior to ESO 2.0.13 if an add-on offers a full custom context-menu (no built-in menu entries) and this context-menu is shown first after (re-)load UI the first menu item controls are insecure. A crash of "Use" in the inventory afterwards was guaranteed.
Starting with ESO 2.0.13 ZOS preallocates 10 "secure" menu items. See here.
But this just reduces the chance of running into that problem, it does not fix it.
Currently the number of preallocated controls is 30. Running into this problem with AddMenuItem is real rare, but inventory action slots still don't like custom menu entries.

To avoid the error message, the controls of built-in menu items and add-on menu items must be strictly separated. That's what AddCustomMenuItem of this library does. It uses an own pool of controls, which look exactly the same. Sounds strange, but works.

I don't use private functions. Why should I use this lib?
It's not you, who uses private functions. It is built-in code, which re-uses controls indirectly created by your add-on in AddMenuItem.

I want to use this lib, so what to do?
After you have included the lib in your add-on manifest (.txt) do a text search for the global function AddMenuItem (not any :AddMenuItem of other objects) and replace it with AddCustomMenuItem.
Be careful with a simple "Replace All" over all files! You probably replace the AddMenuItem of LibCustomMenu itself ;)

Version 1.0
This version was intended as proof of concept, but was successfully used in Beartram's FCO Item Saver, Circonian's FilterIt and my Fish Fillet.

Version 2.0
In order to have more value than avoiding a rare, just annoying "bug", sirinsidiator suggested and provided proof of concept code for sub menu items.
A big thank to sirinsidiator!
I finalized it and here we are.

API 2.0
function AddCustomMenuItem(mytext, myfunction, itemType, myfont, normalColor, highlightColor, itemYPad)

Fully compatible with AddMenuItem.
mytext: string, required. Caption of menu item.
myfunction: function(), required. Called if clicked.
itemType: int, optional. MENU_ADD_OPTION_LABEL or MENU_ADD_OPTION_CHECKBOX. Default MENU_ADD_OPTION_LABEL.
myfont: string, optional.
normalColor: ZO_ColorDef, optional. Color of unselected item.
highlightColor: ZO_ColorDef, optional. Color of selected/hovered item.
itemYPad: int, optional. y-padding between items.

function AddCustomSubMenuItem(mytext, entries, myfont, normalColor, highlightColor, itemYPad, subMenuButtonCallbackFunc)

mytext: string, required. Caption of menu item.
entries: table of sub items or callback returning table of sub items, required.
myfont: string, optional.
normalColor: ZO_ColorDef, optional. Color of unselected/normal sub item.
highlightColor: ZO_ColorDef, optional. Color of selected/hovered sub item.
itemYPad: int, optional. y-padding between sub items.
subMenuButtonCallbackFunc: function, optional. Callback function for the click on the submenu open button (the one at the main menu showing the submenu)

sub item:
label: string or function(rootMenu, childControl), required.
callback: function(), required.
disabled: boolean or function(rootMenu, childControl), optional. Default false. if true, sub item is visible, but gray and not clickable.
visible: boolean or function(rootMenu, childControl), optional. Default true.

These examples are for self-created menus. If you want to add items to the inventory context-menu, look at the example for LibCustomMenu:RegisterContextMenu more below.

example 1:

example 2:

If you have Notebook or ZAM Notebook, you could copy&paste the scripts from above and execute them.

API 3.0
In addition to API 2.0:
Allow divider by setting member label to a static "-". Suggested by Beartram.

example:

API 4.1
In addition to API 3.0:
actionSlots:AddCustomSlotAction(actionStringId, actionCallback, actionType, visibilityFunction, options)

for example while hooking ZO_InventorySlot_DiscoverSlotActionsFromActionList(inventorySlot, slotActions)
for example within the callback of API 6.0. See below.

API 5.0
In addition to API 4.1+:
New entry properties itemType and checked.
itemType = MENU_ADD_OPTION_LABEL (default) or MENU_ADD_OPTION_CHECKBOX for a checkbox
checked = false/true or function() return state end
The initial checked state than opening the sub menu.

example:

API 6.2
In addition to API 5+:
Added callbacks, you can register to, to hook into inventory slot context menu. You don't need to reinvent the hook and are able to control the position of your entry/entries more granular.

category
lib.CATEGORY_EARLY
lib.CATEGORY_PRIMARY
lib.CATEGORY_SECONDARY
lib.CATEGORY_TERTIARY
lib.CATEGORY_QUATERNARY
lib.CATEGORY_LATE

CATEGORY_EARLY is before the first built-in menu entry.
CATEGORY_PRIMARY is after the first built-in menu entry. And so on.
CATEGORY_LATE is after built-in menu and default.

lib:RegisterContextMenu(func, category)
Register to the context menu of the inventory mouse right click.

lib:RegisterKeyStripEnter(func, category)
Register to the inventory mouse hover used to update the keybind buttons at the bottom.

func: callback function to be called.
Signature:

category: optional. defaults to CATEGORY_LATE.

lib:RegisterKeyStripExit(func)
Register to the inventory mouse hover used to update the keybind buttons at the bottom, if the mouse exits an inventory slot.

func: callback function to be called.
Signature:

example:

example 2:

Not really practical, because it hides the built-in keybind. :)
But you could use the callback just to be notified as well.

API 6.8
In addition to API 6.2+:
Added functionality to add an optional tooltip to a menu entry.
For the top level menu entries there is a new global function:
function AddCustomMenuTooltip(tooltip, index)
tooltip: Either a string shown as a simple tooltip or a callback function to let you do everything.
Signature:

control: the menu entry control.
inside: The function is called on mouse enter with inside=true and on mouse exit with inside=false.

index: Optional. Index of the menu entry, the tooltip is for. By default the index of the last added item is used. => You call AddCustomMenuItem and when AddCustomMenuTooltip.

For sub-menus a new key "tooltip" can be used. Again it is either a string or the callback function with the signature from above.

example:

How to use Checkbox at top level

API 6.9
lib:EnableSpecialKeyContextMenu(key)
key: KEY_CTRL or KEY_ALT or KEY_SHIFT or KEY_COMMAND
Show an alternative context menu, if the special key is pressed while right-clicking the inventory item.

lib:RegisterSpecialKeyContextMenu(func)
Register a callback for the alternative context menu. You, the addon author, have to check which menu items you want to add for the given combination of special keys. (See signature below)
You have to enable all the keys you want to handle. See lib:EnableSpecialKeyContextMenu(key). There is no DisableSpecialKeyContextMenu, because you don't know who else had enabled them.

Signature:

API 6.92
lib:RegisterPlayerContextMenu(func, category)
Register to the context menu of the chat player link mouse right click,

func: callback function to be called.
Signature:

Category: See API 6.2 description for the available categories.

API 7.1
lib:RegisterGuildRosterContextMenu(func, category)
Register to the context menu of the guild roster member mouse right click.

func: callback function to be called.
Signature:

API 7.2
lib:RegisterFriendsListContextMenu(func, category)
Register to the context menu of the friends list mouse right click.

lib:RegisterGroupListContextMenu(func, category)
Register to the context menu of the group list mouse right click.

Both analog to RegisterGuildRosterContextMenu. See above.

Example

ABOUT THIS LISTING

This page describes LibCustomMenu by votan. The description and screenshots are the author's own, imported from their listing on ESOUI on 14 August 2026: https://www.esoui.com/downloads/info1146-LibCustomMenu.html

Mythiq hosts no files for it. The download button goes straight to the release file on cdn.esoui.com, so you are downloading from the author's own host, not from a copy of ours.

The download count, rating and comments on this page start at zero and count Mythiq only. The source's own figures are not copied here — they measure a different site, and a number that cannot be checked against our own ledger is not worth printing.

Requirements

Game versions
  • 10.3.5
  • 10.2.0
API VERSION

Built for ESO API version 10.3.5, 10.2.0. After a patch the game marks add-ons built for the previous API as out of date; the "Allow out of date add-ons" checkbox in the add-on menu loads them anyway, and most work.

LIBRARIES

Many ESO add-ons depend on a shared library — LibAddonMenu-2.0 above all — which is installed separately, exactly like an add-on. A dependency that is missing shows as the add-on simply not appearing in the list.

CONSOLE

Add-ons are PC and Mac only. There is no way to load them on console.

Installation

1. Download the archive with the button on this page and unzip it.

2. Move the unzipped folder into your add-ons directory:

Windows — Documents\Elder Scrolls Online\live\AddOns

macOS — ~/Documents/Elder Scrolls Online/live/AddOns

3. Start the game, and at the character select screen click Add-Ons.

4. Tick the add-on. If it is greyed out and marked out of date, tick "Allow out of date add-ons" at the top of the same panel.

5. Log in. Most add-ons need a /reloadui after they are first enabled.

UPDATING

Delete the old folder first. ESO loads everything it finds, and two copies of one add-on is the usual cause of "an add-on has produced an error" on login.

This release downloads from cdn.esoui.com, not from us, so there is no checksum to compare against. Scan the archive before you unpack it.

Version history

  1. v7.3.0 Latest 2 Feb 2025 · 8.6 KB via cdn.esoui.com · 0 downloads Download
    version 7.3.0:
    - New function RegisterIgnoreListContextMenu as requested.
    How could I ignore it :D

    version 7.2.2:
    - Fixed height calculation.
    - Added hook-point for LibScrollableMenu.

    version 7.2.1:
    - Fixed nil error in AddCustomMenuItem. Sorry.

    version 7.2.0:
    - New functions RegisterFriendsListContextMenu and RegisterGroupListContextMenu as requested.

    version 7.1.3:
    - Update for "High Isle".

    version 7.1.2:
    - Fix for U32 adding a divider to header menu item. Thanks to @silvereyes.

    version 7.1.1:
    - Fixed issue with Shissu's Guild Tools. Thanks to @marcbf for reporting.

    version 7.1.0:
    - New API function RegisterGuildRosterContextMenu. Requested by @Saenic.

    version 7.0.1:
    - Allow to click sub-menu button itself. (a bit like a DropDown-Button)
    - Allow to refresh/change other sub-menu items with clicking a checkbox menu item.

    version 7.0.0:
    - Removed LibStub support
    - Added new menu item type: MENU_ADD_OPTION_HEADER

    version 6.9.5:
    - Update to API 100034 "Flames of Ambition".

    version 6.9.4:
    - Update to API 100033 "Markarth".

    version 6.9.3:
    - Update to API 100032 "Stonethorn".

    version 6.9.2. Upon request added a new function RegisterPlayerContextMenu to added menu items to the player context menu of the chat.

    version 6.9.1: Forgotten to increase the version number for LibStub legacy support. Added a warning, if LibStub has a "newer" version, which should not be!

    version 6.9.0:
    - Support keyboard modifier keys for inventory context menu to create special menus using those keys.

    version 6.8.2:
    - Update to API 100030 "Harrowstorm".

    version 6.8.1:
    - Update to API 100029 "Dragonhold".

    version 6.8.0:
    - Fix layout of built-in checkbox button of menu top level entries
    - Added tooltip support: Either callback function or text string.

    version 6.7.1:
    - Update to API 100028 "Scalebreaker".

    version 6.7.0:
    - API bump 100027 "Elsweyr".
    - Accessible via LibCustomMenu.
    - Use of LibStub is optional.

    version 6.6.3:
    - Update to API 100026 "Wrathstone".

    version 6.6.2:
    - Reverted back to depend on LibStub. It is too early for that.

    version 6.6.1:
    - Update to API 100025 "Murkmire".
    - Work without LibStub as well.

    version 6.6:
    - Update to API 100024 "Wolfhunter".
    - New library load structure.

    version 6.5: Fix for PTS.

    version 6.4: Fixed compatibility with other addons hooking the context-menu. Like Craft Bag Extended.

    version 6.3:
    - Improve compabitility with AGS.

    version 6.2:
    - Handle inventory context menu and key strip menu. Take 2.

    version 6.1:
    - Fixed a conflict with CraftBagExtended.

    version 6:
    - Handle inventory context menu and key strip menu.

    version 5:
    - Supporting checkboxes in submenus.
    - Fixed Divider menu item.

    version 4.3:
    - Update for "Horns of the Reach".

    version 4.2.0:
    - Fixed rare timing issue closing menu while mouse is over sub-menu.
    - APIVersion update to 100017.

    version 4.1.1:
    - APIVersion update to 100014.

    version 4.1:
    - Added ZO_InventorySlotActions:AddCustomSlotAction. (Requested by merlight)
    - APIVersion update to 100013.

    version 4: * Working with Orsinium. Just the manifest APIVersion must be updated
    - Fixed issue: main menu not closing if sub-menu used outside inventory. Thanks to circonian.

    version 3:
    - New menu item type: Divider. A static text "-" will be displayed as a divider. You can use .DIVIDER for better readability.

    version 2:
    - New global function AddCustomSubMenuItem

    version 1:
    - New global function AddCustomMenuItem as a replacement for AddMenuItem.

    Off-site on cdn.esoui.com — no checksum, because we never held this file. Link checked by our review team on 14 Aug 2026.

Comments

No comments yet.

Sign in to leave a comment.

Report this mod

Tell us if something is wrong — a file that will not work, content taken from someone else, or anything that looks unsafe. Reports go to our review team, not to the author.

Sign in to report this mod.

We use cookies to ensure that we give you the best experience on our website and improve your experience. By continuing to use this site you consent to such use of cookies.

Learn More