HUDClient3 outputs

getMenuLayoutChangedEventDetails

GET_MENU_LAYOUT_CHANGED_EVENT_DETAILS0x7E17BE53E1AAABAF

The GTA V native GET_MENU_LAYOUT_CHANGED_EVENT_DETAILS of the HUD namespace, as LS:MP client scripts call it: the global function getMenuLayoutChangedEventDetails, in JavaScript and in Lua.

SignatureJavaScript
getMenuLayoutChangedEventDetails(): [
  lastItemMenuId: number,
  selectedItemMenuId: number,
  selectedItemUniqueId: number
]
SignatureLua
getMenuLayoutChangedEventDetails(): integer, integer, integer

Usage

JavaScript
const [lastItemMenuId, selectedItemMenuId, selectedItemUniqueId] =
  getMenuLayoutChangedEventDetails();
Lua
local lastItemMenuId, selectedItemMenuId, selectedItemUniqueId =
    getMenuLayoutChangedEventDetails()

Parameters

None. The game writes the outputs: they are handed back, not passed in.

Returns

3 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1lastItemMenuIdintnumberintegerthis is the menuID of the last selected item minus 1000 (lastItem.menuID - 1000) output
2selectedItemMenuIdintnumberintegersame as lastItemMenuId except for the currently selected menu item output
3selectedItemUniqueIdintnumberintegerthis is uniqueID of the currently selected menu item output

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

when the pausemenu is closed:
lastItemMenuId = -1
selectedItemMenuId = -1
selectedItemUniqueId = 0

when the header gains focus:
lastItemMenuId updates as normal or 0 if the pausemenu was just opened
selectedItemMenuId becomes a unique id for the pausemenu page that focus was taken from (?) or 0 if the pausemenu was just opened
selectedItemUniqueId = -1

when focus is moved from the header to a pausemenu page:
lastItemMenuId becomes a unique id for the pausemenu page that focus was moved to (?)
selectedItemMenuId = -1
selectedItemUniqueId updates as normal

Reference

Namespace
HUD HUD
In the game
void GET_MENU_LAYOUT_CHANGED_EVENT_DETAILS(int* lastItemMenuId, int* selectedItemMenuId, int* selectedItemUniqueId)
Hash
0x7E17BE53E1AAABAF
Formerly
_GET_PAUSE_MENU_SELECTION_DATA

Open in the interactive natives reference