Interface MenuEntry


  • public interface MenuEntry
    A menu entry in a right-click menu.
    • 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.
      • 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.
        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:
      • 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.
        Parameters:
        parent -
        Returns:
      • getParent

        @Nullable
        MenuEntry getParent()
        Get the parent for the menu entry.
        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, NullItemID
      • 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:
      • getNpc

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

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

        @Nullable
        Actor getActor()
        Get the Actor this menu entry is targeting, if any.
        Returns: