# ui

Responsible for creating and managing menu elements within the cheat interface.


# Functions

# ui.create_groupbox(tab: string, side: string, name: string, height: number)

ui.create_groupbox(tab: string, side: string, name: string, height: number)
  • Creates a groupbox within the specified tab of the menu.
secret.ui.create_groupbox("lua", "right", "elements", 200)

# ui.create_checkbox(tab: string, groupbox: string, name: string, config_name: string): number

ui.create_checkbox(tab: string, groupbox: string, name: string, config_name: string): number
  • Creates a checkbox UI element within the specified tab and groupbox of the menu.
  • Returns a numeric ID for the created element that can be used to update or remove it later.

# ui.create_button(tab: string, groupbox: string, name: string, callback: function): number

ui.create_button(tab: string, groupbox: string, name: string, callback: function): number
  • Creates a checkbox UI element within the specified tab and groupbox of the menu.
  • Returns a numeric ID for the created element that can be used to update or remove it later.

# ui.create_slider(tab: string, groupbox: string, name: string, min: number, max: number, config_name: string): number

ui.create_slider(tab: string, groupbox: string, name: string, min: number, max: number, config_name: string): number
  • Creates a slider UI element within the specified tab and groupbox of the menu.
  • Returns a numeric ID for the created element that can be used to update or remove it later.

# ui.create_colorpicker(tab: string, groupbox: string, name: string, config_name: string): number

ui.create_colorpicker(tab: string, groupbox: string, name: string, config_name: string): number
  • Creates a colorpicker UI element within the specified tab and groupbox of the menu.
  • Returns a numeric ID for the created element that can be used to update or remove it later.

# ui.create_inputbox(tab: string, groupbox: string, name: string, config_name: string): number

ui.create_inputbox(tab: string, groupbox: string, name: string, config_name: string): number
  • Creates an inputbox UI element within the specified tab and groupbox of the menu.
  • Returns a numeric ID for the created element that can be used to update or remove it later.

# ui.create_hotkey(tab: string, groupbox: string, name: string, config_name: string): number

ui.create_hotkey(tab: string, groupbox: string, name: string, config_name: string): number
  • Creates a hotkey UI element within the specified tab and groupbox of the menu.
  • Returns a numeric ID for the created element that can be used to update or remove it later.

# ui.create_dropdown(tab: string, groupbox: string, name: string, config_name: string, items: table, multi: boolean): number

ui.create_dropdown(tab: string, groupbox: string, name: string, config_name: string, items: table, multi: boolean): number
  • Creates a dropdown UI element within the specified tab and groupbox of the menu.
  • Returns a numeric ID for the created element that can be used to update or remove it later.
secret.ui.create_groupbox("lua", "right", "elements", 200) -- create a groupbox called "elements"

secret.ui.create_dropdown("lua", "elements", "My Lua Dropdown", "lua_dropdown", {"Item1", "Item2", "Item3"}, false)

# ui.create_playerlist_text(text: string, index: number): number

ui.create_playerlist_text(text: string, index: number): number
  • Creates a text UI element in the 'advanced' tab of the player identified by the given index.
  • Returns a numeric ID for the created element that can be used to update or remove it later.

# ui.create_playerlist_button(name: string, index: number, callback: function): number

ui.create_playerlist_button(name: string, index: number, callback: function): number
  • Creates a button UI element in the 'advanced' tab of the player identified by the given index.
  • Do note that the callback will return the index as a param.
  • Returns a numeric ID for the created element that can be used to update or remove it later.

# ui.update(index: number, new_value: string|table)

ui.update(index: number, new_value: string|table)
  • Updates the UI element at the given index.
secret.ui.update(checkbox_id, "New Checkbox Label")        -- update checkbox/button/inputbox label
secret.ui.update(button_id, "New Button Label")
secret.ui.update(inputbox_id, "New Input Label")

secret.ui.update(dropdown_id, {"NewItem1", "NewItem2"})

secret.ui.update(slider_id, { min = 0, max = 100 })

# ui.remove(index: number)

ui.remove(index: number)
  • Removes the UI element at the given index.
secret.ui.remove(checkbox_id)

# ui.update_groupbox(tab: string, groupbox_name: string, update_value: string|table|number)

ui.update_groupbox(tab: string, groupbox_name: string, update_value: string|table|number)
  • Updates properties of an existing groupbox.
-- Update groupbox name
secret.ui.update_groupbox("lua", "elements", "new_elements")

-- Update multiple properties
secret.ui.update_groupbox("lua", "elements", { name = "new_elements", side = "left", height = 150 })

-- Update height only
secret.ui.update_groupbox("lua", "elements", 300)

# ui.remove_groupbox(tab: string, groupbox_name: string)

ui.remove_groupbox(tab: string, groupbox_name: string)
  • Removes the specified groupbox.
secret.ui.remove_groupbox("lua", "elements")

# ui.clear_elements()

ui.clear_elements()
  • Clears all the current elements made with lua, such as secret.ui.create_checkbox, etc.

# ui.menu_open(): boolean

ui.menu_open(): boolean
  • Returns a boolean value of the menu being open.

# ui.console_open(): boolean

ui.console_open(): boolean
  • Returns a boolean value of the console being open.

# ui.notify(text: string, type: number)

ui.notify(text: string, type: number)
  • Creates a new notification at the top left corner of the screen with the specified text and type.
  • 0 = Default
  • 1 = Warning
  • 2 = Error