SetNativeMenuEnabled

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

setNativeMenuEnabled

AVAILABLE FROM UPDATE 0.1.7
This function is available in G1R:MP 0.1.7 and later. The contract below includes the compatibility guarantees introduced in that update.

Disable or release native inventory, character statistics, journal or glossary opening for this resource. Ordinary Lua key bindings remain available.

Syntax

requestId = setNativeMenuEnabled(menu, enabled)

Parameters

Name Type Required Description
menu string yes inventory (I), stats (K), journal (J), glossary (G), or all. Keys shown are native defaults.
enabled boolean yes false disables the menu; true releases this resource's restriction, without opening it.

Returns

Positive numeric request ID if queued, or false if rejected. This is not an application acknowledgement. Unknown menu keys return false.

Examples

setNativeMenuEnabled("inventory", false)
-- Use bindKey and your own RmlUi document separately.
setNativeMenuEnabled("inventory", true)

Notes

  • Client-side only; available since 0.1.7. Use client BUILD202 or newer with a compatible Protocol 39 server.
  • See Native HUD and menus for asynchronous acknowledgements, resource ownership, input and restoration.
  • A positive request ID means queued, not applied. Listen for onClientNativeUiResult and inspect getNativeUiState.
  • Register the handler before submitting. Rapid changes coalesce: track the latest request ID, not every intermediate ID.
  • false restricts; true releases only the calling resource's restriction. Other resources remain respected.
  • This does not change inventory data, player attributes or custom RmlUi documents. Native save/load cannot be re-enabled.