OnClientNativeUiResult: Difference between revisions
Document native HUD/menu Lua APIs available since 0.1.7; client BUILD202 and save/load protection |
Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits |
||
| (One intermediate revision by the same user not shown) | |||
| Line 38: | Line 38: | ||
== Notes == | == Notes == | ||
* Client-side only; | * 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. | * 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. | * Register before submitting. Multiple changes can coalesce; intermediate request IDs are not guaranteed a result. | ||
| Line 47: | Line 47: | ||
[[Category:Lua Events]] | [[Category:Lua Events]] | ||
[[Category:Client Events]] | [[Category:Client Events]] | ||
<!-- crafting019:start --> | |||
== 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. | |||
<!-- crafting019:end --> | |||
Latest revision as of 13:28, 20 October 2026
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.