multi_selection_t

local multi_selection = menu.add_multi_selection("group", "name", {"item1", "item2", "item3"})

get

returns whether the item is active, can either be indexed or by name

bool get(<int/string> item)

Example

print(multi_selection:get(1)) -- check if "item1" is active-- or...print(multi_selection:get("item1")) -- check if "item1" is active

set

sets whether an item is active, can either be indexed or by name

void set(<int/string> item, bool value)

Example

print(multi_selection:set(1, true)) -- set "item1" to active-- or...print(multi_selection:set("item1", true)) -- set "item1" to active

get_item_name

returns the item name for the passed index

string get_item_name(<int> item)

Example

print(multi_selection:get_item_name(1)) -- prints "item1"

get_items

returns an indexed table of all the items

string[] get_items()

Example

local items = multi_selection:get_items()print(items[0], items[1]) -- prints "item1" and "item2"

set_items

overrides the entire list of items

void set_items(string[] items)

Example

multi_selection:set_items({"new item1", "new item2"})

add_item

adds an item to the list

void add_item(string item)

Example

multi_selection:add_item("item4")

set_visible

sets whether this control is visible

void set_visible(<bool> is_visible)

Example

multi_selection:set_visible(true)

add_color_picker

adds a color picker sub control

color_picker_t add_color_picker(<string> name, [optional] <color_t> default_color, [optional] <bool> has_alpha)

Example

local colly = multi_selection:add_color_picker("bruh color")

add_keybind

adds a keybind sub control

keybind_t add_keybind(<string> name, [optional] <int> default_key)

Example

local keybind = multi_selection:add_keybind("bruh key")

Last updated