> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atlanta.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Menu

> The primary module for building and interacting with static widgets inside of the user interface. Provides functions to register widgets (labels, toggles, sliders, etc.) and manage configuration values.

***

<Warning>Functions within the `menu` table (e.g., `menu.add_toggle()`, `menu.add_slider()`) are **static registration calls** used to define the user interface layout. You **must not** call these functions inside frequently executed events (like `EventType.Draw` or `EventType.Tick`). They should only be called once, at the very beginning of your script's execution (on initialization or setup), to prevent instability and incorrect menu state.</Warning>

***

## Access

All menu C++ functions are exposed to your Lua script via a single global table named **`menu`**. You access individual values by using the dot (`.`) or bracket (`[]`) operator on this table.

```lua Menu Usage Example theme={null}
menu.add_toggle("Toggle ^_^", "toggle_global_key", true, false); -- Dot Operator
local menu_item = menu["get_item"]("toggle_global_key"); -- Bracket Operator
```

***

## Functions

This section lists all available C++ functions exposed within the global **`menu`** table. These functions allow you to register new widgets (labels, toggles, sliders, etc.), retrieve configuration values, and directly manipulate the user interface elements.

***

### add\_label

Registers a non-interactive label or section divider in the menu. Returns a boolean indicating the success of the item creation.

```lua theme={null}
add_label(string: name, boolean: safe?): boolean
```

<ParamField path="name" type="string" required>The text to display for the label.</ParamField>
<ParamField path="safe" type="boolean">The safe status for the widget. If `false`, the widget will be hidden when **Hide Unsafe** is enabled. Defaults to `true`.</ParamField>

### add\_toggle

Registers an interactive toggle switch widget in the menu. Returns a boolean indicating the success of the item creation.

```lua theme={null}
add_toggle(string: name, string: key, boolean?: default, boolean?: safe): boolean
```

<ParamField path="name" type="string" required>The text label displayed next to the toggle switch in the menu.</ParamField>
<ParamField path="key" type="string" required>The **unique configuration key** used to get and set the toggle's boolean value via `get_item` and `set_item`.</ParamField>
<ParamField path="default" type="boolean">The **default value** (initial state) for the toggle. Defaults to `false`.</ParamField>
<ParamField path="safe" type="boolean">The safe status for the widget. If `false`, the widget will be hidden when **Hide Unsafe** is enabled. Defaults to `true`.</ParamField>

### add\_slider\_int

Registers an interactive slider widget that allows selecting an integer value within a defined range. Returns a boolean indicating the success of the item creation.

```lua theme={null}
add_slider_int(string: name, string: key, number?: default, number?: min, number?: max, boolean?: safe): boolean
```

<ParamField path="name" type="string" required>The text label displayed next to the slider in the menu.</ParamField>
<ParamField path="key" type="string" required>The **unique configuration key** used to get and set the slider's integer value via `get_item` and `set_item`.</ParamField>
<ParamField path="default" type="number">The **default value** (initial state) of the slider. Defaults to `0`.</ParamField>
<ParamField path="min" type="number">The minimum value the slider can be set to. Defaults to `0`.</ParamField>
<ParamField path="max" type="number">The maximum value the slider can be set to. Defaults to `100`.</ParamField>
<ParamField path="safe" type="boolean">The safe status for the widget. If `false`, the widget will be hidden when **Hide Unsafe** is enabled. Defaults to `true`.</ParamField>

### add\_slider\_float

Registers an interactive slider widget that allows selecting an floating-point value within a defined range. Returns a boolean indicating the success of the item creation.

```lua theme={null}
add_slider_float(string: name, string: key, number?: default, number?: min, number?: max, boolean?: safe): boolean
```

<ParamField path="name" type="string" required>The text label displayed next to the slider in the menu.</ParamField>
<ParamField path="key" type="string" required>The **unique configuration key** used to get and set the slider's floating-point value via `get_item` and `set_item`.</ParamField>
<ParamField path="default" type="number">The **default value** (initial state) of the slider. Defaults to `0`.</ParamField>
<ParamField path="min" type="number">The minimum value the slider can be set to. Defaults to `0`.</ParamField>
<ParamField path="max" type="number">The maximum value the slider can be set to. Defaults to `100`.</ParamField>
<ParamField path="safe" type="boolean">The safe status for the widget. If `false`, the widget will be hidden when **Hide Unsafe** is enabled. Defaults to `true`.</ParamField>

### add\_single\_combo

Registers a single combo box widget that allows selecting a **single item** from a list of strings. Returns a boolean indicating the success of the item creation.

```lua theme={null}
add_single_combo(string: name, string: key, number?: default, table?: items, boolean?: safe): boolean
```

