Reference · Updated 2552.07.26.14.59
Codex Handoff — UMG Widget-Tree Authoring (Phase 0b menus)
Purpose. This is a self-contained task spec for an agent with computer-use (mouse/keyboard control) to build UMG widget trees in the already-open Unreal Editor 5.7 for the SystemLi
Purpose. This is a self-contained task spec for an agent with computer-use (mouse/keyboard control)
to build UMG widget trees in the already-open Unreal Editor 5.7 for the SystemLink project. These trees
can't be built by the Python scripting bridge (WidgetTree is engine-protected), which is why they're
delegated here. Everything else (C++, data assets, styles, CDO properties) is already done via the bridge.
You are the hands in the editor. All asset paths, widget names, and property values below are exact —
use them verbatim. Names are case-sensitive and must match precisely (a mismatched BindWidget name
silently binds to null with no warning).
#Context you need
- App: Unreal Editor 5.7, project SystemLink — already open. Do not open a different project.
- Editor layout of a UMG (Widget Blueprint) editor: left = Palette (widget types to drag) + Hierarchy
(the tree); center = Designer canvas; right = Details. Top bar has Compile and Save. There's a Graph / Designer toggle (top-right) for the event-graph view.
- To add a widget: drag it from the Palette onto the target parent in the Hierarchy (dropping onto a
panel makes it a child). To rename: double-click the widget in the Hierarchy and type the new name.
- To find a widget type in the Palette: use the Palette search box; type the class name.
#Guardrails
- Only touch the four assets named below. Do not modify any other asset, or any C++.
- After each asset: click Compile, then Save. If Compile shows an error you can't resolve, stop and
report what you see — don't guess-fix.
- If an asset already has some of these widgets, reconcile to the target state rather than duplicating.
- You do not set
PauseMenuClass— that's done separately via the bridge. Skip anything not listed here.
#Task A — WBP_SL_Button (do this FIRST; the menus place instances of it)
Path: /Game/SystemLink/UI/Menus/WBP_SL_Button — parent class USLButtonBase. It already has Style set; its tree is currently empty. Goal: give it a label text block so buttons show their caption.
- Content Browser → navigate to
/Game/SystemLink/UI/Menus/→ double-clickWBP_SL_Button.
- In the Palette, search
CommonTextBlock. Drag one into the Hierarchy so it becomes the root
(drop it on [WBP_SL_Button] root node). If a default root panel (e.g. CanvasPanel) exists, you may drop the CommonTextBlock inside it — either is fine.
- Rename that CommonTextBlock to exactly
ButtonText(case-sensitive — the C++ bindsButtonText).
- Select
ButtonText→ in Details, set Horizontal Alignment = Center and **Vertical Alignment =
Center** (and if it's under a Canvas, set anchors to center or use a SizeBox — the goal is the text sits centered in the button).
- Compile → Save.
Note: you do not type caption text here. Each placed instance of WBP_SL_Button gets its caption from a
property calledButtonDisplayText(see Task C/D).NativePreConstructcopiesButtonDisplayTextinto
ButtonText automatically.
#Task B — WBP_SL_BoundActionButton (the action-bar prompt entry)
Path: /Game/SystemLink/UI/Menus/WBP_SL_BoundActionButton — parent class CommonBoundActionButton. Empty tree.
- Double-click it to open.
- Palette →
CommonTextBlock→ drag into the Hierarchy (root or inside a root panel).
- Rename it to exactly
Text_ActionName(case-sensitive — requiredBindWidgeton the engine base class;
the button won't compile-bind its prompt label without this exact name).
- Compile → Save.
#Task C — WBP_SL_PauseMenu
Path: /Game/SystemLink/UI/Menus/WBP_SL_PauseMenu — parent class USLScreenWidget. Empty tree.
Build the hierarchy:
- Open it. Palette →
Vertical Box→ drag onto the root so the tree root is aVerticalBox.
(Rule: navigation panels are VerticalBox, never CanvasPanel.)
- Palette → search
WBP_SL_Button(your own widget from Task A appears under User Created). Drag three Btn_ResumeBtn_SettingsBtn_LeaveMatch
into the VerticalBox. Rename them (double-click in Hierarchy):
| 3. For each of the three, select it → in Details, find the **SystemLink | UI** category → set |
|---|
Button Display Text:
Btn_Resume→ResumeBtn_Settings→SettingsBtn_LeaveMatch→Leave Match
- Palette → search
CommonBoundActionBar→ drag one into theVerticalBoxbelow the three buttons.
Rename it ActionBar. Select it → in Details, set its Action Button class to WBP_SL_BoundActionButton.
Class Defaults (screen behavior):
- Click Class Defaults (button in the top toolbar of the editor, or the "Class Defaults" node). In Details,
| under **SystemLink | UI**: |
|---|
- Set
Pause Game While Active= checked (true). - Leave
Auto Focus WidgetBLANK — do NOT use its dropdown (it silently reverts + can crash the editor).
Initial focus is set via a graph override instead (next step). (Leave InputMode/back-handler alone — inherited from USLScreenWidget.)
Initial controller focus (graph override — do NOT use the Auto Focus Widget picker): 5b. Switch to the Graph tab. In the My Blueprint panel → Functions → Override dropdown → pick Get Desired Focus Target. In that function, drag in the Btn_Resume variable and wire it into the function's Return Value, then Compile. (This persists where the CDO picker does not.)
Resume wiring (event graph):
- Select
Btn_Resumein the Hierarchy. In Details, scroll to Events and click the + next to
On Clicked ( ) — this creates/opens the OnClicked (Btn_Resume) event node in the Graph.
- From that event's exec pin, build: Get Owning Player Controller → Cast to
SLPlayerController→ - (Get Owning Player Controller → drag off its return → "Cast to SLPlayerController" → drag off "As SL Player
call Close Pause Menu (on the cast result). Wire exec straight through.
Controller" → "Close Pause Menu".)
- Leave
Btn_Settings/Btn_LeaveMatchunwired (stubs for now).
- Compile → Save.
#Task D — WBP_SL_TestScreen
Path: /Game/SystemLink/UI/Menus/WBP_SL_TestScreen — parent class USLScreenWidget. Empty tree. Same shape, simpler:
- Root =
Vertical Box.
- Two
WBP_SL_Buttoninside it:Btn_One,Btn_Two. Set theirButton Display TexttoButton One/
Button Two.
- A
CommonBoundActionBarnamedActionBarbelow them; Action Button class =WBP_SL_BoundActionButton.
| 4. **Class Defaults → SystemLink | UI: leave Pause Game While Active unchecked (false)** and |
|---|
Auto Focus Widget blank.
- Graph → override
Get Desired Focus Target→ return theBtn_Onevariable (same as Task C step 5b).
Do NOT use the Auto Focus Widget picker.
- Compile → Save.
#Acceptance (how you know you're done)
- All four assets compile with no errors and are saved (no
*asterisk on the tab).
WBP_SL_Buttonhas aCommonTextBlocknamed exactlyButtonText.
WBP_SL_BoundActionButtonhas aCommonTextBlocknamed exactlyText_ActionName.
WBP_SL_PauseMenu: VerticalBox →Btn_Resume/Btn_Settings/Btn_LeaveMatch(with display text) +
ActionBar; Class Defaults Pause Game While Active = true (Auto Focus Widget blank); a Get Desired Focus Target graph override returning Btn_Resume; Btn_Resume OnClicked calls Close Pause Menu on the cast SLPlayerController.
WBP_SL_TestScreen: VerticalBox →Btn_One/Btn_Two+ActionBar;Pause Game While Active = false
(Auto Focus Widget blank); a Get Desired Focus Target graph override returning Btn_One.
Report back: for each asset, whether it compiled+saved cleanly, and paste any warnings/errors you saw. Do not run the game (PIE) — that gate test is handled separately.