api: add item op menu api

This commit is contained in:
Adam
2022-04-18 20:14:53 -04:00
committed by Max Weber
parent eb0bbc6426
commit c683e41c01
2 changed files with 49 additions and 0 deletions

View File

@@ -95,6 +95,26 @@ public interface MenuEntry
*/
MenuEntry onClick(Consumer<MenuEntry> callback);
/**
* Test if this menu entry is an item op. "Use" and "Examine" are not considered item ops.
* @return
*/
boolean isItemOp();
/**
* If this menu entry is an item op, get the item op id
* @return 1-5
*/
int getItemOp();
/**
* If this menu entry is an item op, get the item id
* @return
* @see ItemID
* @see NullItemID
*/
int getItemId();
/**
* Get the widget this menu entry is on, if this is a menu entry
* with an associated widget. Such as eg, CC_OP.

View File

@@ -102,6 +102,35 @@ public class MenuOptionClicked
return menuEntry.getIdentifier();
}
/**
* Test if this menu entry is an item op. "Use" and "Examine" are not considered item ops.
* @return
*/
public boolean isItemOp()
{
return menuEntry.isItemOp();
}
/**
* If this menu entry is an item op, get the item op id
* @return 1-5
*/
public int getItemOp()
{
return menuEntry.getItemOp();
}
/**
* If this menu entry is an item op, get the item id
* @return
* @see net.runelite.api.ItemID
* @see net.runelite.api.NullItemID
*/
public int getItemId()
{
return menuEntry.getItemId();
}
/**
* Get the widget this menu entry is on, if this is a menu entry
* with an associated widget. Such as eg, CC_OP.