Skip to main content
Version: 14.x (API 14) [Current]

Interface IContextMenu

This class provides methods for interacting with the game's context menu.

Assembly: Dalamud.dll
Declaration
public interface IContextMenu : IDalamudService

Methods

AddMenuItem(ContextMenuType, IMenuItem)

Adds a menu item to a context menu.

Declaration
void AddMenuItem(ContextMenuType menuType, IMenuItem item)
Parameters
TypeNameDescription
Dalamud.Game.Gui.ContextMenu.ContextMenuTypemenuTypeThe type of context menu to add the item to.
Dalamud.Game.Gui.ContextMenu.IMenuItemitemThe item to add.
Remarks

Used to add a context menu entry to all context menus.

RemoveMenuItem(ContextMenuType, IMenuItem)

Removes a menu item from a context menu.

Declaration
bool RemoveMenuItem(ContextMenuType menuType, IMenuItem item)
Returns

System.Boolean: true if the item was removed, false if it was not found.

Parameters
TypeNameDescription
Dalamud.Game.Gui.ContextMenu.ContextMenuTypemenuTypeThe type of context menu to remove the item from.
Dalamud.Game.Gui.ContextMenu.IMenuItemitemThe item to add.
Remarks

Used to remove a context menu entry from all context menus.

Events

OnMenuOpened

Event that gets fired whenever any context menu is opened.

Declaration
event IContextMenu.OnMenuOpenedDelegate OnMenuOpened
Event Type

Dalamud.Plugin.Services.IContextMenu.OnMenuOpenedDelegate

Remarks

Use this event and then check if the triggering addon is the desired addon, then add custom context menu items to the provided args.