DocsRadial Menu

Menu items

Build menus, submenus, extra menus and built-in actions.

Not released yet. These pages are written from the code of manniche_radial and can change before the release.

Items

Every item has a label (string) and normally an icon. It has either items (a submenu) or one action. An item without a string label is skipped. The icon is a Lucide icon name or an https link to an image.

Action fields

FieldWhat it does
builtin = 'engine'Runs a built-in action.
event = 'my:event'TriggerEvent with args if given.
serverEvent = 'my:event'TriggerServerEvent with args if given. Validate on the server.
command = 'e sit'ExecuteCommand.
onSelect = function(item) endAny Lua.

Optional fields

FieldWhat it does
idName used as parentId with addItem.
argsList passed to event and serverEvent.
keepOpenStay open after picking it.
vehicletrue only in a vehicle, false only on foot.
driverOnly in the driver seat.
job'police' for one job, or { police = 2, sheriff = 0 } for these jobs from a grade.
dutyOnly on duty. Skipped where the framework gives no duty value.
canInteractFunction that returns true when the item should show. An error counts as false.

items can also be a built-in submenu name ('animations', 'doors', 'windows', 'seats', 'extras', 'job') or a function that returns a list. A submenu with no items is left out. The menu is rebuilt each time it opens.

Built-in actions

ActionWhat it does
serverIdShows the server ID.
jobShows job and grade.
handsUpHands up, or down again.
stopAnimationClears the ped's tasks.
engineEngine on or off.
lockLock or unlock. See Vehicle locks.
hazardsHazard lights on or off.
interiorLightInterior light on or off.

The submenus doors, windows, seats and extras list only what the current vehicle has. Seat changes are refused while the vehicle moves faster than 2.0 and you are the driver or pick the driver seat, and for taken seats.

Extra menus

Each entry in Config.menus is a separate menu. Settings it leaves out come from the main menu. One menu is open at a time. An entry is only used when name is a string other than 'main', command is a string and items is set.

FieldWhat it does
nameUsed with open('name') and as parentId for addItem.
commandCommand to open it. Must differ from every other menu's command.
keyDefault key, or false.
titleShown in the centre and under Key Bindings.
hold, position, vehiclePosition, accent, sizeSame as the main options.
itemsItems, same format as Config.menu.

Jobs and animations

Config.jobs maps a job name to a list of items. The Job submenu shows only the player's own job.

Config.jobs = {
    police = {
        { label = 'Cuff', icon = 'link', event = 'police:client:CuffPlayer' },
        { label = 'Fine', icon = 'receipt', command = 'fine', duty = true },
    },
}

Entries in Config.animations use either scenario, or dict and anim. Optional: loop (loop it) and upper (upper body only, the player can still walk).