Interface IMenuFactory


public interface IMenuFactory
Factory interface for creating menu builders for various game entity types.

This factory provides convenient methods to create pre-configured MenuBuilder instances for interacting with different types of game entities. Each factory method returns a specialized builder that understands the specific parameters required for that entity type.

The factory supports creating builders for:

  • Actors - Players and NPCs via player(int) and npc(int)
  • Items - Inventory, equipment, bank items via item methods
  • Tile Entities - Game objects and ground items via tile methods
  • Widgets - UI components via widget(int)

Example usage:


 IMenuFactory factory = Static.getMenuFactory();

 // Create a menu to attack an NPC
 AutomatedMenu attackMenu = factory.npc(npcIndex)
     .option("Attack")
     .build(clickPoint);

 // Create a menu to use an inventory item
 AutomatedMenu useMenu = factory.inventoryItem(itemId, slot)
     .option("Use")
     .build(clickPoint);
 

See Also:
  • Method Details

    • player

      ActorMenuBuilder player(int index)
      Creates a menu builder for interacting with a player.
      Parameters:
      index - the player's server index
      Returns:
      an actor menu builder pre-configured for player interactions
    • npc

      ActorMenuBuilder npc(int index)
      Creates a menu builder for interacting with an NPC.
      Parameters:
      index - the NPC's server index
      Returns:
      an actor menu builder pre-configured for NPC interactions
    • item

      ItemMenuBuilder item(int itemId, int slot, int widgetId)
      Creates a menu builder for interacting with an item in a specific widget.
      Parameters:
      itemId - the item's ID
      slot - the slot position within the widget
      widgetId - the widget ID containing the item
      Returns:
      an item menu builder pre-configured for the specified item
    • inventoryItem

      ItemMenuBuilder inventoryItem(int itemId, int slot)
      Creates a menu builder for interacting with an inventory item.

      This is a convenience method that uses the standard inventory widget ID.

      Parameters:
      itemId - the item's ID
      slot - the inventory slot (0-27)
      Returns:
      an item menu builder pre-configured for inventory interactions
    • equipmentItem

      ItemMenuBuilder equipmentItem(int itemId, EquipmentSlot slot)
      Creates a menu builder for interacting with an equipped item.
      Parameters:
      itemId - the item's ID
      slot - the equipment slot
      Returns:
      an item menu builder pre-configured for equipment interactions
    • bankItem

      ItemMenuBuilder bankItem(int itemId, int slot)
      Creates a menu builder for interacting with an item in the bank.
      Parameters:
      itemId - the item's ID
      slot - the bank slot position
      Returns:
      an item menu builder pre-configured for bank item interactions
    • bankInventoryItem

      ItemMenuBuilder bankInventoryItem(int itemId, int slot)
      Creates a menu builder for interacting with an inventory item while banking.

      This handles the inventory panel visible during bank interface interactions.

      Parameters:
      itemId - the item's ID
      slot - the inventory slot (0-27)
      Returns:
      an item menu builder pre-configured for bank inventory interactions
    • tileObject

      TileEntityMenuBuilder tileObject(int objectId, int sceneX, int sceneY)
      Creates a menu builder for interacting with a tile object (game object).

      Tile objects include walls, decorations, interactive objects like trees, rocks, doors, and other scenery that can be interacted with.

      Parameters:
      objectId - the game object's ID
      sceneX - the X coordinate in scene coordinates
      sceneY - the Y coordinate in scene coordinates
      Returns:
      a tile entity menu builder pre-configured for object interactions
    • tileItem

      TileEntityMenuBuilder tileItem(int itemId, int sceneX, int sceneY)
      Creates a menu builder for interacting with a ground item.

      Ground items are items lying on the game world floor that can be picked up or examined.

      Parameters:
      itemId - the item's ID
      sceneX - the X coordinate in scene coordinates
      sceneY - the Y coordinate in scene coordinates
      Returns:
      a tile entity menu builder pre-configured for ground item interactions
    • widget

      WidgetMenuBuilder widget(int widgetId)
      Creates a menu builder for interacting with a UI widget.

      Widgets include buttons, dialog options, interface controls, and other UI elements that can be clicked.

      Parameters:
      widgetId - the packed widget ID (parentId invalid input: '<'invalid input: '<' 16 | childId)
      Returns:
      a widget menu builder pre-configured for widget interactions