Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MenuV global namespace
- Alias: MenuV
- MenuV library
- MenuV#CloseMenu(MenuV, menu, callback=undefined)⇒void
- Type: function
- Close a menu
- Parameters
- MenuV : MenuV
- menu : Menu|string
- Menu or Universally Unique Identifier (UUID)
- callback : functionundefined
- 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
- Parameters
- MenuV : MenuV
- title : string|boolean'MenuV'
- Title that appears on the big banner.
- subtitle : string''
- Subtitle that appears in capital letters in a small black bar.
- position : string'topleft'
- Menu position on screen options: topleft | topcenter | topright | centerleft | center | centerright | bottomleft | bottomcenter | bottomright
- r : number0
- Primary color RGB red channel [0-255]
- g : number0
- Primary color RGB green channel [0-255]
- b : number255
- Primary color RGB blue channel [0-255]
- size : string'size-110'
- Menu size in % options: size-100 | size-110 | size-125 | size-150 | size-175 | size-200
- texture : string'default'
- Texture name for the banner image
- dictionary : string'menuv'
- Texture dictionary name for the banner image
- namespace : string'unknown'
- Namespace is required to set keybinds, make sure given namespace is unique for every menu.
- theme : string'default'
- 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')
- MenuV#GetMenu(MenuV, uuid)⇒Menu|null
- Type: function
- Returns created menu matching UUID
- Parameters
- MenuV : MenuV
- uuid : string
- Universally Unique Identifier (UUID)
- Returns: Menu|null — Returns matching menu or nil
- Example
- local menu = MenuV:GetMenu('00000000-0000-0000-0000-000000000000')
- MenuV#InheritMenu(MenuV, menu, overrides, namespace)⇒Menu
- Type: function
- Create a new menu from properties of this one (without items and events)
- Parameters
- MenuV : MenuV
- menu : Menu
- Menu to take properties from
- overrides : table
- A table with key values to override, see Menu options
- namespace : string
- 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' })
- MenuV#IsNamespaceAvailable(namespace)⇒boolean
- Type: function
- Checks if namespace is available
- Parameters
- namespace : string
- Namespace, see Menu.Namespace
- Returns: boolean — Return true if given namespace is available, otherwise false
- Example
- local available = MenuV:IsNamespaceAvailable('example_namespace')
- MenuV#OpenMenu(MenuV, menu, callback=undefined)⇒void
- Type: function
- Open a menu
- Parameters
- MenuV : MenuV
- menu : Menu|string
- Menu or Universally Unique Identifier (UUID)
- callback : functionundefined
- 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)
- ButtonItem:class global
- Extends: Item
- Button item for MenuV
- ButtonItem#event:enter
- Type: event
- Event will be triggered when item becomes active/selected in NUI
- Parameters
- item : Item
- Current active/selected item
- Example
- item:On('enter', function(item)
- print('You have entered this item :)')
- end)
- ButtonItem#event:leave
- Type: event
- Event will be triggered when item becomes inactive/unselected in NUI
- Parameters
- item : Item
- Current inactive/unselected item
- Example
- item:On('leave', function(item)
- print('You have unselected this item :(')
- end)
- ButtonItem#event:select
- Type: event
- Event will be triggered when user pressed ENTER on item
- Parameters
- item : ButtonItem
- Current selected item
- Example
- item:On('select', function(item)
- print('You have updated this item :)')
- end)
- ButtonItem#event:update
- Type: event
- Event will be triggered when item's value changed
- Parameters
- item : Item
- Current updated item
- key : string
- Current updated key
- value : any
- Current updated value
- oldValue : any
- Previous value
- Example
- item:On('update', function(item, key, value, oldValue)
- print('You have updated this item :)')
- end)
- CheckboxItem:class global
- Extends: Item
- Checkbox item for MenuV
- CheckboxItem.Value:boolean static
- Value: false
- Type: boolean
- Value of CheckboxItem
- CheckboxItem#event:change
- Type: event
- Event will be triggered when user changed checkbox state
- Parameters
- item : CheckboxItem
- Current changed checkbox item
- newValue : boolean
- New state of checkbox
- oldValue : boolean
- Previous state of checkbox
- Example
- item:On('change', function(item, newValue, oldValue)
- print('You have changed them checkbox state :)')
- end)
- CheckboxItem#event:check
- Type: event
- Event will be triggered when user check the checkbox
- Parameters
- item : CheckboxItem
- Current checked checkbox item
- Example
- item:On('check', function(item)
- print('You have set the checkbox state to checked :D')
- end)
- CheckboxItem#event:enter
- Type: event
- Event will be triggered when item becomes active/selected in NUI
- Parameters
- item : Item
- Current active/selected item
- Example
- item:On('enter', function(item)
- print('You have entered this item :)')
- end)
- CheckboxItem#event:leave
- Type: event
- Event will be triggered when item becomes inactive/unselected in NUI
- Parameters
- item : Item
- Current inactive/unselected item
- Example
- item:On('leave', function(item)
- print('You have unselected this item :(')
- end)
- CheckboxItem#event:uncheck
- Type: event
- Event will be triggered when user uncheck the checkbox
- Parameters
- item : CheckboxItem
- Current unchecked checkbox item
- Example
- item:On('uncheck', function(item)
- print('You have set the checkbox state to unchecked :(')
- end)
- CheckboxItem#event:update
- Type: event
- Event will be triggered when item's value changed
- Parameters
- item : Item
- Current updated item
- key : string
- Current updated key
- value : any
- Current updated value
- oldValue : any
- Previous value
- Example
- item:On('update', function(item, key, value, oldValue)
- print('You have updated this item :)')
- end)
- ConfirmItem:class global
- Extends: Item
- Confirm item for MenuV
- ConfirmItem#Confirm()⇒void
- Type: function
- Confirm this item, set confirm state to true
- ConfirmItem#Deny()⇒void
- Type: function
- Deny this item, set confirm state to false
- ConfirmItem.Value:boolean static
- Value: false
- Type: boolean
- Value of ConfirmItem
- ConfirmItem#event:change
- Type: event
- Event will be triggered when user changed confirm state
- Parameters
- item : ConfirmItem
- Current changed confirm item
- newValue : boolean
- New state of confirm
- oldValue : boolean
- Previous state of confirm
- Example
- item:On('change', function(item, newValue, oldValue)
- print('You have changed them confirm state :)')
- end)
- ConfirmItem#event:confirm
- Type: event
- Event will be triggered when user confirm the ConfirmItem
- Parameters
- item : ConfirmItem
- Current confirmed confirm item
- Example
- item:On('confirm', function(item)
- print('You have confirmed the confirm item :D')
- end)
- ConfirmItem#event:deny
- Type: event
- Event will be triggered when user denied the ConfirmItem
- Parameters
- item : ConfirmItem
- Current denied confirm item
- Example
- item:On('deny', function(item)
- print('You have denied the confirm item :D')
- end)
- ConfirmItem#event:enter
- Type: event
- Event will be triggered when item becomes active/selected in NUI
- Parameters
- item : Item
- Current active/selected item
- Example
- item:On('enter', function(item)
- print('You have entered this item :)')
- end)
- ConfirmItem#event:leave
- Type: event
- Event will be triggered when item becomes inactive/unselected in NUI
- Parameters
- item : Item
- Current inactive/unselected item
- Example
- item:On('leave', function(item)
- print('You have unselected this item :(')
- end)
- ConfirmItem#event:update
- Type: event
- Event will be triggered when item's value changed
- Parameters
- item : Item
- Current updated item
- key : string
- Current updated key
- value : any
- Current updated value
- oldValue : any
- Previous value
- Example
- item:On('update', function(item, key, value, oldValue)
- print('You have updated this item :)')
- end)
- Item:class global
- Item for MenuV
- Item#GetParentMenu(item)⇒Menu
- Type: function
- Returns the Menu where item is added to (Parent Menu)
- Parameters
- item : Item
- Item to get parent menu from
- Returns: Menu — Parent's menu
- Item#GetValue(item)⇒any|nil
- Type: function
- Get current item's value with some validation, see Item.Value
- Parameters
- item : Item
- Item to get value from
- Returns: any|nil — Return current valid value or nil
- Item#On(item, event, func)⇒void
- Type: function
- Register a function as on event trigger
- Parameters
- item : Item
- Item to register function for
- event : string
- Name of on event to trigger
- func : function
- Function to trigger
- Item.Description:string static
- Value: ''
- Type: string
- Description of menu item
- Item.Disabled:boolean static
- Value: ''
- Type: boolean
- Disabled state of menu item
- Item.Icon:string static
- Value: 'none'
- Type: string
- Icon of menu item
- Item.Label:string static
- Value: ''
- Type: string
- Label of menu item
- Item.SaveOnUpdate:boolean static
- Value: false
- Type: boolean
- When item value changed, force to save changes
- Item.UUID:string static readonly
- Type: string
- Universally Unique Identifier (UUID)
- Item.Value:any static
- Value: ''
- Type: any
- Value of menu item
- Item#event:enter
- Type: event
- Event will be triggered when item becomes active/selected in NUI
- Parameters
- item : Item
- Current active/selected item
- Example
- item:On('enter', function(item)
- print('You have entered this item :)')
- end)
- Item#event:leave
- Type: event
- Event will be triggered when item becomes inactive/unselected in NUI
- Parameters
- item : Item
- Current inactive/unselected item
- Example
- item:On('leave', function(item)
- print('You have unselected this item :(')
- end)
- Item#event:update
- Type: event
- Event will be triggered when item's value changed
- Parameters
- item : Item
- Current updated item
- key : string
- Current updated key
- value : any
- Current updated value
- oldValue : any
- Previous value
- Example
- item:On('update', function(item, key, value, oldValue)
- print('You have updated this item :)')
- end)
- Menu:class global
- Menu for MenuV
- Menu#AddButton(menu, options={})⇒ButtonItem
- Type: function
- This function will add a button item to Menu
- Parameters
- menu : Menu
- Menu to add button for
- options : table{}
- Button information
- options.icon : string''
- Emoji as item prefex, see emojipedia.org
- options.label : string''
- Label on button
- options.description : string''
- Button description when this button is active
- options.value : any|Menunil
- Button menu value, when value is a Menu, MenuV will open that Menu on button select
- options.disabled : booleanfalse
- 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' })
- Menu#AddCheckbox(menu, options={})⇒CheckboxItem
- Type: function
- This function will add a checkbox item to Menu
- Parameters
- menu : Menu
- Menu to add checkbox item for
- options : table{}
- Checkbox information
- options.icon : string''
- Emoji as item prefex, see emojipedia.org
- options.label : string''
- Label on checkbox
- options.description : string''
- Checkbox description when this checkbox item is active
- options.value : booleanfalse
- Checkbox item value
- options.disabled : booleanfalse
- 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 })
- Menu#AddConfirm(menu, options={})⇒ConfirmItem
- Type: function
- This function will add a confirm item to Menu
- Parameters
- menu : Menu
- Menu to add confirm item for
- options : table{}
- Confirm information
- options.icon : string''
- Emoji as item prefex, see emojipedia.org
- options.label : string''
- Label on confirm item
- options.description : string''
- Confirm description when this confirm item is active
- options.value : booleanfalse
- Confirm menu value
- options.disabled : booleanfalse
- 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 })
- Menu#AddRange(menu, options={})⇒RangeItem
- Type: function
- This function will add a range item to Menu
- Parameters
- menu : Menu
- Menu to add range item for
- options : table{}
- Range information
- options.icon : string''
- Emoji as item prefex, see emojipedia.org
- options.label : string''
- Label on range item
- options.description : string''
- Range item description when this range item is active
- options.value : number0
- Range item value
- options.min : number0
- Minimal range value
- options.max : number0
- Maximal range value
- options.disabled : booleanfalse
- 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 })
- Menu#AddSlider(menu, options={})⇒SliderItem
- Type: function
- This function will add a slider item to Menu
- Parameters
- menu : Menu
- Menu to add slider for
- options : table{}
- Slider information
- options.icon : string''
- Emoji as item prefex, see emojipedia.org
- options.label : string''
- Label on slider
- options.description : string''
- Slider description when this slider is active
- options.value : number1
- Slider menu value, must be a valid index of SliderItem.Values
- options.values : table[]
- List of values
- value.label : string'Value'
- Label of value item
- value.description : string''
- Description of value item
- value.value : anynull
- Value of value item
- options.disabled : booleanfalse
- 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' }
- }})
- Menu#ClearItems(menu, update=true)⇒void
- Type: function
- Clear all items in menu
- Parameters
- menu : Menu
- Menu
- update : booleantrue
- 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)
- Menu#Close(menu)⇒void
- Type: function
- Close this menu
- Parameters
- menu : Menu
- Menu
- Example
- local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
- menu:Close()
- Menu#InheritMenu(menu, overrides, namespace)⇒Menu
- Create a new menu from properties of this one (without items and events)
- Parameters
- menu : Menu
- Menu
- overrides : table
- A table with key values to override, see Menu options
- namespace : string
- 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' })
- Menu#On(menu, event, func)⇒string
- Type: function
- Register a function as on event trigger
- Parameters
- menu : Menu
- Menu to register function for
- event : string
- Name of on event to trigger
- func : function
- 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)
- Menu#Open(menu)⇒void
- Type: function
- Open this menu
- Parameters
- menu : Menu
- Menu
- Example
- local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0, 'size-125', 'example', 'menuv', 'example_namespace', 'native')
- menu:Open()
- Menu#OpenWith(menu, defaultType, defaultKey)⇒void
- Type: function
- Register keybind for opening this menu, a unqiue Menu.Namespace is required
- Parameters
- menu : Menu
- Menu
- defaultType : string
- Default input type, like: KEYBOARD, MOUSE_BUTTON etc.
- defaultKey : string
- 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')
- Menu#RemoveOnEvent(menu, event, uuid)⇒void
- Type: function
- Remove a registered on event
- Parameters
- menu : Menu
- Menu to remove event for
- event : string
- Name of on event to remove
- uuid : string
- 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)
- Menu#SetPosition(menu, position)⇒void
- Type: function
- Change menu's position
- Parameters
- menu : Menu
- Menu
- position : string
- 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')
- Menu#SetSubtitle(menu, subtitle)⇒void
- Change menu's subtitle
- Parameters
- menu : Menu
- Menu
- subtitle : string
- 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')
- Menu#SetTitle(menu, title)⇒void
- Type: function
- Change menu's title
- Parameters
- menu : Menu
- Menu
- title : string
- 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')
- Menu#ToTable(menu)⇒void
- Type: function
- Transform Menu to table
- Parameters
- menu : Menu
- 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()
- Menu.Color:table static
- Value: { R=0, G=0, B=255 }
- Type: table
- Menu primary color as RGB
- Menu.Color.B:number static
- Value: 255
- Type: number
- Primary color RGB blue channel [0-255]
- Menu.Color.G:number static
- Value: 0
- Type: number
- Primary color RGB green channel [0-255]
- Menu.Color.R:number static
- Value: 0
- Type: number
- Primary color RGB red channel [0-255]
- Menu.Dictionary:string static
- Value: 'menuv'
- Type: string
- Texture dictionary name for the banner image
- Menu.IsOpen:boolean static readonly
- Value: false
- Type: string
- Menu "open" state
- Menu.Namespace:string static readonly
- Value: 'unknown'
- Type: string
- Namespace is required to set keybinds, make sure given namespace is unique for every menu.
- Menu.Position:string static
- Value: 'topleft'
- Type: string
- Menu position on screen
- options:
- topleft | topcenter | topright | centerleft | center | centerright | bottomleft | bottomcenter | bottomright
- Menu.Size:string static
- Value: 'size-110'
- Type: string
- Menu size in %
- options:
- size-100 | size-110 | size-125 | size-150 | size-175 | size-200
- Menu.Subtitle:string static
- Value: ''
- Type: string
- Subtitle that appears in capital letters in a small black bar.
- Menu.Texture:string static
- Value: 'default'
- Type: string
- Texture name for the banner image
- Menu.Theme:string static readonly
- 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
- Menu.Title:string static
- Value: 'MenuV'
- Type: string
- Title that appears on the big banner.
- Menu.UUID:string static readonly
- Type: string
- Universally Unique Identifier (UUID)
- Menu~options:object inner
- CreateMenu options
- Parameters
- options.namespace : stringunknown
- Namespace is required to set keybinds, make sure given namespace is unique for every menu.
- options.title : boolean|stringMenuV
- Title that appears on the big banner.
- options.subtitle : string""
- Subtitle that appears in capital letters in a small black bar.
- options.position : string"topleft"
- Menu position on screen options:
- topleft | topcenter | topright | centerleft | center | centerright | bottomleft | bottomcenter | bottomright
- options.r : number0
- Primary color RGB red channel [0-255]
- options.g : number0
- Primary color RGB green channel [0-255]
- options.b : number255
- Primary color RGB blue channel [0-255]
- options.size : stringsize-110
- Menu size in %
- options:
- size-100 | size-110 | size-125 | size-150 | size-175 | size-200
- options.dictionary : stringmenuv
- Texture dictionary name for the banner image
- options.texture : stringdefault
- Texture name for the banner image
- options.events : table{}
- Custom events to add
- options.validate : functionnil
- Custom Menu.Validate function
- options.newIndex : functionnil
- Custom Menu.NewIndex function
- Menu#event:close
- Type: event
- Event will be triggered when menu is closed
- Parameters
- menu : Menu
- Current closed menu
- Example
- menu:On('close', function(menu)
- print('You have now closed the menu :)')
- end)
- Menu#event:open
- Type: event
- Event will be triggered when menu is opened
- Parameters
- menu : Menu
- Current opened menu
- Example
- menu:On('open', function(menu)
- print('You have now opened the menu :)')
- end)
- RangeItem:class global
- Extends: Item
- Range item for MenuV
- RangeItem#SetMaxValue(input)⇒void
- Type: function
- Change RangeItem.Max
- Parameters
- input : number
- New maximal value
- RangeItem#SetMinValue(input)⇒void
- Type: function
- Change RangeItem.Min
- Parameters
- input : number
- New minimal value
- RangeItem.Max:number static
- Value: 0
- Type: number
- Maximal possible value
- RangeItem.Min:number static
- Value: 0
- Type: number
- Minimal possible value
- RangeItem.Value:number static
- Value: 0
- Type: number
- Value of range item (default lowest possible value)
- RangeItem#event:change
- Type: event
- Event will be triggered when user changed range state
- Parameters
- item : RangeItem
- Current changed range item
- newValue : number
- New value of range item
- oldValue : number
- Previous value of range item
- Example
- item:On('change', function(item, newValue, oldValue)
- print('You have changed them range :)')
- end)
- RangeItem#event:enter
- Type: event
- Event will be triggered when item becomes active/selected in NUI
- Parameters
- item : Item
- Current active/selected item
- Example
- item:On('enter', function(item)
- print('You have entered this item :)')
- end)
- RangeItem#event:leave
- Type: event
- Event will be triggered when item becomes inactive/unselected in NUI
- Parameters
- item : Item
- Current inactive/unselected item
- Example
- item:On('leave', function(item)
- print('You have unselected this item :(')
- end)
- RangeItem#event:select
- Type: event
- Event will be triggered when user pressed 'ENTER' in range item
- Parameters
- item : RangeItem
- Current selected range item
- value : number
- Value of range item
- Example
- item:On('select', function(item, value)
- print('You have select a range option :)')
- end)
- RangeItem#event:update
- Type: event
- Event will be triggered when item's value changed
- Parameters
- item : Item
- Current updated item
- key : string
- Current updated key
- value : any
- Current updated value
- oldValue : any
- Previous value
- Example
- item:On('update', function(item, key, value, oldValue)
- print('You have updated this item :)')
- end)
- SliderItem:class global
- Extends: Item
- Slider item for MenuV
- SliderItem#AddValue(item, value)⇒void
- Type: function
- Add a value to slider
- Parameters
- item : SliderItem
- SliderItem to add a value for
- value : table
- Value information
- value.label : string'Value'
- Label of value item
- value.description : string''
- Description of value item
- value.value : anynull
- Value of value item
- SliderItem#AddValues(item, ...values)⇒void
- Type: function
- Add a list of values to slider
- Parameters
- item : SliderItem
- SliderItem to add values for
- ...values : ...table
- Value information
- value.label : string'Value'
- Label of value item
- value.description : string''
- Description of value item
- value.value : anynull
- Value of value item
- SliderItem.Value:number static
- Value: 1
- Type: number
- Value of slider item (current selected index)
- SliderItem#event:change
- Type: event
- Event will be triggered when user changed slider state
- Parameters
- item : SliderItem
- Current changed slider item
- newValue : number
- New index of slider item
- oldValue : number
- Previous index of slider item
- Example
- item:On('change', function(item, newValue, oldValue)
- print('You have changed them slider :)')
- end)
- SliderItem#event:enter
- Type: event
- Event will be triggered when item becomes active/selected in NUI
- Parameters
- item : Item
- Current active/selected item
- Example
- item:On('enter', function(item)
- print('You have entered this item :)')
- end)
- SliderItem#event:leave
- Type: event
- Event will be triggered when item becomes inactive/unselected in NUI
- Parameters
- item : Item
- Current inactive/unselected item
- Example
- item:On('leave', function(item)
- print('You have unselected this item :(')
- end)
- SliderItem#event:select
- Type: event
- Event will be triggered when user pressed 'ENTER' in slider item
- Parameters
- item : SliderItem
- Current selected slider item
- value : any
- Value from selected option
- Example
- item:On('select', function(item, value)
- print('You have select a slider option :)')
- end)
- SliderItem#event:update
- Type: event
- Event will be triggered when item's value changed
- Parameters
- item : Item
- Current updated item
- key : string
- Current updated key
- value : any
- Current updated value
- oldValue : any
- Previous value
- Example
- item:On('update', function(item, key, value, oldValue)
- print('You have updated this item :)')
- end)
- table:object global
- Object
- threads:Array<number> global
- List of threads
- Documentation built with Docma.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement