Package net.runelite.api
Interface MenuEntry
-
public interface MenuEntryA menu entry in a right-click menu.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MenucreateSubMenu()Create a new submenu for this menu entry.voiddeleteSubMenu()Remove the submenu from this menu entry.ActorgetActor()Get theActorthis menu entry is targeting, if any.intgetIdentifier()An identifier value for the target of the action.intgetItemId()Get the item idintgetItemOp()If this menu entry is an item op, get the item op idNPCgetNpc()Get theNPCthis menu entry is targeting, if any.StringgetOption()The option text added to the menu.intgetParam0()An additional parameter for the action.intgetParam1()A second additional parameter for the action.PlayergetPlayer()Get thePlayerthis menu entry is targeting, if any.MenugetSubMenu()Get the submenu for this menu entry.StringgetTarget()The target of the action.MenuActiongetType()The action the entry will trigger.WidgetgetWidget()Get the widget this menu entry is on, if this is a menu entry with an associated widget.intgetWorldViewId()booleanisDeprioritized()Deprioritized menus are sorted in the menu to be below the other menu entries.booleanisForceLeftClick()If this is true and you have single mouse button on and this entry is the top entry the right click menu will not be opened when you left click This is used for shift clickbooleanisItemOp()Test if this menu entry is an item op.Consumer<MenuEntry>onClick()Get the callback called when the menu option is clickedMenuEntryonClick(Consumer<MenuEntry> callback)Set a callback to be called when this menu option is clickedMenuEntrysetDeprioritized(boolean deprioritized)MenuEntrysetForceLeftClick(boolean forceLeftClick)MenuEntrysetIdentifier(int identifier)MenuEntrysetItemId(int itemId)Set the item idMenuEntrysetOption(String option)MenuEntrysetParam0(int param0)MenuEntrysetParam1(int param1)MenuEntrysetTarget(String target)MenuEntrysetType(MenuAction type)MenuEntrysetWorldViewId(int worldViewId)
-
-
-
Method Detail
-
getOption
String getOption()
The option text added to the menu. (ie. "Walk here", "Use")
-
getTarget
String getTarget()
The target of the action. (ie. Item or Actor name)If the option does not apply to any target, this field will be set to empty string.
-
getIdentifier
int getIdentifier()
An identifier value for the target of the action.
-
setIdentifier
MenuEntry setIdentifier(int identifier)
-
getType
MenuAction getType()
The action the entry will trigger.
-
setType
MenuEntry setType(MenuAction type)
-
getParam0
int getParam0()
An additional parameter for the action.
-
setParam0
MenuEntry setParam0(int param0)
-
getParam1
int getParam1()
A second additional parameter for the action.
-
setParam1
MenuEntry setParam1(int param1)
-
isForceLeftClick
boolean isForceLeftClick()
If this is true and you have single mouse button on and this entry is the top entry the right click menu will not be opened when you left click This is used for shift click
-
setForceLeftClick
MenuEntry setForceLeftClick(boolean forceLeftClick)
-
getWorldViewId
int getWorldViewId()
-
setWorldViewId
MenuEntry setWorldViewId(int worldViewId)
-
isDeprioritized
boolean isDeprioritized()
Deprioritized menus are sorted in the menu to be below the other menu entries.- Returns:
-
setDeprioritized
MenuEntry setDeprioritized(boolean deprioritized)
-
onClick
MenuEntry onClick(Consumer<MenuEntry> callback)
Set a callback to be called when this menu option is clicked- Parameters:
callback-- Returns:
-
onClick
Consumer<MenuEntry> onClick()
Get the callback called when the menu option is clicked- Returns:
-
isItemOp
boolean isItemOp()
Test if this menu entry is an item op. "Use" and "Examine" are not considered item ops.- Returns:
-
getItemOp
int getItemOp()
If this menu entry is an item op, get the item op id- Returns:
- 1-5
-
getItemId
int getItemId()
Get the item id- Returns:
- See Also:
ItemID
-
setItemId
MenuEntry setItemId(int itemId)
Set the item id- Parameters:
itemId-- Returns:
-
getWidget
@Nullable 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:
-
getPlayer
@Nullable Player getPlayer()
Get thePlayerthis menu entry is targeting, if any.- Returns:
-
getSubMenu
@Nullable Menu getSubMenu()
Get the submenu for this menu entry.- Returns:
- the submenu, or null if one doesn't exist
- See Also:
createSubMenu()
-
createSubMenu
@Nonnull Menu createSubMenu()
Create a new submenu for this menu entry. This will erase any previous submenu.- Returns:
- the new submenu
-
deleteSubMenu
void deleteSubMenu()
Remove the submenu from this menu entry.
-
-