Menu Client β
The Jump On Menu is a NUI menu designed to blend with the menus of Red Dead Redemption II. It works with the keyboard and the mouse, and it's built to stay fast even with hundreds of items.
Every action is attached to an item (onClick, onActive, onChange...) instead of the whole menu, so a menu is just a list of tables. Lists, tile grids, sliders, color palettes, statistics and prices are all included.



Installation β
- Add the jo_libs initiator as a shared script in your
fxmanifest.lua:
shared_scripts {
'@jo_libs/init.lua'
}- Add the
menumodule in thejo_libslist of yourfxmanifest.lua:
jo_libs {
'menu',
}- Set the jo_libs NUI page as the
ui_pageof yourfxmanifest.lua:
ui_page "nui://jo_libs/nui/index.html"You can now use the menu with the jo.menu global variable, in your client scripts.
The ui_page is required
The menu can't be loaded without this ui_page.
You can still use your own NUI
nui://jo_libs/nui/index.html is only a container: it displays several NUI pages in the same resource, each one in its own frame. The menu loads itself in it, and you can load your own interface next to it with jo.nui.load instead of using ui_page.
-- fxmanifest.lua
ui_page "nui://jo_libs/nui/index.html"
files {
"html/**"
}
jo_libs {
"menu",
"nui",
}-- client.lua
-- Load your own page (it can be done once at the start of the resource)
jo.nui.load("my_ui", "nui://" .. GetCurrentResourceName() .. "/html/index.html")
-- Send a message only to your page
SendNUIMessage({
messageTargetUiName = "my_ui",
action = "open",
})A message sent without messageTargetUiName is received by every loaded NUI.
Quick start β
A menu is created with an ID, filled with items, then sent to the NUI. Once sent, you choose the menu to display and show it.
local function openTailor()
-- 1. Create the menu
local menu = jo.menu.create("tailor", {
title = "Tailor",
subtitle = "Clothes",
onBack = function()
-- Backspace on the first menu: close the menu
jo.menu.show(false)
end,
})
-- 2. Add the items
menu:addItem({
title = "Hats",
icon = "hats",
child = "hats", -- opens the "hats" menu
})
menu:addItem({
title = "Leave",
onClick = function()
jo.menu.show(false)
end,
})
-- 3. Send the menu to the NUI
menu:send()
-- A second menu, opened by the "Hats" item
local hats = jo.menu.create("hats", { title = "Tailor", subtitle = "Hats" })
hats:addItem({
title = "Stetson",
icon = "hats",
price = { money = 12.5 },
onClick = function(currentData)
print("Buy", currentData.item.title)
end,
})
hats:send()
-- 4. Choose the menu to display and show it
jo.menu.setCurrentMenu("tailor")
jo.menu.show(true)
end
RegisterCommand("tailor", openTailor)

How it works β
- A menu is a table created with
jo.menu.create()and identified by its ID. It holds the configuration (title, type, callbacks...) and the list of items. - An item is a line (or a tile) of the menu, added with
MenuClass:addItem(). All its options are listed in Items. - The NUI only knows the menus you send with
MenuClass:send(). After changing a menu, send the changes withMenuClass:push()orMenuClass:refresh(). See Update a menu. - The current menu is the one displayed by
jo.menu.show(). Change it withjo.menu.setCurrentMenu(), or let the player navigate with thechildkey of the items. - The callbacks (
onClick,onActive,onChange...) receive the current state of the menu:{menu = menuID, index = activeItemIndex, item = activeItem}. See Events.
Going further β
| Page | Content |
|---|---|
| Menus | Menu types, title, image, navigation, display, translations, controls |
| Items | Icons, texts, colors, prices, tile options |
| Sliders | Default, switch, grid, palette, sprite and color sliders |
| Statistics | Text, bars, icons, weapon bars and prices under the description |
| Events | Callbacks, order of the events, update a menu while it's open |
| Functions | Reference of all the functions and methods |