Class MenuFactory

java.lang.Object
net.storm.sdk.interact.builder.MenuFactory

public class MenuFactory extends Object
Factory class for creating menu builders to interact with game entities.

MenuFactory provides a fluent API for constructing menu interactions with various game entities including:

  • Players and NPCs (actors)
  • Inventory, equipment, and bank items
  • Tile objects and ground items
  • Widgets

Each builder returned allows for customizing the interaction before executing it.

See Also:
  • Constructor Details

    • MenuFactory

      public MenuFactory()
  • Method Details

    • player

      public static ActorMenuBuilder player(int index)
      Creates a menu builder for interacting with a player.
      Parameters:
      index - the player's index in the player list
      Returns:
      a menu builder for the player
    • npc

      public static ActorMenuBuilder npc(int index)
      Creates a menu builder for interacting with an NPC.
      Parameters:
      index - the NPC's index in the NPC list
      Returns:
      a menu builder for the NPC
    • item

      public static 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 index within the widget
      widgetId - the widget's ID containing the item
      Returns:
      a menu builder for the item
    • inventoryItem

      public static ItemMenuBuilder inventoryItem(int itemId, int slot)
      Creates a menu builder for interacting with an inventory item.
      Parameters:
      itemId - the item's ID
      slot - the inventory slot index (0-27)
      Returns:
      a menu builder for the inventory item
    • equipmentItem

      public static 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:
      a menu builder for the equipped item
    • bankItem

      public static 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 index
      Returns:
      a menu builder for the bank item
    • bankInventoryItem

      public static ItemMenuBuilder bankInventoryItem(int itemId, int slot)
      Creates a menu builder for interacting with an item in the bank's inventory panel.
      Parameters:
      itemId - the item's ID
      slot - the inventory slot index while bank is open
      Returns:
      a menu builder for the bank inventory item
    • tileObject

      public static TileEntityMenuBuilder tileObject(int objectId, int sceneX, int sceneY)
      Creates a menu builder for interacting with a tile object (game object, wall, etc.).
      Parameters:
      objectId - the object's ID
      sceneX - the X coordinate in the scene
      sceneY - the Y coordinate in the scene
      Returns:
      a menu builder for the tile object
    • tileItem

      public static TileEntityMenuBuilder tileItem(int itemId, int sceneX, int sceneY)
      Creates a menu builder for interacting with a ground item.
      Parameters:
      itemId - the item's ID
      sceneX - the X coordinate in the scene where the item is located
      sceneY - the Y coordinate in the scene where the item is located
      Returns:
      a menu builder for the ground item
    • widget

      public static WidgetMenuBuilder widget(int widgetId)
      Creates a menu builder for interacting with a widget.
      Parameters:
      widgetId - the widget's packed ID (group invalid input: '<'invalid input: '<' 16 | child)
      Returns:
      a menu builder for the widget