Skip to main content
The menu hides the game’s own HUD for you. Anything drawn in its own NUI is a different resource and a different browser page, so nothing the menu does to the game reaches it. These are the four ways to find out it is open.

Exports

client
Whether the menu is on screen right now.
client
Throws away the cached headshot so the next open renders a new one. Call it after a clothing change, which is the one thing the cache cannot see: the ped and the model are both unchanged.

Events

client event
Fires with true when the menu opens and false when it closes.
client event
The event form of RefreshPortrait, for a resource that would rather not reach for an export.

State bag

LocalPlayer.state.pauseMenuOpen is set for as long as the menu is up. This is the one to reach for in a resource you do not want to add a dependency to.
Most HUDs hide themselves when IsPauseMenuActive() is true. That never becomes true once this resource is running, because the native pause menu is exactly what it replaces. Swapping that check for the state bag above is usually a one line change.

Hooks

client/hooks.lua ships readable and is the place for anything that does not fit an export or an event. It survives updates in the sense that it is yours to edit, but replacing the folder overwrites it, so keep a copy.
client/hooks.lua

Keybinds from other resources

A keybind registered with RegisterKeyMapping cannot be blocked by this resource, or by any resource. It bypasses the control system entirely, by design. The menu sidesteps it by taking the keyboard away from the game while it is open, which is why an inventory on a hotkey stays shut. That is also why there is no controller support: a pad can only be read while the game still has input, and keeping it would hand every other keybind back at the same time.
ox_inventory is handled for you. The menu sets LocalPlayer.state.invBusy, which is what its own keybind checks before opening, and clears it again only if this menu was what set it.

A framework we do not support

server/adapters.lua ships readable. Define a function there and it is asked before the bridge; return nil from one and the bridge answers instead, so you can override one answer and leave the rest alone.
server/adapters.lua
The full list is in the file: PlayerName, JobInfo, Balance and ItemCount.