<ParamField path="name" type="string" required>The text label displayed next to the single combo box in the menu.</ParamField>
<ParamField path="key" type="string" required>The **unique configuration key** used to get and set the selected item's index (as a number) via `get_item` and `set_item`.</ParamField>
<ParamField path="default" type="number">The **initial 0-based index** (initial state) of the single combo box. Defaults to `0` (the first item).</ParamField>
<ParamField path="items" type="table">A Lua table (list) of strings defining the selectable options (e.g., `{"Option A", "Option B"}`). Defaults to an empty list.</ParamField>
<ParamField path="safe" type="boolean">The safe status for the widget. If `false`, the widget will be hidden when **Hide Unsafe** is enabled. Defaults to `true`.</ParamField>

### add\_multi\_combo

Registers a multi combo box widget that allows the user to select **multiple items** from a list of strings. Returns a boolean indicating the success of the item creation.

```lua theme={null}
add_multi_combo(string: name, string: key, table?: default, table?: items, boolean?: safe): boolean
```

<ParamField path="name" type="string" required>The text label displayed next to the multi combo box in the menu.</ParamField>
<ParamField path="key" type="string" required>The **unique configuration key** used to get and set the selected item indices (as a table of numbers) via `get_item` and `set_item`.</ParamField>
<ParamField path="default" type="table">A Lua table (list) of numbers defining the **initial 0-based indices** (initial state) of the multi combo box (e.g., `{0, 3, 4}`). Defaults to an empty list.</ParamField>
<ParamField path="items" type="table">A Lua table (list) of strings defining the selectable options (e.g., `{"Option A", "Option B"}`). Defaults to an empty list.</ParamField>
<ParamField path="safe" type="boolean">The safe status for the widget. If `false`, the widget will be hidden when **Hide Unsafe** is enabled. Defaults to `true`.</ParamField>

### add\_colorpicker

Registers a color picker widget that allows the user to choose an RGBA color. Returns a boolean indicating the success of the item creation.

```lua theme={null}
add_colorpicker(string: name, string: key, Color4?: default, boolean?: alpha, boolean?: inlayed): boolean
```

<ParamField path="name" type="string" required>The text label displayed next to the color picker in the menu.</ParamField>
<ParamField path="key" type="string" required>The **unique configuration key** used to get and set the colorpickers Color4 value via `get_item` and `set_item`.</ParamField>
<ParamField path="default" type="Color4">The **default color** (initial state) for the picker. Defaults to a fully white color (1, 1, 1, 1).</ParamField>
<ParamField path="alpha" type="boolean">If `true`, the color picker will include an Alpha (transparency) slider. Defaults to `true`.</ParamField>
<ParamField path="inlayed" type="boolean">If `true`, the color picker will be inlayed further down below the last widget. Defaults to `false`.</ParamField>

### add\_notification

Registers a notification widget that allows the user to optionally click a button with a callback.

```lua theme={null}
add_notification(NotificationType | number: type, string: title, string?: description, number?: time, string?: button_name, function?: callback): void
```

<ParamField path="type" type="NotificationType | number" required>The identifier type to be displayed inside of the notification.</ParamField>
<ParamField path="title" type="string" required>The title text label displayed inside of the notification.</ParamField>
<ParamField path="description" type="string">The description text label displayed inside of the notification.</ParamField>
<ParamField path="time" type="number">The time it takes for the notification to fade away in milliseconds.</ParamField>
<ParamField path="button_name" type="string">The text label displayed inside of the button.</ParamField>
<ParamField path="callback" type="function" required>The Lua function to be executed when the button on the notification is clicked.</ParamField>

### get\_item

Get the value of a specific script configuration value.

```lua theme={null}
get_item(string: key): any
```

<ParamField path="key" type="string" required>The unique string key of the configuration to get the value from.</ParamField>

### set\_item

Set the value of a specific script configuration value. Returns a boolean indicating the success of the set.

```lua theme={null}
set_item(string: key, any: value): boolean
```

<ParamField path="key" type="string" required>The unique string key of the configuration to set the value for.</ParamField>
<ParamField path="value" type="any" required>The new value to assign to the configuration. The value type must match the type of the configuration.</ParamField>

### get\_global

Get the value of a specific global configuration value.

```lua theme={null}
get_global(GlobalType: global, string: key): any
```

<ParamField path="global" type="GlobalType" required>The global section to get the configuration value from.</ParamField>
<ParamField path="key" type="string" required>The unique string key of the configuration to get the value from.</ParamField>

### set\_global

Set the value of a specific global configuration value. Returns a boolean indicating the success of the set.

```lua theme={null}
set_global(GlobalType: global, string: key, any: value): boolean
```

<ParamField path="global" type="GlobalType" required>The global section to set the configuration value for.</ParamField>
<ParamField path="key" type="string" required>The unique string key of the configuration to set the value for.</ParamField>
<ParamField path="value" type="any" required>The new value to assign to the configuration. The value type must match the type of the configuration.</ParamField>
