Class MenuOption

java.lang.Object
dev.twilite.game.menu.MenuOption

public class MenuOption extends Object
A ready-to-submit game menu action.

Menu options are produced by wrappers such as NPCs, objects, items, and interface components. Calling enqueue() sends the option through the client's doAction path.

  • Method Details

    • builder

      public static MenuOption.Builder builder(String text, ActionType type)
      Starts building a menu option.
    • enqueue

      public boolean enqueue()
      Enqueues this option with the current client. Returns true when a client was available and the action was queued.
    • text

      public String text()
      Returns the visible option text.
    • type

      public ActionType type()
      Returns the option action type.
    • id

      public int id()
      Returns the primary value used by the client menu option.
    • target

      public Optional<? extends Unit> target()
      Resolves the entity targeted by this option when it has an entity typecode.