GetNativeUiState

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 20:56, 19 October 2026 by QCherry (talk | contribs) (Complete upcoming 0.1.9 documentation: weather, crafting UI, world removal, doors and ladders; preserve release status)
Jump to navigation Jump to search

getNativeUiState

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.

Read the calling resource's requested policy and most recent native UI acknowledgement as a Lua table.

Syntax

state = getNativeUiState()

Parameters

This function does not accept parameters.

Returns

A Lua table. Before a native observation: known=false, fresh=false, pending=false and zero requested masks. Native fields may be absent. After requests, fields include request, requestedHudMask, requestedMenuMask, pending, applied, reason, known and fresh. Native observations add supported, ready, effectiveHudMask, effectiveMenuMask, components, menus and saveLoadBlocked.

Examples

local state = getNativeUiState()
if state.known and state.fresh and state.applied then
    outputDebugString("Latest native UI policy acknowledged")
end

Notes

  • Client-side only; the original API exists since 0.1.7. Crafting extensions require 0.1.9; use matching updated client/server versions.
  • See Native HUD and menus for asynchronous acknowledgements, resource ownership, input and restoration.
  • A fresh native snapshot requires an active connection and observation less than 6000 ms old. pending=false alone does not indicate success.
  • components and menus booleans indicate effective permission, not current widget existence or visibility. Effective restrictions combine all resources.
  • HUD mask bits: bars=1, crosshair=2, interaction=4, hotbar=8, notifications=16, combat_markers=32. Menu bits: inventory=1, journal=2, glossary=4, stats=8. Set bits mean restricted.
  • Additional native guard/widget counters are diagnostics, not a replacement for readiness or freshness checks.

Crafting presentation from 0.1.9

Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated clients and server.

Native crafting UI documents the new crafting component, recipe/progress windows, preserved station entry/exit and prevention of invisible recipe starts. It is not a setNativeMenuEnabled key or a custom recipe API. getNativeUiState gains components.crafting, craftingReady, craftingGuardReady, craftingWidgets and craftingObserved; HUD bit 64 is appended, older bits unchanged. Existing resource ownership, asynchronous result handling and restoration still apply. Full station-by-station in-game qualification remains pending.