The primary component is the menu
table, which contains various functions and properties to handle menu elements.
Import the library
local menu = require("menu")
Create an element
local test = menu.combobox("CONFIG", "LUA", "Hello", {"test", "hello", "baby"})
Acces the functions
print(test:contains("test"))
print(test.args) -- TABLE: {"CONFIG", "LUA", "Hello", {"test", "hello", "baby"}}
print(test) -- element::combobox[3](Hello)
Returns the value of the menu element.
element:get()
Sets the value of the menu element.
element:set(any: ...)
Returns a reference to the menu element.
element:reference()
Sets the visibility of the menu element.
element:set_visible(boolean: value_to_set)
Sets the enabled status of the menu element.
element:set_enabled(boolean: value_to_set)
Sets a callback for the menu element.
element:set_callback(void: function(element: reference, number: original))
Returns the name of the menu element.
element:name(boolean?: original)
Returns the type of the menu element as a string.
element:type()
Returns the list of values of the menu element or nil if not a table.
element:list()
Handles dependencies of the menu element.
element:depend(element: menu_element)
Updates the menu element with new values.
element:update(any: ...)
Checks if an element contains a specific value.
element:contains(any: value)
Note: These functions are accessed using the :
operator.
You can also access other properties like args, dependency and is_visible by using the .
operator.