OnClientNativeUiResult
onClientNativeUiResult
Delivers a native HUD/menu policy acknowledgement to the owning resource's resourceRoot. A result concerns policy readiness, not a screenshot or guarantee that every widget currently exists.
Availability
This event is available in client scripts.
Callback signature
function(requestId, ok, reason, stateJson)
Parameters
| Name | Type | Description |
|---|---|---|
requestId |
number |
Request ID returned by a native UI mutator. |
ok |
boolean |
Whether the requested native policy is currently applied and ready. |
reason |
string |
Typically applied or waiting-for-native-ui. |
stateJson |
string |
JSON-encoded native snapshot. Use fromJSON to decode, or getNativeUiState for the full resource state table. |
Examples
addEventHandler("onClientNativeUiResult", resourceRoot,
function(requestId, ok, reason, stateJson)
outputDebugString("Native UI " .. tostring(requestId) .. ": " .. reason)
end)
local latestRequest = showNativeHud(false)
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.
- Register before submitting. Multiple changes can coalesce; intermediate request IDs are not guaranteed a result.
- A waiting result may later be followed by applied for the same ID. Do not assume exactly one result per request.
- Rejected requests returning false do not produce a native acknowledgement. Compare the event ID with your latest accepted request.
- The stateJson snapshot differs from the full getNativeUiState table; requested masks and local pending/fresh fields belong to the latter.
Crafting presentation from 0.1.9
Available from 0.1.9. 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.