Interface IMenuFactory
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)andnpc(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 Summary
Modifier and TypeMethodDescriptionbankInventoryItem(int itemId, int slot) Creates a menu builder for interacting with an inventory item while banking.bankItem(int itemId, int slot) Creates a menu builder for interacting with an item in the bank.equipmentItem(int itemId, EquipmentSlot slot) Creates a menu builder for interacting with an equipped item.inventoryItem(int itemId, int slot) Creates a menu builder for interacting with an inventory item.item(int itemId, int slot, int widgetId) Creates a menu builder for interacting with an item in a specific widget.npc(int index) Creates a menu builder for interacting with an NPC.player(int index) Creates a menu builder for interacting with a player.tileItem(int itemId, int sceneX, int sceneY) Creates a menu builder for interacting with a ground item.tileObject(int objectId, int sceneX, int sceneY) Creates a menu builder for interacting with a tile object (game object).widget(int widgetId) Creates a menu builder for interacting with a UI widget.
-
Method Details
-
player
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
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
Creates a menu builder for interacting with an item in a specific widget.- Parameters:
itemId- the item's IDslot- the slot position within the widgetwidgetId- the widget ID containing the item- Returns:
- an item menu builder pre-configured for the specified item
-
inventoryItem
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 IDslot- the inventory slot (0-27)- Returns:
- an item menu builder pre-configured for inventory interactions
-
equipmentItem
Creates a menu builder for interacting with an equipped item.- Parameters:
itemId- the item's IDslot- the equipment slot- Returns:
- an item menu builder pre-configured for equipment interactions
-
bankItem
Creates a menu builder for interacting with an item in the bank.- Parameters:
itemId- the item's IDslot- the bank slot position- Returns:
- an item menu builder pre-configured for bank item interactions
-
bankInventoryItem
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 IDslot- the inventory slot (0-27)- Returns:
- an item menu builder pre-configured for bank inventory interactions
-
tileObject
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 IDsceneX- the X coordinate in scene coordinatessceneY- the Y coordinate in scene coordinates- Returns:
- a tile entity menu builder pre-configured for object interactions
-
tileItem
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 IDsceneX- the X coordinate in scene coordinatessceneY- the Y coordinate in scene coordinates- Returns:
- a tile entity menu builder pre-configured for ground item interactions
-
widget
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
-