Skip to main content

Menu

enum PopupType

PopupType = {
-- Represents a prominent notification. It appears as a rectangle on the right side
-- of the screen and is used for important alerts that are less frequent but need
-- significant attention.
BOX = 0,

-- Represents a less obtrusive, single-lined popup notification. It is used for
-- frequent but less critical information, appearing as a simple text with a
-- background fill.
LINE = 1
}

enum PageColumn

PageColumn = {
--- The first column index.
FIRST = 1,
--- The second column index.
SECOND = 2,
--- The third column index.
THIRD = 3,
}

enum GroupRect

GroupRect = {
--- Represents the whole block including title and body.
FULL = 0,
--- Represents only the title area up to the separator.
TITLE = 1,
--- Represents only the content area below the separator.
BODY = 2,
}

enum Icons

Icons = {
INVALID = 0,

FIRST_ICON = 59648,
LAST_ICON = 59710,

ARROW_DOWN = 59648,
ARROW_UP = 59649,
CAR = 59650,
COLOR_PALETTE = 59651,
CONTRAST = 59652,
EXTENSION_PUZZLE = 59653,
EYE = 59654,
FISH = 59655,
FLASH = 59656,
GRID = 59657,
HARDWARE_CHIP = 59658,
LOGO_BUFFER = 59659,
PEOPLE = 59660,
PERSON = 59661,
PLANET = 59662,
SAVE = 59663,
SETTINGS = 59664,
SHIELD = 59665,
SKULL = 59666,
SPEEDOMETER = 59667,
TRASH = 59668,
WALLET = 59670,
SEARCH = 59671,
CANCEL = 59672,
CLOUD_DOWNLOAD = 59673,
CLOUD_UPLOAD = 59674,
CLOUD_DISCONNECTED = 59675,
CLOUD_SUCCESS = 59676,
EXCLAMATION_TRIANGLE = 59677,
SHIELD_SUCCESS = 59678,
SQUARE_CHECKMARK_SUCCESS = 59679,
CIRCLE_CANCEL = 59680,
GAMEPAD = 59681,
CROSSHAIR = 59682,
MIDNIGHT_HEADER_LOGO = 59683,
CHECKMARK_SUCCESS = 59684,
CANCEL2 = 59685,
PEN = 59686,
SHARE = 59687,
DOWNLOAD = 59688,
CLOUD = 59689,
GUN = 59690,
MOVEMENT = 59691,
WHEELCHAIR_MOVE = 59692,
EXCLAMATION_CIRCLE = 59693,
KEYBOARD = 59694,
MIDNIGHT_LOGO = 59695,
THREE_DOTS = 59696,
REFRESH = 59697,
PLUS = 59698,
COPY = 59699,
FILE = 59700,
CAR2 = 59701,
CARD = 59702,
EARTH = 59703,
BACKSPACE = 59704,
KARAMBIT = 59705,
GRIPDOTS = 59706,
PORTAL = 59707,
SPOOFING = 59708,
UI = 59709,
ETHERNET = 59710
}

ui.is_opened

Checks if the UI menu is currently opened.

  • Return
TypeDescription
boolReturns true if the UI menu is currently open, false otherwise.
  • Methods
  • ui.is_opened()

ui.popup

Creates a popup window inside the game.

  • Parameters
NameTypeDescription
titlestringThe title of the popup.
bodystringThe content of the popup.
iconIconsThe icon of the popup.
typePopupTypeThe type of the popup.
  • Return
TypeDescription
booleanReturns true if the popup was successfully created.
  • Methods
    • ui.popup(title, body, icon, type)

ui.get_alpha

Retrieves the current alpha transparency of the UI.

  • Return
TypeDescription
numberThe alpha transparency value.
  • Methods
  • ui.get_alpha()

ui.get_size

Retrieves the size of the UI layout.

  • Return
TypeDescription
numberThe width of the UI layout.
numberThe height of the UI layout.
  • Methods
  • ui.get_size()

