Navigation
API > API/Plugins > API/Plugins/SlateInspectorToolset
Playwright-style Slate UI automation toolset.
Exposes snapshot, screenshot, and interaction tools for driving the Unreal Editor UI programmatically. Registered via UToolsetRegistry so the ModelContextProtocol plugin picks them up automatically.
A shallow root observer (depth 0) continuously tracks top-level windows. Before working with a specific window or panel, call Observe() on it to get deep widget coverage, then Unobserve() when done. Observers walk their subtree every ~100ms, assigning refs to newly appeared widgets and keeping the ref cache current.
Input simulation uses direct Slate event APIs (ProcessKeyCharEvent, ProcessMouseButtonDownEvent, etc.) rather than the AutomationDriver, because AutomationDriver's synchronous API deadlocks when called from the game thread (which is where MCP tool calls execute).
| Name | USlateInspectorToolset |
| Type | class |
| Header File | /Engine/Plugins/Experimental/Toolsets/SlateInspectorToolset/Source/SlateInspectorToolset/Public/SlateInspectorToolset.h |
| Include Path | #include "SlateInspectorToolset.h" |
Syntax
UCLASS (BlueprintType, MinimalAPI)
class USlateInspectorToolset : public UToolsetDefinition
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UToolsetDefinition → USlateInspectorToolset
Functions
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool Click
(
const FString& Ref, |
Click a Slate widget identified by its ref. | SlateInspectorToolset.h |
|
static bool Drag
(
const FString& StartRef, |
Drag from one Slate widget to another (mouse down, move, release). | SlateInspectorToolset.h |
|
static bool FillForm
(
const TArray< FSlateInspectorToolsetFormField >& Fields |
Fill multiple Slate form fields at once. | SlateInspectorToolset.h |
|
static FVector2D GetWidgetScreenCenter
(
TSharedRef< SWidget > Widget |
Get the absolute screen-space center of a widget. | SlateInspectorToolset.h | |
static bool Hover
(
const FString& Ref |
Hover over a Slate widget, triggering any hover state or tooltip. | SlateInspectorToolset.h |
|
static FString ListObservers () |
List all active observers as a JSON array for debugging. | SlateInspectorToolset.h |
|
| Register an observer on a widget subtree so its refs are continuously kept up to date (~100ms tick). | SlateInspectorToolset.h |
|
|
static FKey ParseMouseButtonKey
(
const FString& Button |
Map a button name ("left", "right", "middle") to an FKey. | SlateInspectorToolset.h | |
| Press and release a keyboard key on the currently focused Slate widget. | SlateInspectorToolset.h |
|
|
static TSharedPtr< SWidget > ResolveRefOrWarn
(
const FString& Ref |
Resolve a ref to a widget, logging a warning if it fails. | SlateInspectorToolset.h | |
static FToolsetImage Screenshot
(
const FString& Ref |
Screenshot a Slate widget or the active editor window. | SlateInspectorToolset.h |
|
static bool SelectOption
(
const FString& Ref, |
Select an option in a Slate combobox by its text label. | SlateInspectorToolset.h |
|
static bool SimulateClick
(
TSharedRef< SWidget > Widget, |
Simulate a mouse click at a widget's screen-space center. | SlateInspectorToolset.h | |
| Capture a Slate UI accessibility snapshot. | SlateInspectorToolset.h |
|
|
| Type text into a Slate text input widget. | SlateInspectorToolset.h |
|
|
static bool Unobserve
(
const FString& Identifier |
Remove an observer by its identifier. | SlateInspectorToolset.h |
|
| Check if text is present or absent in the Slate widget tree. | SlateInspectorToolset.h |
|
|
| List, select, or close top-level Slate editor windows. | SlateInspectorToolset.h |
|