List Menu
Scrollable list menus with selectable options. Items with scrollable values display the currently selected value name prominently, with the item label shown above it. The description for the currently highlighted item is shown in a panel below the menu.
Exports
| Export | Parameters | Returns |
|---|---|---|
RegisterMenu | (data, cb) | — |
ShowMenu | (id) | — |
HideMenu | (onExit) | — |
GetOpenMenu | () | string or nil |
SetMenuOptions | (id, options, index) | — |
RegisterMenu Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data | table | Yes | Menu definition |
cb | function | Yes | Callback: function(selected, scrollIndex, args) |
Data Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique menu identifier |
title | string | Menu title |
position | string | Menu position: 'top-left', 'top-right', 'left', 'right', 'center' |
canClose | boolean | Whether the menu can be closed with ESC |
options | table | Array of menu options |
onClose | function | Callback when menu is closed |
onSelected | function | Callback when selection changes |
onSideScroll | function | Callback when scrolling through values |
Option Fields
| Field | Type | Description |
|---|---|---|
label | string | Option label |
description | string | Description shown in the bottom panel when this item is highlighted |
icon | string | FontAwesome icon name or image URL |
iconColor | string | Custom icon color |
iconAnimation | string | Icon animation: 'spin', 'beat', 'fade', 'bounce', 'shake' |
values | table | Array of scrollable values (strings or { label, description } objects) |
defaultIndex | number | Default selected value index (1-based) |
checked | boolean | Show as a toggle switch |
progress | number | Show a progress bar (0–100) |
colorScheme | string | Color for the progress bar |
close | boolean | Whether selecting this item closes the menu |
Usage
Register and Show
exports['flux-ui-pack']:RegisterMenu({
id = 'server_menu',
title = 'Manage Server',
options = {
{
label = 'Change Weather',
description = 'Changes the weather to whatever is currently highlighted',
values = { 'Extrasunny', 'Clear', 'Clouds', 'Smog', 'Foggy', 'Overcast', 'Rain', 'Thunder', 'Clearing', 'Snow', 'Blizzard', 'Snowlight', 'Xmas', 'Halloween', 'Neutral' },
icon = 'cloud',
defaultIndex = 1
},
{
label = 'Change Time',
description = 'Changes the time to the specified hour',
values = { '00:00', '01:00', '02:00', '03:00', '04:00', '05:00' },
icon = 'clock'
},
{
label = 'Get Radio List',
description = 'Get a full list of players on the given radio frequency',
icon = 'radio'
},
{
label = 'Pull Stash',
description = 'Open a stash with the specified name',
icon = 'box'
},
}
}, function(selected, scrollIndex, args)
print('Selected: ' .. selected, 'Value index: ' .. tostring(scrollIndex))
end)
exports['flux-ui-pack']:ShowMenu('server_menu')Values with Descriptions
Values can be objects with their own descriptions, shown in the bottom panel when scrolled to:
exports['flux-ui-pack']:RegisterMenu({
id = 'weapon_menu',
title = 'Select Weapon',
options = {
{
label = 'Primary Weapon',
values = {
{ label = 'Carbine Rifle', description = 'Standard issue assault rifle' },
{ label = 'Pump Shotgun', description = 'Close range powerhouse' },
{ label = 'SMG', description = 'Compact and fast firing' },
}
}
}
}, function(selected, scrollIndex)
print('Selected weapon index: ' .. scrollIndex)
end)Update Menu Options
exports['flux-ui-pack']:SetMenuOptions('server_menu', {
{ label = 'Water Bottle', values = { '$5', 'In Stock' } },
{ label = 'Bread', values = { '$3', 'Sold Out' } },
})Hide Menu
exports['flux-ui-pack']:HideMenu()Get Open Menu
local openMenu = exports['flux-ui-pack']:GetOpenMenu()
if openMenu then
print('Currently open: ' .. openMenu)
endLast updated on