Expand description
Contains the Menu API
Modules§
- behavior 🔒
- Slots, client-sync state, and click handling shared by every menu.
- builder 🔒
- A declarative builder for assembling
MenuBehaviors. - grid 🔒
- Builds sections by placing rectangles on a canvas instead of placing sections by hand.
- kind 🔒
- Per-menu behavior hooks.
- kinds
- Vanilla menu kind implementations.
- layout 🔒
Structs§
- ColSpan
- A
Rectwith only its columns given. Complete it withrows. - Container
Slots - The not-yet-carved slots of a container being split across multiple sections.
- Data
Slot - A data slot handle created by the
MenuBuilder::data_slot, to use for easy access instead of a bare index. - Grid
Placer - Places rectangles on a grid scope. Created by
MenuBuilder::grid. - Menu
- A menu opened by a player: the shared click machinery plus one
MenuKind. - Menu
Behavior - Shared behavior and state for all menu types.
- Menu
Builder - Builds a Menu.
- Placement
Builder - A pending placement, applied only when
regionorresultis called. - Player
Inventory Sections - The sections that cover the player’s inventory.
- Rect
- A rectangle of grid cells, selected by column and row ranges. Coordinates are 0-based from the top-left of the scope the rect is used in.
- Region
- The sections created by a grid placement.
- RowSpan
- A
Rectwith only its rows given. Complete it withcols. - Section
- A handle to a contiguous range of slots added to a
MenuBuilder.
Enums§
- Fake
Result Remainder Policy - What to do with fake result output that cannot fit during a shift-click.
- Fill
Direction - The direction in which a slot range is walked when distributing items.
- Section
Kind - How a section lowers container indices into menu slots.
Traits§
- Into
Sections - Converts different types into an Iterator of sections so they can be passed into
MenuBuilder::route - Menu
Kind - Per-menu behavior that isn’t shared: recompute-on-change, validity, close cleanup, and the optional shift-click override.
- Section
Source - A supplier for ranges of slots in a
ContainerRef. Allowing either making the whole Container aSectionor splitting one Container into multiple Sections. - Span
Bounds - A column or row selection for
Rect::cols/Rect::rows: any range or a bare index.
Type Aliases§
- Slot
Factory - Produces the slot for one container index of a section.