Interface MenuEntry

  • public interface MenuEntry
    A menu entry in a right-click menu.
    • Method Detail

      • getOption

        java.lang.String getOption()
        The option text added to the menu. (ie. "Walk here", "Use")
      • setOption

        MenuEntry setOption​(java.lang.String option)
      • getTarget

        java.lang.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.

      • setTarget

        MenuEntry setTarget​(java.lang.String target)
      • 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.
      • 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)
      • isDeprioritized

        boolean isDeprioritized()
        Deprioritized menus are sorted in the menu to be below the other menu entries.
      • setDeprioritized

        MenuEntry setDeprioritized​(boolean deprioritized)
      • onClick

        MenuEntry onClick​(java.util.function.Consumer<MenuEntry> callback)
        Set a callback to be called when this menu option is clicked
        callback -
      • setParent

        MenuEntry setParent​(MenuEntry parent)
        Set the parent for the menu entry. This makes this menu entry part of the sub-menu off of the parent.
        parent -
      • getParent

        MenuEntry getParent()
        Get the parent for the menu entry.
      • isItemOp

        boolean isItemOp()
        Test if this menu entry is an item op. "Use" and "Examine" are not considered item ops.
      • getItemOp

        int getItemOp()
        If this menu entry is an item op, get the item op id
      • getItemId

        int getItemId()
        Get the item id
        See Also:
        ItemID, NullItemID
      • getWidget

        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.
      • getNpc

        NPC getNpc()
        Get the NPC this menu entry is targeting, if any.
      • getPlayer

        Player getPlayer()
        Get the Player this menu entry is targeting, if any.
      • getActor

        Actor getActor()
        Get the Actor this menu entry is targeting, if any.