ui

Interact with menu.

All elements created in your script, you should not reference. However, they do return the item reference required to interact with your elements. If you're trying to interact with an existing menu item, you must reference the element before accessing it.

Functions:

Get

ui.get(item: number)

For a checkbox, returns true or false. For a slider, returns an integer. For a hotkey, returns true if the hotkey is active. For a color picker, returns table with r, g, b, a. For a dropdown, returns name of selected option. For a multiselect, returns a table of selected option names.

Set

ui.set(item: int, value: dynamic)

For checkboxes, pass true or false. For a slider, pass a number that is within the slider's minimum/maximum values. For color pickers, pass the arguments r, g, b, a in a table. For a dropdown, pass a name which is within the dropdowns options. For a multiselect pass a table of option names that are within the multiselects options.

Checkbox

ui.new_checkbox(string: tab, string: container, string: name)

Creates a toggle in the menu, has the ability to return true/false as a value. Returns an item reference as a number, which can be used to interact with the element itself.

Slider

Creates a slider in the menu, has the ability to return a number as a value. Returns an item reference as a number, which can be used to interact with the element itself.

ui.new_slider_int(string: tab, string: container, string: name, int: min, int: max, int: default)

Slider Float

Creates a slider in the menu, has the ability to return a number but in decimal form as a value. Returns an item reference as a number, which can be used to interact with the element itself.

ui.new_slider_float(string: tab, string: container, string: name, float: min, float: max, float: default)

Hotkey

Creates a hotkey in the menu, has the ability to return true/false as a value. Returns an item reference as a number, which can be used to interact with the element itself.

ui.new_hotkey(string: tab, string: container, string: name, int: key, int: mode, bool: inline)

Colorpicker

Creates a color picker in the menu, has the ability to return four numbers (r, g, b, a) as values. Returns an item reference as a number, which can be used to interact with the element itself.

ui.new_colorpicker(string: tab, string: container, string: name, int: r, int: g, int: b, int: a, bool: inline)

Text Input

Creates a text input in the menu, has the ability to return a string as a value. Returns an item reference as a number, which can be used to interact with the element itself.

ui.new_input_text(string: tab, string: container, name: string)

Creates a dropdown in the menu, has the ability to return a string as a value. Returns an item reference as a number, which can be used to interact with the element itself.

ui.new_dropdown(string: tab, string: container, name: string, table: options)

Multiselect

Creates a multiselect dropdown in the menu, has the ability to return a table containing names of selected options. Returns an item reference as a number, which can be used to interact with the element itself.

ui.new_multiselect(string: tab, string: container, name: string, table: options)

Button

ui.new_button(string: tab, string: container, name: string, function: callback)

Creates a new button in the menu, when pressed the function passed to the callback is triggered.

Reference

ui.reference(string: tab, string: container, name: string)

Returns an item reference as a number, which can be used to interact with the element itself.

Listbox

ui.new_listbox(string: tab, string: container, name: string, table: options)

Creates a listbox in the menu, has the ability to return the selected item index. Similar to the list that holds configuration preset names. Returns an item reference as a number, which can be used to interact with the element itself.

Set Visible

ui.set_visible(number: item, status: boolean)

Sets the visibility of a menu item.

Is Open

ui.is_open()

Returns true if the menu is currently open.

Last updated