ui.get_position

Retrieves the position of the UI layout.

  • Return
TypeDescription
numberThe x (left) position of the UI layout.
numberThe y (top) position of the UI layout.
  • Methods
  • ui.get_position()

ui.get_mouse_position

Retrieves the current mouse position within the UI.

  • Return
TypeDescription
numberThe x coordinate of the mouse.
numberThe y coordinate of the mouse.
  • Methods
  • ui.get_mouse_position()

ui.get_scale

Retrieves the scale factor of the UI based on the DPI setting.

  • Return
TypeDescription
numberThe scale factor of the UI.
  • Methods
  • ui.get_scale()

ui.new_page

Creates a new page in the UI with a specified icon.

  • Parameters
NameTypeDescription
namestringThe name of the new page.
iconIconsThe icon to use for the new page.
  • Return
TypeDescription
MenuPageThe new page object or nil if the creation fails.
  • Methods
  • ui.new_page(name, icon)

ui.new_page

Creates a new page in the UI without specifying an icon.

  • Parameters
NameTypeDescription
namestringThe name of the new page.
  • Return
TypeDescription
MenuPageThe new page object or nil if the creation fails.
  • Methods
  • ui.new_page(name)

ui.get_all_widgets

Retrieves a table of all MenuWidgets currently available in the UI.

  • Return
TypeDescription
table[MenuWidget]A table containing all MenuWidgets.
  • Methods
  • ui.get_all_widgets()

ui.get_widget

Retrieves a specific MenuWidget by its unique identifier.

  • Parameters
NameTypeDescription
uuidnumberThe unique identifier of the widget.
  • Return
TypeDescription
MenuWidgetThe widget handle if found, or nil if no widget matches the given UUID.
  • Methods
  • ui.get_widget(uuid)

Creates a new subpage for a given page.

  • Parameters:

    NameTypeDescription
    namestringThe name of the new subpage.
  • Return:

    TypeDescription
    MenuSubPageThe new subpage object or nil if the creation fails.
  • Methods:

    • MenuPage:new_subpage(name)

If there are already existing tabs, the new group will be added to the first created tab.

  • Parameters:

    NameTypeDescription
    namestringThe name of the new group.
    posPageColumn?The position of the group within the page.
  • Return:

    TypeDescription
    MenuGroupReturns a MenuGroup object if the group is successfully created. Returns nil if the creation fails.
  • Methods:

    • MenuPage:new_group(name, pos)

Creates a new group within this submenu page.

  • Parameters:

    NameTypeDescription
    namestringThe name of the new group.
    posPageColumnThe position of the group within the submenu page.
  • Return:

    TypeDescription
    MenuGroupReturns a MenuGroup object if creation was successful, nil otherwise.
  • Methods:

    • MenuSubPage:new_group(name, pos)

Returns whether the group is collapsed.

  • Return:

    TypeDescription
    booleanReturns true if the group is collapsed.
  • Methods:

    • MenuGroup:is_collapsed()

Returns whether the group is collapsible.

  • Return:

    TypeDescription
    booleanReturns true if the group can be collapsed.
  • Methods:

    • MenuGroup:is_collapsible()

Returns whether the group is visible (being rendered).

  • Return:

    TypeDescription
    booleanReturns true if the group is visible.
  • Methods:

    • MenuGroup:is_visible()

Sets the group's collapsed state.

  • Parameters:

    NameTypeDescription
    statebooleanThe state to set, true to collapse the group, false to expand it.
  • Methods:
    • MenuGroup:set_collapsed(state)

Sets whether the group can be collapsed.

  • Parameters:

    NameTypeDescription
    statebooleanThe state to set, true if the group can be collapsed, false otherwise.
  • Methods:
    • MenuGroup:set_collapsible(state)

Sets the visibility of the group.

  • Parameters:

    NameTypeDescription
    statebooleanThe visibility state to set, true to show the group, false to hide it.
  • Methods:
    • MenuGroup:set_visible(state)

