MenuStyleThe display backend a Menu renders through — the value of Menu.style.
@s2script/sdk/menu
interactive player menus (chat + center backends).
import { MenuStyle } from "@s2script/sdk/menu";Author-time types ship in the npm package; the engine injects the runtime at plugin load.
Add @s2script/sdk to your plugin's dependencies.
Generated from the shipped type definitions.
MenuStyleThe display backend a Menu renders through — the value of Menu.style.
MenuCancelReasonWhy a menu closed without a selection — the MenuCancelEvent.reason.
MenuSelectEventPayload for Menu.onSelect — the item a player picked.
MenuCancelEventPayload for Menu.onCancel — a menu that closed without a selection.
MenuA slot-based interactive menu. Add items, wire Menu.onSelect/Menu.onCancel, then Menu.display to a player slot. The model paginates automatically (7 items per chat page) and picks a renderer by Menu.style, falling back to Chat when the style's renderer is unregistered. Only one menu is active per slot; displaying a new one supersedes the old (MenuCancelReason.NewMenu).
import { Menu, MenuStyle } from "@s2script/sdk/menu";
const m = new Menu("s2script Menu Demo");
m.style = MenuStyle.Center;
m.freezePlayer = true; // freeze movement while the WASD menu is open (nav still works)
m.addItem("hp", "Heal to 100");
m.addItem("noclip", "Toggle Noclip");
m.onSelect(e => { console.log(`picked ${e.info} (slot ${e.slot})`); });
m.display(slot, 30);MenuSessionA live display of one menu to one slot, passed to a MenuRenderer. Owns the page/cursor state and exposes the input verbs a renderer drives.
MenuLineOne rendered line of a MenuSession view.
MenuRendererA display backend for Menu — registered via Menu.registerRenderer, driven with a MenuSession.