ui.get_tree
Overview
- Returns the visible UMG widget tree as JSON - a text substitute for looking at a screenshot. Prefer scoping it: 'ui.get_tree GameOption' returns only that window and is far smaller than the whole screen. 'top' selects the top-most window, which is what you usually want right after a popup appears. Without --window the entire screen is returned, grouped by UI layer. Layout-only containers (CanvasPanel, Overlay, SizeBox, boxes) are folded away and their children lifted, label text is absorbed into the button/tab that owns it, collapsed or unpainted or off-screen subtrees are dropped, and more than 12 identical siblings collapse into a {role:'more', count:N} entry. Only interactive nodes get a 'ref' and a 'rect' - everything else is there to be read, not clicked. Scroll containers report offset/max/pos, and list views additionally report the total item count plus the index range that currently has entry widgets (items outside that range are virtualized away and have no widget at all, so you must scroll to reach them). When the max_nodes budget is hit the response carries a 'truncated' field - it never drops nodes silently. Fails if --window matches no visible window. This command never creates a widget, so it is safe to poll; widgets opened this very frame appear one poll later.
Metadata
| Field | Value |
|---|---|
| Display | Get UI Tree |
| Category | ui |
| Access | Public |
| Scope | B1Standalone |
| Tags | Experimental |
| Aliases | — |
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| window | string | no | — | Restrict to one window: a UIType name (GameOption), a window instance name (WBP_GameOption_C_0), or 'top' for the top-most window. Omit for the whole screen. |
| mode | string | no | interactive | interactive = clickable nodes plus readable text (default). full = everything except decoration. |
| max_nodes | int | no | 150 | Node budget for the response [1-5000]. Interactive nodes are kept first. |
| depth | int | no | 0 | Maximum tree depth. 0 = unlimited. |
| include_offscreen | bool | no | false | Include nodes whose rect lies outside the viewport. |
| show_decor | bool | no | false | Include decoration nodes (images, spacers, throbbers). |
| verify_hit | bool | no | false | Hit-test every interactive node at its centre and mark the unreachable ones with state 'unreachable'. Accurate but costly - leave off for routine polling. |
Usage
await inzoi.cli.execute('ui.get_tree', {
window: '', // optional
mode: 'interactive', // optional
max_nodes: 150, // optional
depth: 0, // optional
include_offscreen: false, // optional
show_decor: false, // optional
verify_hit: false, // optional
});