CalmUI
Unreal Engine

Show a Confirmation Dialog

Open a dialog and prevent clicks from reaching the menu behind it.

  1. Create a confirmation View in Studio, for example ConfirmExit.
  2. Set its layer to modal, input to block-below, and enable the mouse cursor if the dialog is used with a mouse.
  3. Save and wait for the package to update in Unreal.
  4. Call Open CalmUI Modal with your Player Controller, package, and dialog Screen.
  5. Connect Failed to Print String, using Error Message.
  6. Use Close CalmUI Modal with the same controller when Cancel is received.

Use button actions for Confirm and Cancel. Start one Listen for CalmUI Action node per contract after the package loads. Each listener receives only its selected action, so name comparisons are not needed. The Exit tutorial shows the exact setup.

The top blocking dialog receives input instead of the content below. Closing it returns focus to the next available screen.

Backdrop effects within a View

A fixed dialog overlay can use backdrop-filter: blur(12px) to blur content already painted behind it. The dialog's text and controls remain sharp. An opacity animation on the overlay affects that overlay and its descendants, not the scene background, even when both cover the entire viewport.

For an inline Modal component, keep the dialog mounted until its closing animation finishes so its input barrier remains active during the fade. A separate Modal-layer View follows its View lifecycle instead: closing releases input immediately, even while a configured View exit animation remains visible. Use position: fixed and viewport coverage on an inline overlay; do not move or resize the underlying menu to show it.

GameUI's reusable Modal uses a 420 ms entrance and 240 ms exit. The backdrop fades with overlay opacity; floating cards add a small translation and scale. Fullscreen cards only fade so the viewport edges stay covered. The closing class selects a separate named keyframe animation, which restarts on selection in both Studio/WASM and Unreal. The 240 ms removal timer matches the exit duration and keeps background input blocked until the dialog is removed.

Reuse the GameUI dialog components

In a project containing the updated GameUI sources, open Components → Overlays in Studio. Modal provides the dialog surface. ConfirmDialog adds Cancel and Confirm actions. These are authored components, not new Blueprint nodes. Keep using the Screen workflow above when the dialog is a separate View.

For a dialog inside an existing View, its parent owns the open boolean:

  • Set open to true to show it.
  • Handle close on Modal or cancel on ConfirmDialog and set open to false.
  • Handle closed when the exit animation has finished.
  • Handle confirm by requesting the game operation. Confirmation does not close the dialog or change gameplay data automatically.

Use a unique elementId for each dialog. Modal accepts title, a default content slot, a header slot and an actions slot. variant="blur" enables background blur; variant="fullscreen" fills the viewport. The default is a centered card. Content determines card height and scrolls when it exceeds the available height.

Modal has a close button by default. Set showClose to false when supplying your own actions. closeLabel and closeId customize that button. closeOnBack defaults to true; closeOnBackdrop defaults to false. Close/cancel payloads name the cause: button, back, or backdrop.

Set busy while waiting for the owner to finish an operation. The dialog keeps its input barrier, disables its content, and ignores dismissal. The owner may still force-close it by changing open. Closing also freezes the content until removal. Reopening during exit cancels the pending removal and closed event. Wheel and scrollbar dragging cannot scroll content behind a modal or inside its busy/closing subtree. Active dialog content remains scrollable.

ConfirmDialog accepts message, error, confirmLabel, cancelLabel, confirmId, cancelId, and confirmDisabled. It focuses Cancel before Confirm and blocks repeated confirmation until the owner changes its state. Set busy while waiting; on rejection, set it to false and supply error to allow retry. Its default slot can contain additional details.

Nested dialogs restore focus to their trigger when removed. Sequential focus follows source order, not visual stacking order. A focused field's handled Back can cancel editing first. A forwarded cancel notification without a listener does not prevent Back from reaching the containing dialog.

Compatibility

The updated dialogs use the inert attribute, which keeps a subtree visible but removes its pointer and keyboard/controller interaction. Descendants receive disabled state. Packages using inert declare InertSubtrees (feature bit 14). Update the compiler, Studio/WASM and Unreal runtime together; older readers reject that capability. Package layout remains 1.11 and PaintFrame is unchanged.

On this page