Creates a new checkbox within this group.

  • Parameters:

    NameTypeDescription
    namestringThe name of the checkbox.
    initbooleanThe initial state of the checkbox. Defaults to false if not specified.
  • Return:

    TypeDescription
    MenuWidgetReturns a checkbox widget if creation was successful.
  • Methods:

    • MenuGroup:new_checkbox(name, init)

Creates a new slider within this group.

  • Parameters:

    NameTypeDescription
    namestringThe name of the slider.
    minintegerThe minimum value of the slider.
    maxintegerThe maximum value of the slider.
    initintegerThe initial value of the slider. Defaults to the minimum value if not specified.
    scaleintegerThe step size of the slider. Defaults to 1 if not specified.
  • Return:

    TypeDescription
    MenuWidgetReturns a slider widget if creation was successful.
  • Methods:

    • MenuGroup:new_slider(name, min, max, init, scale)

This combo box allows for selection from a list of strings provided.

  • Parameters:

    NameTypeDescription
    namestringThe name of the combo box.
    ...stringThe list of options available in the combo box.
  • Return:

    TypeDescription
    MenuWidgetReturns a combo box widget if creation was successful.
  • Methods:

    • MenuGroup:new_combo(name, ...)

The text content is fixed and defined upon creation.

  • Parameters:

    NameTypeDescription
    textstringThe static text content to display in the widget.
  • Return:

    TypeDescription
    MenuWidgetReturns a text widget if creation was successful.
  • Methods:

    • MenuGroup:new_text(text)

The text content can change dynamically based on a Lua function.

  • Parameters:

    NameTypeDescription
    callbackfunctionA Lua function that returns the string to display.
  • Return:

    TypeDescription
    MenuWidgetReturns a text widget if creation was successful.
  • Methods:

    • MenuGroup:new_text(callback)

If no callback is provided, the button performs no action on click.

  • Parameters:

    NameTypeDescription
    namestringThe name of the button.
    callbackfunction?An optional Lua function that executes when the button is clicked.
  • Return:

    TypeDescription
    MenuWidgetReturns a button widget if creation was successful, nil if failed.
  • Methods:

    • MenuGroup:new_button(name, callback)

This allows for real-time updates and interactions based on the table's data.

  • Parameters:

    NameTypeDescription
    namestringThe name of the new list widget.
    ref_tabletableThe reference table containing elements that populate the list initially. Any changes to this table will dynamically update the list's content.
  • Return:

    TypeDescription
    MenuListReturns the new list as a MenuList object, which can be further configured.
  • Methods:

    • MenuGroup:new_table_list(name, ref_table)

This function initializes a list where items can be dynamically added or removed after its creation.

  • Parameters:

    NameTypeDescription
    namestringThe name of the new dynamic list widget.
  • Return:

    TypeDescription
    MenuListReturns the new dynamic list as a MenuList object, which can be further configured.
  • Methods:

    • MenuGroup:new_list(name)

The input field can include an initial value and a hint that appears when the field is empty.

  • Parameters:

    NameTypeDescription
    namestringThe name of the input field.
    hintstring?Optional hint text that appears in the input field when it is empty.
    initstring?Initial text to populate the input field with.
  • Return:

    TypeDescription
    MenuWidgetReturns an input field widget if creation was successful.
  • Methods:

    • MenuGroup:new_input(name, hint, init)

This function adds a simple line to visually distinguish between sections of the UI.

  • Return:

    TypeDescription
    MenuWidgetReturns a separator widget if creation was successful.
  • Methods:

    • MenuGroup:new_separator()

Creates a hotkey widget within this group.

  • Parameters:

    NameTypeDescription
    namestringThe name of the hotkey widget.
    default_keyinteger?The default key code to be set in the hotkey widget.
  • Return:

    TypeDescription
    MenuWidgetReturns a hotkey widget if creation was successful.
  • Methods:

    • MenuGroup:new_hotkey(name, default_key)

