---
title: AFS_UI_Popups
product: Advanced Framework Pro
version: 1.0
engine: Unreal Engine 5.8
updated: 2026-10-05
canonical: https://docs.human-codeable.com/plugins/afs-ui-popups.html
---

System

# AFS_UI_Popups

Modal popups anchored in pawn UI space, with configurable buttons, icon, title and body.

#### What it gives you

- Modal confirmation and message dialogs
- Any number of buttons with hierarchy styling
- Correct spatial placement on every platform

#### Requires

None

#### Required by

None

2 assets9 API members

## Description

Popups are for decisions that must be made before continuing. `BFL_Popups.Popup_ShowPopup_Default` builds one from an icon, a title, body text and an array of button definitions, anchors it in pawn UI space and returns the widget so you can bind to the buttons.

Placement comes from a `PDA_PawnUIPosition` data asset, so a popup sits at a comfortable reading distance in VR and centred on screen on desktop, from the same call.

## Setup

1. Enable `AFS_UI_Popups`. It requires `AFS_UI_Pawn` and `AFS_UI`.
2. Confirm the pawn has `BPC_PawnAbility_PawnUI`.
3. Call the library function.

## Usage

### Showing a confirmation

Pass two entries in **Button Contents** and matching **Button Presets** to style one as primary and one as secondary. Bind to the returned widget's button delegates.

### Blocking interaction behind the popup

Use `setAbilityRestriction` on the pawn to suppress interaction abilities while the popup is open, then release when it closes.

[![A modal popup with two buttons](../images/AFS_UI_Popups_result-1623.webp?v=01f5a633)](../images/AFS_UI_Popups_result-1623.webp?v=01f5a633)

A modal popup with two buttons

## Key properties

| Property | When to change |
|---|---|
| `Button Contents` / `Button Presets` | The buttons and their visual hierarchy |
| Position data asset | Where the popup sits relative to the player |

## Extending

Derive from `WBP_Popup_Default` for a different popup layout.

## Example map

`Map_Examples_Popups` demonstrates several popup configurations.

## Troubleshooting

**The popup appears behind something.** Its pawn UI position overlaps another element; give it a dedicated position data asset.

## API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

### Libraries

**BFL_Popups**1 members

extends `BlueprintFunctionLibrary`

Function library for modal popups. Show Popup Default adds the default popup widget to the pawn's UI space at the popup position and fills in its icon, title, body, button row and sound in a single call, returning the widget so you can bind to its buttons. Called statically; the pawn needs the pawn UI ability for anything to appear.

| Kind | Name | Signature | Description |
|---|---|---|---|
| fn | `Popup_ShowPopup_Default`Popup | `(Pawn: Pawn, Outline_Color: PDA_Color, Icon_Color: PDA_Color, Icon: Texture2D, Title_Color: PDA_Color, Title: text, BodyText: text, ButtonContents: ST_Button_Content[], ButtonPresets: E_UI_Hierarchy[], Sound: SoundBase, __WorldContext: Object, out Popup Default: WBP_Popup_Default)` | Shows a modal popup in front of the given pawn and returns the widget so its button delegate can be bound. The pawn needs the Pawn UI ability component; the popup is placed by the shipped popup position asset, so it appears at a comfortable reading distance in VR and centred on screen elsewhere. |

### Widgets

**WBP_Popup_Default**8 members

extends `WBP_Base`

Default popup layout: an icon, a title, a body and a row of buttons inside an outlined scaffold, with each of the colours taking a colour data asset. Initiate Popup fills the whole thing in one call and plays the sound half a second later. Shown through the popup library; subclass or copy it when a popup of your own wants a different arrangement.

| Kind | Name | Signature | Description |
|---|---|---|---|
| event | `InitiatePopup` | `(Outline_Color: PDA_Color, Icon_Color: PDA_Color, Icon: Texture2D, Title_Color: PDA_Color, Title: text, BodyText: text, ButtonContents: ST_Button_Content[], ButtonPresets: E_UI_Hierarchy[], Sound: SoundBase)` | Fills the popup in one pass — colours, icon, title, body and buttons — then plays the given sound half a second later so it lands with the appear animation rather than ahead of it. Called for you by Show Popup Default; call it directly only if you spawned the widget yourself. |
| event | `UpdateIcon` | `(Icon: Texture2D)` | Replaces the icon above the title. The image collapses when no texture is given, so the title moves up to fill the space. |
| event | `UpdateTitle` | `(Text: text)` | Replaces the popup's title text. The title collapses when the text is empty. |
| event | `UpdateBody` | `(Text: text)` | Replaces the body text and re-picks its alignment: under fifty characters it is centred, longer text is left-aligned so it stays readable. The body collapses when the text is empty. |
| event | `UpdateButtons` | `(ButtonContents: ST_Button_Content[], ButtonPresets: E_UI_Hierarchy[])` | Rebuilds the row of buttons along the bottom from the given contents and hierarchy presets, and collapses the row entirely when the contents array is empty. The two arrays are read in step, so the first preset styles the first button. |
| event | `UpdateTitleColor` | `(TitleColor: PDA_Color)` | Overrides the title colour with a colour asset, ignoring the theme. Use it to mark the popup as a warning or an error. |
| event | `UpdateOutlineColor` | `(OutlineColor: PDA_Color)` | Overrides the colour of the frame drawn around the popup. This is the strongest signal of severity the popup has, so it is worth setting on anything destructive. |
| event | `UpdateIconColor` | `(Color: PDA_Color)` | Overrides the tint applied to the icon, ignoring the theme. Pair it with the outline colour so the two agree. |
