mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
feat(client/interface): allow separately setting list menu options
This commit is contained in:
@@ -24,6 +24,10 @@ function lib.showMenu(id)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function lib.setMenuOptions(id, options)
|
||||||
|
registeredMenus[id].options = options
|
||||||
|
end
|
||||||
|
|
||||||
function lib.getOpenMenu() return openMenu end
|
function lib.getOpenMenu() return openMenu end
|
||||||
|
|
||||||
RegisterNUICallback('confirmSelected', function(data, cb)
|
RegisterNUICallback('confirmSelected', function(data, cb)
|
||||||
@@ -70,6 +74,11 @@ RegisterCommand('testMenu', function()
|
|||||||
title = 'Nicer menu',
|
title = 'Nicer menu',
|
||||||
position = 'top-right',
|
position = 'top-right',
|
||||||
onClose = function()
|
onClose = function()
|
||||||
|
lib.setMenuOptions('epic_menu', {
|
||||||
|
{label = 'Nice 1'},
|
||||||
|
{label = 'Nice 2', icon = {'fab', 'bitcoin'}},
|
||||||
|
{label = 'Nice 3', icon = 'biohazard', values={'option 1', 'option 2', 'option 3'}}
|
||||||
|
})
|
||||||
lib.showMenu('epic_menu')
|
lib.showMenu('epic_menu')
|
||||||
end,
|
end,
|
||||||
options = {
|
options = {
|
||||||
|
|||||||
Reference in New Issue
Block a user