This widget allows users to input text and automatically generates a hash of the input.

  • Parameters:

    NameTypeDescription
    namestringThe name of the hasher widget.
    hintstring?An optional hint text that appears in the hasher input field when it is empty.
  • Return:

    TypeDescription
    MenuWidgetReturns a hasher widget if creation was successful.
  • Methods:

    • MenuGroup:new_hasher(name, hint)

If an invalid value or type is returned by the callback, or if an error occurs in the callback, visibility defaults to false.

  • Parameters:

    NameTypeDescription
    callbackfunctionA Lua function that determines the visibility of the group.
  • Return:

    TypeDescription
    MenuGroupReturns the group object itself.
  • Methods:

    • MenuGroup:set_visibility_callback(callback)

Retrieves the minimum drawing position of the specified groupbox region.

  • Methods:
    • MenuGroup:get_min(rect)

Retrieves the maximum drawing position of the specified groupbox region.

  • Methods:
    • MenuGroup:get_max(rect)

Retrieves the position of the arrow in the groupbox.

  • Methods:
    • MenuGroup:get_arrow_pos()

Retrieves the current value of a widget.

  • Return:

    TypeDescription
    anyReturns the current value of the widget.
  • Methods:

    • MenuWidget:get()

Sets a new value to a widget.

  • Parameters:

    NameTypeDescription
    valueanyThe value to set to the widget.
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set(value)

Returns the parent of the widget.

  • Return:

    TypeDescription
    MenuGroupReturns the parent group of the widget.
  • Methods:

    • MenuWidget:get_parent()

Retrieves the type name of the widget.

  • Return:

    TypeDescription
    stringReturns the type name of the widget.
  • Methods:

    • MenuWidget:get_type()

Checks if the widget is enabled.

  • Return:

    TypeDescription
    booleanReturns true if the widget is enabled, false otherwise.
  • Methods:

    • MenuWidget:is_enabled()

Sets the enabled state of the widget.

  • Parameters:

    NameTypeDescription
    valuebooleanThe enabled state to set.
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_enabled(value)

Checks if the widget is visible.

  • Return:

    TypeDescription
    booleanReturns true if the widget is visible, false otherwise.
  • Methods:

    • MenuWidget:is_visible()

Sets the visibility of the widget.

  • Parameters:

    NameTypeDescription
    valuebooleanThe visibility state to set.
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_visible(value)

Attaches a color picker to the widget that modifies the referenced color.

  • Parameters:

    NameTypeDescription
    colorColorThe color object whose values will be modified by the color picker.
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_color_picker(color)

Attaches a hint text to the widget.

  • Parameters:

    NameTypeDescription
    textstringThe hint text to display.
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_hint(text)

end)

  • Parameters:

    NameTypeDescription
    callbackfunction?The function to determine visibility. Returns bool (true to draw the widget, false to not draw it).
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_visibility_callback(callback)

end)

  • Parameters:

    NameTypeDescription
    callbackfunction?The function to determine if the widget is enabled. Returns bool (true if enabled, false if not).
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_enabled_callback(callback)

end)

  • Parameters:

    NameTypeDescription
    callbackfunction?The function to generate the label text. Returns string.
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_label_callback(callback)

end)

  • Parameters:

    NameTypeDescription
    callbackfunction?The callback to be invoked. Takes coordinates x and y as parameters (number x, number y).
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_hovered_callback(callback)

end)

  • Parameters:

    NameTypeDescription
    callbackfunction?The function to manage widget data. It should return a pointer to the data (returns void*).
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_data_callback(callback)

end)

  • Parameters:

    NameTypeDescription
    callbackfunction?The function to execute upon data change. Sends the new data value as the first argument.
  • Return:

    TypeDescription
    MenuWidgetReturns the widget itself for method chaining.
  • Methods:

    • MenuWidget:set_on_changed_callback(callback)

Example result: 609258681

  • Methods:
    • MenuWidget:get_uuid()

