Package net.runelite.api.events
Class MenuOptionClicked
- java.lang.Object
-
- net.runelite.api.events.MenuOptionClicked
-
public class MenuOptionClicked extends Object
An event where a menu option has been clicked.This event does not only trigger when clicking an option in a right-clicked menu. The event will trigger for any left click action performed (ie. clicking an item, walking to a tile, etc) as well as any right-click menu option.
By default, when there is no action performed when left-clicking, it seems that this event still triggers with the "Cancel" action.
-
-
Constructor Summary
Constructors Constructor Description MenuOptionClicked(MenuEntry menuEntry)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected booleancanEqual(Object other)voidconsume()Marks the event as having been consumed.booleanequals(Object o)intgetActionParam()Deprecated.intgetId()The ID of the object, actor, or item that the interaction targets.intgetItemId()If this menu entry is an item op, get the item idintgetItemOp()If this menu entry is an item op, get the item op idMenuActiongetMenuAction()The action performed.MenuEntrygetMenuEntry()The clicked menu entryStringgetMenuOption()The option text added to the menu.StringgetMenuTarget()The target of the action.intgetParam0()Action parameter 0.intgetParam1()Action parameter 1.WidgetgetWidget()Get the widget this menu entry is on, if this is a menu entry with an associated widget.intgetWidgetId()Deprecated.inthashCode()booleanisConsumed()Whether or not the event has been consumed by a subscriber.booleanisItemOp()Test if this menu entry is an item op.StringtoString()
-
-
-
Constructor Detail
-
MenuOptionClicked
public MenuOptionClicked(MenuEntry menuEntry)
-
-
Method Detail
-
getParam0
public int getParam0()
Action parameter 0. Its value depends on the menuAction.
-
getParam1
public int getParam1()
Action parameter 1. Its value depends on the menuAction.
-
getMenuOption
public String getMenuOption()
The option text added to the menu.
-
getMenuTarget
public String getMenuTarget()
The target of the action.
-
getMenuAction
public MenuAction getMenuAction()
The action performed.
-
getId
public int getId()
The ID of the object, actor, or item that the interaction targets.
-
isItemOp
public boolean isItemOp()
Test if this menu entry is an item op. "Use" and "Examine" are not considered item ops.- Returns:
-
getItemOp
public int getItemOp()
If this menu entry is an item op, get the item op id- Returns:
- 1-5
-
getItemId
public int getItemId()
If this menu entry is an item op, get the item id- Returns:
- See Also:
ItemID
-
getWidget
@Nullable public Widget getWidget()
Get the widget this menu entry is on, if this is a menu entry with an associated widget. Such as eg, CC_OP.- Returns:
-
consume
public void consume()
Marks the event as having been consumed.Setting this state indicates that a plugin has processed the menu option being clicked and that the event will not be passed on for handling by vanilla client code.
-
getActionParam
@Deprecated public int getActionParam()
Deprecated.
-
getWidgetId
@Deprecated public int getWidgetId()
Deprecated.
-
canEqual
protected boolean canEqual(Object other)
-
getMenuEntry
public MenuEntry getMenuEntry()
The clicked menu entry
-
isConsumed
public boolean isConsumed()
Whether or not the event has been consumed by a subscriber.
-
-