IMenuBuilderAPI
Interfacepublic interface IMenuBuilderAPIProvides a fluent builder interface for creating and configuring menus. All methods support chaining for convenient menu construction.
View sourceProperties
Gets the design interface for this menu.
IMenuDesignAPI Design { get; }Methods
Adds an extra button to the menu that executes a custom action when pressed.
IMenuBuilderAPI AddExtraButton(KeyBind keyBind, string label, Action<IPlayer, IMenuAPI> action)Extra buttons are displayed in the menu footer and allow custom actions beyond standard menu navigation. The keybind should not conflict with existing menu navigation keys.
Adds a menu option to the menu.
IMenuBuilderAPI AddOption(IMenuOption option)- optionIMenuOptionThe menu option to add.
Binds this menu to a parent menu, creating a hierarchical navigation structure.
IMenuBuilderAPI BindToParent(IMenuAPI parent)- parentIMenuAPIThe parent menu.
Builds the menu and returns the final menu instance.
IMenuAPI Build()Disables the exit button for this menu.
IMenuBuilderAPI DisableExit()Disables sound effects for menu interactions.
IMenuBuilderAPI DisableSound()Enables the exit button for this menu.
IMenuBuilderAPI EnableExit()Enables sound effects for menu interactions.
IMenuBuilderAPI EnableSound()Sets the automatic close delay for the menu.
IMenuBuilderAPI SetAutoCloseDelay(float seconds = 0)- secondsfloatoptionalTime in seconds before the menu automatically closes. Set to 0 to disable auto-close. Default is 0.
Overrides the default key binding for closing the menu.
IMenuBuilderAPI SetExitButton(KeyBind keyBind)- keyBindKeyBindThe key binding to use.
This overrides the default exit button behavior. Supports multiple key bindings using the bitwise OR operator. Example: KeyBind.Esc | KeyBind.A allows either Esc or A to close the menu.
Overrides the default key binding for moving backward through menu options.
IMenuBuilderAPI SetMoveBackwardButton(KeyBind keyBind)- keyBindKeyBindThe key binding to use.
This overrides the default move backward button behavior. Supports multiple key bindings using the bitwise OR operator. Example: KeyBind.S | KeyBind.Mouse2 allows either S or Mouse2 to move backward.
Overrides the default key binding for moving forward through menu options.
IMenuBuilderAPI SetMoveForwardButton(KeyBind keyBind)- keyBindKeyBindThe key binding to use.
This overrides the default move forward button behavior. Supports multiple key bindings using the bitwise OR operator. Example: KeyBind.W | KeyBind.Mouse1 allows either W or Mouse1 to move forward.
Controls whether player movement is frozen while the menu is open.
IMenuBuilderAPI SetPlayerFrozen(bool frozen = false)- frozenbooloptionalTrue to freeze player movement, false to allow movement. Default is false.
Overrides the default key binding for selecting menu options.
IMenuBuilderAPI SetSelectButton(KeyBind keyBind)- keyBindKeyBindThe key binding to use.
This overrides the default select button behavior. Supports multiple key bindings using the bitwise OR operator. Example: KeyBind.Mouse1 | KeyBind.E allows either Mouse1 or E to select options.