ui

Functions to work with menu

find

ui.find(tab: string, group: string) MenuGroup

Finds menu group or returns nil if not found.

tab

ui.tab(name: string[, icon: Image])

Creates menu sidebar. You can get icon using render.load_image().

groupbox

ui.groupbox(tab: string, name: string) MenuGroup

Creates new groupbox in specified tab. Create tab first if needed.

is_open

ui.is_open() boolean

get_binds

ui.get_binds() Widget[]

Returns list of all bind widgets.

checkbox

group:checkbox(name: string[, init: boolean) Widget

label

group:label(name: string) Widget

color_picker

group:color_picker(name: string[, init: color]) Widget

Attaches a color picker to checkbox or label, if no widget with same name is found, label will be created.

keybind

group:keybind(name: string) Widget

Attaches a keybind to chekbox or label, if no widget with same name is found, label will be created.

slider_int

group:slider_int(name: string, min: number, max: number, init: number[, format: string]) Widget

slider_float

group:slider_float(name: string, min: number, max: number, init: number[, format: string]) Widget

Name
Type
Description

name

string

Widget name

min

number

Minimum value

max

number

Maximum value

init

number

Default value

format

string

Optional. Format string, example: "%d%%" will display value + %

combo

group:combo(name: string, elements: string, ...) Widget

Name
Type
Description

name

string

Widget name

elements

string

Comma separated elements

multicombo

group:multicombo(name: string, elements: string, ...) Widget

Name
Type
Description

name

string

Widget name

elements

string

Comma separated elements

button

group:button(name: string) Widget

input

group:input(name: string) Widget

Widget

get_name

widget:get_name() string

get

widget:get([index: number]) any

Get the widget value, for multicombos you must specify index. Indexes of combo and multicombo elements start from 0.

set

widget:set(value: any[, index: number])

Set widget value, for multicombos you must specify index. Indexes of combo and multicombo elements start from 0.

type

widget:type() string

set_callback

widget:set_callback(callback: function)

Adds a callback for the widget. The callback fires when the widget's value has changed.

visible

widget:visible([state: boolean]) boolean

Get or set widget visibility.

get_key

keybind:get_key() number

For keybinds only.

get_mode

keybind:get_mode() number

For keybinds only.

update_list

combo:update_list(values: string, ...)

Updates combo or multicombo element list. Pass comma separated elements or use table.unpack.

Last updated