Skip to content

MenuCheckboxItem

A menu item with a checkbox on the right.


// checkedValue: when this is set to true, the checkbox will be 'checked' by default.
bool checkedValue = false;
MenuCheckboxItem item = new MenuCheckboxItem("Checkbox Text", "Checkbox description.", checkedValue);
// Set the style:
item.Style = MenuCheckboxItem.CheckboxStyle.Cross;
// Add a menu item to a menu:
menu.AddMenuItem(item);

Toggling raises OnCheckboxChange on the parent menu. Checked is already updated when your handler runs, and newCheckedState holds the same value.

MenuCheckboxItem godMode = new MenuCheckboxItem("God mode", "Makes you invincible.", false);
menu.AddMenuItem(godMode);
menu.OnCheckboxChange += (_menu, _item, _index, _checked) =>
{
if (_item == godMode)
{
SetPlayerInvincible(Game.Player.Handle, _checked);
}
};

A disabled checkbox is greyed out and cannot be toggled.

menu.AddMenuItem(new MenuCheckboxItem("Premium feature", "Only available to donators.", false)
{
Enabled = false,
LeftIcon = MenuItem.Icon.LOCK
});

Constructor Description
MenuCheckboxItem(string text) Unchecked, no description.
MenuCheckboxItem(string text, bool _checked) No description, with the given checked state.
MenuCheckboxItem(string text, string description) Unchecked, with a description.
MenuCheckboxItem(string text, string description, bool _checked) With a description and the given checked state.

text is drawn on the left side of the row. description is shown below the menu while the item is highlighted.


Property Type Default value Description
Checked bool false The checked state.
Style CheckboxStyle CheckboxStyle.Tick What the checkbox shows when checked.

MenuCheckboxItem has no methods of its own.


The enum is MenuCheckboxItem.CheckboxStyle.

Style Default Example
CheckboxStyle.Tick Yes Style
CheckboxStyle.Cross No Style