DreamGUI
Reference

UDreamDialog

A dialog whose hierarchy is code, not an asset: a dimmer, a centred panel, a title, a content

Inherits from UDreamUIControl.

Declared in Public/Controls/DreamDialog.h.

A dialog whose hierarchy is code, not an asset: a dimmer, a centred panel, a title, a content area with a message in it, and a row of buttons.

WHAT IT DOES NOT DO, because UDreamUIModalSubsystem already does it. Opened through ShowModal the dialog is parented to that subsystem's modal LAYER, which is itself the scrim (a full-rect tinted rect block), carries the UUIEventBlocker that eats every pointer event aimed at the world beneath, sorts above the page band, and pushes a UDreamUIModalScope that confines gamepad focus and gives Back the meaning "close with the Back result". None of that is re-implemented here. The division is: the SUBSYSTEM owns the screen (dimming, input blocking, focus, one-at-a-time queueing and carrying the result back to the caller); the DIALOG owns the panel (what it says, which buttons it offers, which result each of them means) and ends the modal by calling CloseTopModal.

The dimmer part therefore exists for the OTHER supported arrangement -- standalone. Dropped into a .dui as an ordinary widget (asleep, woken when something needs to ask a question) there is no subsystem layer above it, so the dialog's own dimmer is the only thing darkening the screen and its UUIEventBlocker the only thing stopping clicks reaching what is behind. When a host IS already scrimming -- detected as a blocker anywhere up the parent chain, which is exactly what the modal layer carries -- the dialog puts its own dimmer away rather than darkening the screen twice. Both arrangements are supported; nothing about the tree changes between them.

Buttons are real Native.Button instances rather than hand-built faces, so a project styles its buttons once and dialog buttons follow. FDreamDialogStyle carries Button and PrimaryButton for exactly this, and the created buttons are switched to Inline style source: the dialog style has ALREADY resolved (sheet or instance) and the look it names must win, or every dialog button would quietly re-resolve to the sheet's plain button and those two style fields would do nothing.

On the button LIST and .dui: the language has no array literal yet, exactly as Native.Dropdown's Options honestly says. Buttons is still fillable from C++, from Blueprint and from the details panel -- and the constructor seeds Cancel + OK (OK primary), so the common dialog needs no array at all:

/Script/DreamGUIControls.DreamDialog Confirm {
    Title   = "删除存档"
    Message = "这个操作不能撤销。"
    OnDialogClosed -> HandleAnswer

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
StyleFDreamDialogStyleDialogyesSetStyleThis instance's own look. The project sheet wins while StyleSource says so AND a sheet actually exists; with no sheet in the project this IS the look in effect -- which is why it stays editable instead of being gated on the enum.
TitleFTextDialogyesGetTitle / SetTitleEmpty puts the title away entirely rather than reserving a blank line for it.
MessageFTextDialogyesGetMessage / SetMessageThe built-in occupant of the content area. Empty puts it away; the area stays for other content.
ButtonsTArray<FDreamDialogButton>Dialogyesread onlyOne Native.Button per entry, left to right. Seeded with Cancel + OK; see the class comment.
CancelResultFNameDialogyesSetCancelResultWhat Close is called with when the dialog is cancelled rather than answered -- RequestCancel, and whatever a project routes Escape or Back to.
bFocusDefaultButtonboolDialogyesSetFocusDefaultButtonPut focus on the default button when the dialog appears.
bCloseOnBackboolDialogyesSetCloseOnBackBack (Escape, or the pad's B) closes this dialog with its cancel result.
bCloseOnDimmerClickboolDialogyesSetCloseOnDimmerClickClicking the dimmer closes the dialog with its cancel result -- the "click outside to dismiss" every desktop dialog has.
bShowDimmerboolDialogyesGetShowDimmer / SetShowDimmerWhether this dialog darkens the screen itself.
DimmerNodeTObjectPtr<UDreamWidget>Dialog-read onlyThe whole-screen scrim. Asleep whenever a host is already scrimming; see the class comment.
PanelNodeTObjectPtr<UDreamWidget>Dialog-read only
TitleNodeTObjectPtr<UDreamWidget>Dialog-read only
BodyNodeTObjectPtr<UDreamWidget>Dialog-read onlyThe hole in the middle band. Empty is the normal state; what a host puts here replaces the built-in message, which is its overlay sibling rather than its child for exactly that reason.
ContentNodeTObjectPtr<UDreamWidget>Dialog-read onlyThe middle band. Holds MessageNode, and is where a consumer's own content goes.
MessageNodeTObjectPtr<UDreamWidget>Dialog-read only
ButtonRowNodeTObjectPtr<UDreamWidget>Dialog-read only
ButtonWidgetsTArray<TObjectPtr<UDreamButton> >Dialog-read onlyOne per entry in Buttons, in order. Rebuilt whenever the specs change.
BackScopeTObjectPtr<UDreamDialogScope>Dialog-read onlyThe navigation scope, added only while standalone: it takes focus when the dialog appears, gives it back when the dialog closes, answers Back while bCloseOnBack asks, and keeps the pad and Tab inside the dialog while it is dimmed, whatever bCloseOnBack says. It belongs to the dialog's owning player. See UDreamDialogScope.

Functions

FunctionKindDescription
void Close(FName InResult)callableEnd the dialog with InResult.
void FocusDefaultButton()callablePut focus on the default button now. Called for you whenever the dialog appears while bFocusDefaultButton is on; public because a dialog whose buttons were replaced after it appeared has a new default.
TArray<FDreamDialogButton> GetButtons()pureGet Buttons
UDreamButton* GetDefaultButton()pureThe primary button, or the last one when none is marked, or null for an empty row.
FText GetMessage()pureGet Message
bool GetShowDimmer()pureGet Show Dimmer
FText GetTitle()pureGet Title
void RequestCancel()callableClose with that result. What a project's Escape or Back handler calls, and what a scrim click would call -- this control does not route either itself (see the class comment).
FName ResolveCancelResult()pureThe result this dialog answers with when it is cancelled rather than answered: CancelResult when it names one, and otherwise the button row's own cancel (see CancelResult).
void SetButtons(TArray<FDreamDialogButton> InButtons)callableReplace the button row wholesale; the widgets are rebuilt from the new specs at once.
void SetCancelResult(FName InCancelResult)callableWhat Back and a click on the dimmer answer with. Read at the moment of the dismissal.
void SetCloseOnBack(bool bInCloseOnBack)callableWhether Back closes the dialog. The Back scope is added or released to match, which is why this is a setter.
void SetCloseOnDimmerClick(bool bInCloseOnDimmerClick)callableWhether a click outside closes the dialog. The scrim's button is added or unbound to match.
void SetFocusDefaultButton(bool bInFocusDefaultButton)callableSet Focus Default Button
void SetMessage(FText InMessage)callableSet Message
void SetShowDimmer(bool bInShowDimmer)callableWhether this dialog darkens the screen itself, re-decided at once.
void SetStyle(FDreamDialogStyle InStyle)callableReplace the look and push it. A write straight onto the variable changes a struct nothing reads again.
void SetTitle(FText InTitle)callableSet Title
void SubmitDefaultButton()callableAnswer as the default button would -- UMG's "Enter presses the default".

Events

EventSignatureDescription
OnDialogClosedvoid DreamDialogResultEvent__DelegateSignature(FName Result)The dialog closed, however it closed. Fires exactly once, BEFORE the modal host tears it down.
OnButtonClickedvoid DreamDialogResultEvent__DelegateSignature(FName Result)What the buttons speak, re-broadcast at the control: a consumer binds here, not to a button.

On this page