Skip to content

3.1 A simple Dialog Widget

BDC_Patrick edited this page Nov 12, 2025 · 13 revisions

Creating a new Widget

In your Content Browser, right-click and select User Interface, followed by User Widget in the Submenu.
[Image of Widget Create]
You can now decide, what kind of Widget you want to create.
UserWidget: The Basic UMG Widget
CommonUserWidget: (only when CommonUI is enabled) The Input rooted UserWidget of CommonUI.
CommonActivatableWidget: (only when CommonUI is enabled) The focus and Input capturing Widget of CommonUI.

No matter what kind you chose, after opening you need to first head to the Graph View.
[Image of to Graph View]
Here, select Class Settings and look for Implemented Interfaces.
[Image of Implement Interface]
Implement the Interface named BDC_DialogBackend_InterfaceUI

[Image of Adding Interface]
This adds a bunch of new Events, you can implement by double-clicking them in the Interface List above the Widget Variables.
[Image of InterfacesEvents]

Building a simple Layout

[Image of Widget layout]
The most simple Layout for a Dialog Widget is to have a Message Box showing the Speaker Name, Avatar and Message.
The Message Covered/wrapped with a Button, so on Click or Gamepad press, you forward the Message.
Alternative to a Button, you can also use the Function overrides for OnPreviewKeyDown, to trigger the forwarding.
The Example Widget in the Plugin's content folder also features a combobox, listing all participating actor names.

An easy Event structure

[Image of Widget Graph]
The Event system for the Widget is build around the Interface functions OnDialogStarted, OnDialogFinished and OnDialogUpdated.
You can also add two more optional Events of the Interface for OnDialogWaiting and OnEventOccured.

OnDialogStarted

This Event is called, when the Dialog of this Widget is starting. You can use it to trigger a Roll-up Animation, initialize SceneCaptures or whatever you need before showing a Message.

OnDialogFinished

Just as started, there is the finished Event, firing before the Widget gets removed. Use it for destruction and removing.

OnDialogWaiting

It is called each interval of a Delay Node, or the AutoForward of a Message.
Use it to handle a waiting time indicator.

OnEventOccured

Like for the Participant Component or the Subsystem Event Dispatcher, this is called whenever an Event-Node is handled in the Dialog, allowing you to trigger Events on the Widget.

OnDialogUpdated

This is the Main Event of the Interface, since it transports your Message Data. Use it to fill the Speaker Name, Avatar, the actual Message Text and playable Sounds.
You also can check for available Options of this Message Node.
If using a Button for continuing the Message - for Gamepad support, you also want to set the Focus to that Button here, to handle the Gamepad correctly.

You always can use Subsystem Functions to gather Data from the Dialog at any state.

Options

Documentation Index

I. What is the Dialog Backend?
II. Setting up
III. Binding UI
IV. The Subsystem
V. The Components
VI. Dispatchers
VII. Others

Demo available: Demo Page

Clone this wiki locally