Example result: 'Godmode'

  • Methods:
    • MenuWidget:get_label()

Example result: 'Self > MAIN > Modifiers > Godmode'

  • Methods:
    • MenuWidget:get_deep_label()

Retrieves the minimum drawing position of the widget.

  • Methods:
    • MenuWidget:get_min()

Retrieves the maximum drawing position of the widget.

  • Methods:
    • MenuWidget:get_max()

Sets a getter callback for the list, which defines how each list item is represented as a text label.

  • Parameters:

    NameTypeDescription
    callbackfun(item:number):string The function to generate the label text for each item.
  • Return:

    TypeDescription
    MenuListReturns the list itself for method chaining.
  • Methods:

    • MenuList:set_getter_callback(callback)

Sets a counter callback for the list, which defines the number of items in the list.

  • Parameters:

    NameTypeDescription
    callbackfun():numberThe function to count the total number of items in the list.
  • Return:

    TypeDescription
    MenuListReturns the list itself for method chaining.
  • Methods:

    • MenuList:set_counter_callback(callback)

Sets a click callback for the list, which defines the action taken when an item is clicked.

  • Parameters:

    NameTypeDescription
    callbackfun(item:number) The function to execute when an item is clicked.
  • Return:

    TypeDescription
    MenuListReturns the list itself for method chaining.
  • Methods:

    • MenuList:set_click_callback(callback)

Sets a selected callback for the list, which checks if the specified item is selected.

  • Parameters:

    NameTypeDescription
    callbackfun(item:number):bool The function to determine if an item is selected.
  • Return:

    TypeDescription
    MenuListReturns the list itself for method chaining.
  • Methods:

    • MenuList:set_selected_callback(callback)

Sets a hovered callback for the list, which defines the action taken when an item is hovered over.

  • Parameters:

    NameTypeDescription
    callbackfun(item:number, caption: string, x: number, y: number) The function to execute when an item is hovered over.
  • Return:

    TypeDescription
    MenuListReturns the list itself for method chaining.
  • Methods:

    • MenuList:set_hovered_callback(callback)

Sets the dimensions of the list.

  • Parameters:

    NameTypeDescription
    widthnumberThe width of the list.
    heightnumberThe height of the list.
  • Methods:
    • MenuList:set_sizes(width, height)

Enables or disables the use of a search bar within the list.

  • Parameters:

    NameTypeDescription
    useboolWhether to use a search bar.
  • Return:

    TypeDescription
    MenuListReturns the list itself for method chaining.
  • Methods:

    • MenuList:set_use_search_bar(use)

Sets the placeholder text for the search bar in the list, if one is used.

  • Parameters:

    NameTypeDescription
    textstringThe placeholder text for the search bar.
  • Return:

    TypeDescription
    MenuListReturns the list itself for method chaining.
  • Methods:

    • MenuList:set_search_bar_text(text)

Checks if a specific item is selected in the list.

  • Parameters:

    NameTypeDescription
    itemnumberThe index of the item to check.
  • Return:

    TypeDescription
    booleanReturns true if the item is selected, false otherwise.
  • Methods:

    • MenuList:is_item_selected(item)

Retrieves the indices of all selected items in the list.

  • Return:

    TypeDescription
    tableReturns a table containing the indices of all selected items.
  • Methods:

    • MenuList:get_selected_items()

This function constructs a table containing the text for each selected item in the list. If no items are selected or an error occurs, it returns an empty table.

  • Return:

    TypeDescription
    tableReturns a table with the texts of the selected items. Each entry in the table corresponds to the text of one selected item.
  • Methods:

    • MenuList:get_selected_items_lines()

This function gets the text of the item at the specified index. If the item does not exist or an error occurs, it returns an empty string.

  • Parameters:

    NameTypeDescription
    itemnumberThe index of the item from which to retrieve the text.
  • Return:

    TypeDescription
    stringReturns the text of the specified item. If the item is not found, returns an empty string.
  • Methods:

    • MenuList:get_item_text(item)