Type: function
Close a menu
Menu or Universally Unique Identifier (UUID)
Trigger callback when function has been executed
Example #1
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
MenuV:CloseMenu(menu)
Example #2
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
MenuV:CloseMenu(menu, function()
print('Menu closed :(')
end)
MenuV#CreateMenu(MenuV, title='MenuV', subtitle='', position='topleft', r=0, g=0, b=255, size='size-110', texture='default', dictionary='menuv', namespace='unknown', theme='default')
⇒Menu
Type: function
Create a MenuV
menu
Title that appears on the big banner.
Subtitle that appears in capital letters in a small black bar.
Menu position on screen
options:
topleft
| topcenter
| topright
| centerleft
| center
| centerright
| bottomleft
| bottomcenter
| bottomright
Primary color RGB red channel [0-255]
Primary color RGB green channel [0-255]
Primary color RGB blue channel [0-255]
Menu size in %
options:
size-100
| size-110
| size-125
| size-150
| size-175
| size-200
Texture name for the banner image
Texture dictionary name for the banner image
Namespace is required to set keybinds, make sure given namespace is unique for every menu.
Change the look of the menu, available options: default
and native
Returns: Menu
Example #1
local menu = MenuV:CreateMenu('MenuV')
Example #2
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV')
Example #3
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft')
Example #4
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0)
Example #5
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125')
Example #6
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example')
Example #7
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv')
Example #8
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace')
Example #9
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
Type: function
Create a new menu from properties of this one (without items and events)
Menu to take properties from
A table with key values to override, see Menu options
Unique namespace, see Menu.Namespace
Returns: Menu
— New menu with properties of this one
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local menu2 = MenuV:InheritMenu(menu, { title = 'Menu V2', subtitle = 'Welcome to MenuV2 :D', theme = 'default' })
Type: function
Checks if namespace is available
Namespace, see Menu.Namespace
Returns: boolean
— Return true
if given namespace is available, otherwise false
Example
local available = MenuV:IsNamespaceAvailable('example_namespace')
Type: function
Open a menu
Menu or Universally Unique Identifier (UUID)
Trigger callback when function has been executed
Example #1
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
MenuV:OpenMenu(menu)
Example #2
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
MenuV:OpenMenu(menu, function()
print('Menu is now open :D')
end)
Type: event
Event will be triggered when item becomes active/selected in NUI
Current active/selected item
Example
item:On('enter', function(item)
print('You have entered this item :)')
end)
Type: event
Event will be triggered when item becomes inactive/unselected in NUI
Current inactive/unselected item
Example
item:On('leave', function(item)
print('You have unselected this item :(')
end)
Type: event
Event will be triggered when user pressed ENTER
on item
Current selected item
Example
item:On('select', function(item)
print('You have updated this item :)')
end)
Type: event
Event will be triggered when item's value changed
Current updated item
Current updated key
Current updated value
Previous value
Example
item:On('update', function(item, key, value, oldValue)
print('You have updated this item :)')
end)
Type: event
Event will be triggered when user changed checkbox state
Current changed checkbox item
New state of checkbox
Previous state of checkbox
Example
item:On('change', function(item, newValue, oldValue)
print('You have changed them checkbox state :)')
end)
Type: event
Event will be triggered when user check the checkbox
Current checked checkbox item
Example
item:On('check', function(item)
print('You have set the checkbox state to checked :D')
end)
Type: event
Event will be triggered when item becomes active/selected in NUI
Current active/selected item
Example
item:On('enter', function(item)
print('You have entered this item :)')
end)
Type: event
Event will be triggered when item becomes inactive/unselected in NUI
Current inactive/unselected item
Example
item:On('leave', function(item)
print('You have unselected this item :(')
end)
Type: event
Event will be triggered when user uncheck the checkbox
Current unchecked checkbox item
Example
item:On('uncheck', function(item)
print('You have set the checkbox state to unchecked :(')
end)
Type: event
Event will be triggered when item's value changed
Current updated item
Current updated key
Current updated value
Previous value
Example
item:On('update', function(item, key, value, oldValue)
print('You have updated this item :)')
end)
Type: event
Event will be triggered when user changed confirm state
Current changed confirm item
New state of confirm
Previous state of confirm
Example
item:On('change', function(item, newValue, oldValue)
print('You have changed them confirm state :)')
end)
Type: event
Event will be triggered when user confirm the ConfirmItem
Current confirmed confirm item
Example
item:On('confirm', function(item)
print('You have confirmed the confirm item :D')
end)
Type: event
Event will be triggered when user denied the ConfirmItem
Current denied confirm item
Example
item:On('deny', function(item)
print('You have denied the confirm item :D')
end)
Type: event
Event will be triggered when item becomes active/selected in NUI
Current active/selected item
Example
item:On('enter', function(item)
print('You have entered this item :)')
end)
Type: event
Event will be triggered when item becomes inactive/unselected in NUI
Current inactive/unselected item
Example
item:On('leave', function(item)
print('You have unselected this item :(')
end)
Type: event
Event will be triggered when item's value changed
Current updated item
Current updated key
Current updated value
Previous value
Example
item:On('update', function(item, key, value, oldValue)
print('You have updated this item :)')
end)
Item for MenuV
Type: function
Get current item's value with some validation, see Item.Value
Item to get value from
Returns: any
|nil
— Return current valid value or nil
Type: function
Register a function as on
event trigger
Item to register function for
Name of on
event to trigger
Function to trigger
Value: ''
Type: string
Description of menu item
Value: ''
Type: boolean
Disabled
state of menu item
Value: 'none'
Type: string
Icon of menu item
Value: ''
Type: string
Label of menu item
Value: false
Type: boolean
When item value changed, force to save changes
Type: string
Universally Unique Identifier (UUID)
Type: event
Event will be triggered when item becomes active/selected in NUI
Current active/selected item
Example
item:On('enter', function(item)
print('You have entered this item :)')
end)
Type: event
Event will be triggered when item becomes inactive/unselected in NUI
Current inactive/unselected item
Example
item:On('leave', function(item)
print('You have unselected this item :(')
end)
Type: event
Event will be triggered when item's value changed
Current updated item
Current updated key
Current updated value
Previous value
Example
item:On('update', function(item, key, value, oldValue)
print('You have updated this item :)')
end)
Menu for MenuV
Type: function
This function will add a button item to Menu
Menu to add button
for
Button information
Emoji as item prefex, see emojipedia.org
Label on button
Button description when this button is active
When this option is true
, button isn't selectable anymore
Returns: ButtonItem
— New button item
Example #1
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local button = menu:AddButton({ icon = '😃', label = 'Example Button', value = 10, description = 'Example button' })
Example #2
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local menu2 = menu:InheritMenu({title = 'MenuV 2.0', subtitle = 'Inherit menu of `menu`', theme = 'default' })
local button = menu:AddButton({ icon = '😃', label = 'Open Menu2', value = menu2, description = 'Open menu 2.0' })
Type: function
This function will add a checkbox item to Menu
Menu to add checkbox
item for
Checkbox information
Emoji as item prefex, see emojipedia.org
Label on checkbox
Checkbox description when this checkbox item is active
Checkbox item value
When this option is true
, checkbox isn't selectable anymore
Returns: CheckboxItem
— New checkbox item
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local checkbox = menu:AddCheckbox({ icon = '💡', label = 'Checkbox Example', value = false })
Type: function
This function will add a confirm item to Menu
Menu to add confirm
item for
Confirm information
Emoji as item prefex, see emojipedia.org
Label on confirm item
Confirm description when this confirm item is active
Confirm menu value
When this option is true
, confirm item isn't selectable anymore
Returns: ConfirmItem
— New confirm item
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local confirm = menu:AddConfirm({ icon = '🔥', label = 'Example Confirm', value = false })
Type: function
This function will add a range item to Menu
Menu to add range
item for
Range information
Emoji as item prefex, see emojipedia.org
Label on range item
Range item description when this range item is active
Range item value
Minimal range value
Maximal range value
When this option is true
, range item isn't selectable anymore
Returns: RangeItem
— New range item
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local range = menu:AddRange({ icon = '⚽', label = 'Example Range Item', min = 0, max = 10, value = 0, saveOnUpdate = true })
Type: function
This function will add a slider item to Menu
Menu to add slider
for
Slider information
Emoji as item prefex, see emojipedia.org
Label on slider
Slider description when this slider is active
Slider menu value, must be a valid index of SliderItem.Values
List of values
Label of value item
Description of value item
Value of value item
When this option is true
, slider isn't selectable anymore
Returns: SliderItem
— New slider item
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local slider = menu:AddSlider({ icon = '❤️', label = 'Example Slider', value = 'demo', values = {
{ label = 'Demo Item', value = 'demo', description = 'Demo Item 1' },
{ label = 'Demo Item 2', value = 'demo2', description = 'Demo Item 2' },
{ label = 'Demo Item 3', value = 'demo3', description = 'Demo Item 3' },
{ label = 'Demo Item 4', value = 'demo4', description = 'Demo Item 4' }
}})
Type: function
Clear all items in menu
Menu
Force NUI update
Example #1
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
menu:ClearItems()
Example #2
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
menu:ClearItems(false)
Type: function
Close this menu
Menu
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
menu:Close()
Create a new menu from properties of this one (without items and events)
Menu
A table with key values to override, see Menu options
Unique namespace, see Menu.Namespace
Returns: Menu
— New menu with properties of this one
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local menu2 = menu:InheritMenu({title = 'MenuV 2.0', subtitle = 'Inherit menu of `menu`', theme = 'default' })
Type: function
Register a function as on
event trigger
Menu to register function for
Name of on
event to trigger
Function to trigger
Returns: string
— Universally Unique Identifier (UUID)
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
menu:On('open', function(m)
print('Menu is now open :D')
end)
Type: function
Open this menu
Menu
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
menu:Open()
Type: function
Register keybind for opening this menu, a unqiue Menu.Namespace is required
Menu
Default input type, like: KEYBOARD, MOUSE_BUTTON etc.
Default input button, like: E, F12, LEFT_BUTTON etc.
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
menu:OpenWith('keyboard', 'F1')
Type: function
Remove a registered on
event
Menu to remove event for
Name of on
event to remove
Universally Unique Identifier (UUID) of registered on
event
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local event_uuid = menu:On('open', function(m)
print('Menu is now open :D')
end)
menu:RemoveOnEvent('open', event_uuid)
Type: function
Change menu's position
Menu
Menu position on screen
options:
topleft
| topcenter
| topright
| centerleft
| center
| centerright
| bottomleft
| bottomcenter
| bottomright
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
menu:SetPosition('bottomright')
Change menu's subtitle
Menu
Subtitle of menu
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
menu:SetSubtitle('Example Subtitle')
Type: function
Change menu's title
Menu
Title of menu
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
menu:SetTitle('Example Title')
Type: function
Transform Menu to table
Menu
Example
local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
local menuData = menu:ToTable()
Value: { R=0, G=0, B=255 }
Type: table
Menu primary color as RGB
Value: 255
Type: number
Primary color RGB blue channel [0-255]
Value: 0
Type: number
Primary color RGB green channel [0-255]
Value: 0
Type: number
Primary color RGB red channel [0-255]
Value: 'menuv'
Type: string
Texture dictionary name for the banner image
Value: false
Type: string
Menu "open" state
Value: 'unknown'
Type: string
Namespace is required to set keybinds, make sure given namespace is unique for every menu.
Value: 'topleft'
Type: string
Menu position on screen
options:
topleft
| topcenter
| topright
| centerleft
| center
| centerright
| bottomleft
| bottomcenter
| bottomright
Value: 'size-110'
Type: string
Menu size in %
options:
size-100
| size-110
| size-125
| size-150
| size-175
| size-200
Value: ''
Type: string
Subtitle that appears in capital letters in a small black bar.
Value: 'default'
Type: string
Texture name for the banner image
Value: 'default'
Type: string
Change the look of MenuV by changing the theme
Default: https://i.imgur.com/xGagIBm.png
Native: https://i.imgur.com/KSkeiQm.png
Value: 'MenuV'
Type: string
Title that appears on the big banner.
Type: string
Universally Unique Identifier (UUID)
CreateMenu options
Namespace is required to set keybinds, make sure given namespace is unique for every menu.
Title that appears on the big banner.
Subtitle that appears in capital letters in a small black bar.
Menu position on screen options:
topleft
| topcenter
| topright
| centerleft
| center
| centerright
| bottomleft
| bottomcenter
| bottomright
Primary color RGB
red channel [0-255]
Primary color RGB
green channel [0-255]
Primary color RGB
blue channel [0-255]
Menu size in %
options:
size-100
| size-110
| size-125
| size-150
| size-175
| size-200
Texture dictionary name for the banner image
Texture name for the banner image
Custom events to add
Custom Menu.Validate function
Custom Menu.NewIndex function
Type: event
Event will be triggered when menu is closed
Current closed menu
Example
menu:On('close', function(menu)
print('You have now closed the menu :)')
end)
Type: event
Event will be triggered when menu is opened
Current opened menu
Example
menu:On('open', function(menu)
print('You have now opened the menu :)')
end)
Value: 0
Type: number
Maximal possible value
Value: 0
Type: number
Minimal possible value
Value: 0
Type: number
Value of range item (default lowest possible value)
Type: event
Event will be triggered when user changed range state
Current changed range item
New value of range item
Previous value of range item
Example
item:On('change', function(item, newValue, oldValue)
print('You have changed them range :)')
end)
Type: event
Event will be triggered when item becomes active/selected in NUI
Current active/selected item
Example
item:On('enter', function(item)
print('You have entered this item :)')
end)
Type: event
Event will be triggered when item becomes inactive/unselected in NUI
Current inactive/unselected item
Example
item:On('leave', function(item)
print('You have unselected this item :(')
end)
Type: event
Event will be triggered when user pressed 'ENTER' in range item
Current selected range item
Value of range item
Example
item:On('select', function(item, value)
print('You have select a range option :)')
end)
Type: event
Event will be triggered when item's value changed
Current updated item
Current updated key
Current updated value
Previous value
Example
item:On('update', function(item, key, value, oldValue)
print('You have updated this item :)')
end)
Type: function
Add a value to slider
SliderItem to add a value for
Value information
Label of value item
Description of value item
Value of value item
Type: function
Add a list of values to slider
SliderItem to add values for
Value information
Label of value item
Description of value item
Value of value item
Value: 1
Type: number
Value of slider item (current selected index)
Type: event
Event will be triggered when user changed slider state
Current changed slider item
New index of slider item
Previous index of slider item
Example
item:On('change', function(item, newValue, oldValue)
print('You have changed them slider :)')
end)
Type: event
Event will be triggered when item becomes active/selected in NUI
Current active/selected item
Example
item:On('enter', function(item)
print('You have entered this item :)')
end)
Type: event
Event will be triggered when item becomes inactive/unselected in NUI
Current inactive/unselected item
Example
item:On('leave', function(item)
print('You have unselected this item :(')
end)
Type: event
Event will be triggered when user pressed 'ENTER' in slider item
Current selected slider item
Value from selected option
Example
item:On('select', function(item, value)
print('You have select a slider option :)')
end)
Type: event
Event will be triggered when item's value changed
Current updated item
Current updated key
Current updated value
Previous value
Example
item:On('update', function(item, key, value, oldValue)
print('You have updated this item :)')
end)