Skip to main content

Module menu

Module menu 

Source
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 Rect with only its columns given. Complete it with rows.
ContainerSlots
The not-yet-carved slots of a container being split across multiple sections.
DataSlot
A data slot handle created by the MenuBuilder::data_slot, to use for easy access instead of a bare index.
GridPlacer
Places rectangles on a grid scope. Created by MenuBuilder::grid.
Menu
A menu opened by a player: the shared click machinery plus one MenuKind.
MenuBehavior
Shared behavior and state for all menu types.
MenuBuilder
Builds a Menu.
PlacementBuilder
A pending placement, applied only when region or result is called.
PlayerInventorySections
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 Rect with only its rows given. Complete it with cols.
Section
A handle to a contiguous range of slots added to a MenuBuilder.

Enums§

FakeResultRemainderPolicy
What to do with fake result output that cannot fit during a shift-click.
FillDirection
The direction in which a slot range is walked when distributing items.
SectionKind
How a section lowers container indices into menu slots.

Traits§

IntoSections
Converts different types into an Iterator of sections so they can be passed into MenuBuilder::route
MenuKind
Per-menu behavior that isn’t shared: recompute-on-change, validity, close cleanup, and the optional shift-click override.
SectionSource
A supplier for ranges of slots in a ContainerRef. Allowing either making the whole Container a Section or splitting one Container into multiple Sections.
SpanBounds
A column or row selection for Rect::cols / Rect::rows: any range or a bare index.

Type Aliases§

SlotFactory
Produces the slot for one container index of a section.